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 zfstring &key) const |
true if contains the key | |
void | addFrom (const ZFCoreMap &ref) |
add elements from ref | |
void | set (const zfstring &key, const ZFCorePointer &value) |
change value or create if not exist, value would be retained by this method | |
const ZFCorePointer * | get (const zfstring &key) const |
get value or null if not exist | |
template<typename T_Element> | |
T_Element | get (const zfstring &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< const ZFCorePointer * > &ret) const |
see allValue | |
ZFCoreArray< const ZFCorePointer * > | 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 zfstring &key) |
remove or do nothing if not exist | |
void | removeAll (void) |
remove all content | |
zfiter | iter (void) const |
see zfiter | |
zfiter | iterFind (const zfstring &key) const |
see zfiter | |
zfstring | iterKey (const zfiter &it) const |
see zfiter | |
const ZFCorePointer * | iterValue (const zfiter &it) const |
see zfiter | |
void | iterValue (zfiter &it, const ZFCorePointer &newValue) |
see zfiter | |
void | iterRemove (zfiter &it) |
see zfiter | |
void | iterAdd (const zfstring &key, const ZFCorePointer &value) |
see zfiter | |
template<typename T_Element> | |
T_Element | iterValue (const zfiter &it) const |
see zfiter | |
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 ZFCorePointer as value, which use retain logic and can hold many types
void ZFCoreMap::set | ( | const zfstring & | key, |
const ZFCorePointer & | 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)