author | zecke <zecke> | 2004-11-18 21:45:49 (UTC) |
---|---|---|
committer | zecke <zecke> | 2004-11-18 21:45:49 (UTC) |
commit | 7484344ff5be1f7c54e51715776d0e3cadeb1ed0 (patch) (side-by-side diff) | |
tree | 96f427f7a1fb1c8ca0a6efbd72b51e916cb1651d /libopie2/opiepim/core/opimevent.cpp | |
parent | 3302eb30390e6053637929316670da3e8fbe279e (diff) | |
download | opie-7484344ff5be1f7c54e51715776d0e3cadeb1ed0.zip opie-7484344ff5be1f7c54e51715776d0e3cadeb1ed0.tar.gz opie-7484344ff5be1f7c54e51715776d0e3cadeb1ed0.tar.bz2 |
Big PIM API Update Core Part (1/2 of what should be implemented):
OPimRecords:
-Add a so called safeCast using the rtti value
OPimTodo:
-Fix memleak with OPimState
OPimOccurrence:
-New class. Every 'Access' can give occurrences
for a period of time
Move Documentation
Diffstat (limited to 'libopie2/opiepim/core/opimevent.cpp') (more/less context) (show whitespace changes)
-rw-r--r-- | libopie2/opiepim/core/opimevent.cpp | 19 |
1 files changed, 19 insertions, 0 deletions
diff --git a/libopie2/opiepim/core/opimevent.cpp b/libopie2/opiepim/core/opimevent.cpp index 7bc6c32..1b553d8 100644 --- a/libopie2/opiepim/core/opimevent.cpp +++ b/libopie2/opiepim/core/opimevent.cpp @@ -491,2 +491,21 @@ int OPimEvent::rtti() const +/** + * \brief Cast safely to OPimEvent from OPimRecord + * + * Safely cast from OPimRecord to OPimEvent. If the + * OPimRecord is not of type OPimEvent Null will be + * returned. + * + * @param rec The OPimRecord to be casted to OPimEvent + * + * @see OPimTodo::safeCast + * @return OPimEvent or Null Pointer + */ +OPimEvent* OPimEvent::safeCast( const OPimRecord* rec) { + return ( rec && rec->rtti() == OPimResolver::DateBook ) ? + static_cast<OPimEvent*>( const_cast<OPimRecord*>(rec) ) : + 0l; +} + + |