ZFFramework
|
core map type for private use only More...
#include <ZFCoreMap.h>
Public Member Functions | |
ZFCoreMap (void) | |
construct an empty map | |
ZFCoreMap (const ZFCoreMap &ref) | |
retain the ref, to copy, use copyFrom | |
ZFCoreMap & | operator= (const ZFCoreMap &ref) |
retain the ref, to copy, use copyFrom | |
zfbool | operator== (const ZFCoreMap &ref) const |
true if same ref | |
zfbool | operator!= (const ZFCoreMap &ref) const |
true if not same ref | |
void | objectInfoT (zfstring &ret) const |
see objectInfo | |
zfstring | objectInfo (void) const |
return object info | |
void | objectInfoOfContentT (zfstring &ret, zfindex maxCount=((zfindex) -1), const ZFTokenForKeyValueContainer &token=_ZFP_ZFTokenForKeyValueContainerDefault) const |
see objectInfoOfContent | |
zfstring | objectInfoOfContent (zfindex maxCount=((zfindex) -1), const ZFTokenForKeyValueContainer &token=_ZFP_ZFTokenForKeyValueContainerDefault) const |
return contents info | |
void | swap (ZFCoreMap &ref) |
swap internal data | |
void | copyFrom (const ZFCoreMap &ref) |
copy all contents from ref, remove all before copy | |
zfindex | objectRetainCount (void) const |
get current retain count | |
zfindex | count (void) const |
return count | |
zfbool | isEmpty (void) const |
true if empty | |
zfbool | isContain (const zfchar *key) const |
true if contains the key | |
void | addFrom (const ZFCoreMap &ref) |
add elements from ref | |
void | set (const zfchar *key, const ZFCorePointerBase &value) |
change value or create if not exist, value would be retained by this method | |
ZFCorePointerBase * | get (const zfchar *key) const |
get value or null if not exist | |
template<typename T_Element > | |
T_Element | get (const zfchar *key) const |
get value or null if not exist | |
void | allKeyT (ZFCoreArray< zfstring > &ret) const |
see allKey | |
ZFCoreArray< zfstring > | allKey (void) const |
return a copy of all keys | |
void | allValueT (ZFCoreArray< ZFCorePointerBase * > &ret) const |
see allValue | |
ZFCoreArray< ZFCorePointerBase * > | allValue (void) const |
return a copy of all values | |
template<typename T_Element > | |
void | allValueT (ZFCoreArray< T_Element > &ret) const |
see allValue | |
void | remove (const zfchar *key) |
remove or do nothing if not exist | |
void | removeAll (void) |
remove all content | |
zfiterator | iter (void) const |
see zfiterator | |
zfiterator | iterFind (const zfchar *key) const |
see zfiterator | |
zfbool | iterValid (const zfiterator &it) const |
see zfiterator | |
void | iterNext (zfiterator &it) const |
see zfiterator | |
const zfchar * | iterKey (const zfiterator &it) const |
see zfiterator | |
ZFCorePointerBase * | iterValue (const zfiterator &it) const |
see zfiterator | |
void | iterValue (zfiterator &it, const ZFCorePointerBase &newValue) |
see zfiterator | |
void | iterRemove (zfiterator &it) |
see zfiterator | |
void | iterAdd (const zfchar *key, const ZFCorePointerBase &value) |
see zfiterator | |
template<typename T_Element > | |
T_Element | iterValue (const zfiterator &it) const |
see zfiterator | |
core map type for private use only
used to reduce dependency of stl
use string as key, null key is considered same as empty string
use ZFCorePointerBase as value, which use retain logic and can hold many types
void ZFCoreMap::set | ( | const zfchar * | key, |
const ZFCorePointerBase & | value ) |
change value or create if not exist, value would be retained by this method
null key is considered same as empty string
assert fail if value is null (use an empty smart pointer to store null value)