6#ifndef _ZFI_ZFSerializableData_h_
7#define _ZFI_ZFSerializableData_h_
38#define ZFSerializableKeyword_node "node"
43#define ZFSerializableKeyword_prop "prop"
48#define ZFSerializableKeyword_value "value"
53#define ZFSerializableKeyword_category "category"
63#define ZFSerializableKeyword_null "null"
87 inline operator bool (
void)
const {
return this->
valid();}
440 _ZFP_ZFSerializableDataPrivate *d;
441 friend zfclassFwd _ZFP_ZFSerializableDataPrivate;
#define ZFLIB_ZFCore
used to export symbols
Definition ZFCoreEnvDef.h:30
#define ZF_OUT_OPT
dummy macro that shows the param used as optional output
Definition ZFCoreTypeDef_ClassType.h:192
#define zffinal
dummy macro shows that a method or class is designed must not to be overrided
Definition ZFCoreTypeDef_ClassType.h:63
#define zfclassLikePOD
shows the class is not a POD type, but you may use it like a POD except memset it to 0
Definition ZFCoreTypeDef_ClassType.h:41
#define ZF_IN
dummy macro that shows the param used as required input
Definition ZFCoreTypeDef_ClassType.h:180
#define ZF_OUT
dummy macro that shows the param used as required output
Definition ZFCoreTypeDef_ClassType.h:188
#define ZF_IN_OUT
dummy macro that shows the param used as required input and output
Definition ZFCoreTypeDef_ClassType.h:196
#define zfclassFwd
forward declaration of a class type
Definition ZFCoreTypeDef_ClassType.h:31
#define zfnullT
type for zfnull, can be used for function overload
Definition ZFCoreTypeDef_CoreType.h:85
_ZFT_t_zfbool zfbool
bool type
Definition ZFCoreTypeDef_CoreType.h:103
_ZFT_t_zfindex zfindex
similar to size_t, used for index and size only
Definition ZFCoreTypeDef_CoreType.h:154
#define zfnull
same as NULL, defined for future use
Definition ZFCoreTypeDef_CoreType.h:88
ZFCompareResult
compare result of two ZFObjects
Definition ZFCoreTypeDef_OtherType.h:28
@ ZFCompareUncomparable
Definition ZFCoreTypeDef_OtherType.h:29
@ ZFCompareEqual
Definition ZFCoreTypeDef_OtherType.h:31
zft_zfstring< zfchar > zfstring
see zft_zfstring
Definition ZFCoreTypeDef_StringType.h:15
#define ZF_NAMESPACE_GLOBAL_BEGIN
begin namespace ZFFramework
Definition ZFNamespace.h:97
#define ZF_NAMESPACE_GLOBAL_END
end namespace ZFFramework
Definition ZFNamespace.h:98
path related info storage for impl
zfbool ZFSerializableDataResolveCheckEnable
whether enable resolve check during serialization, true by default if not built as debug
#define ZFSerializableKeyword_value
keyword for ZFSerializable to hold attribute or property's value, see ZFSerializableData::propertyVal...
Definition ZFSerializableData.h:48
#define ZFSerializableKeyword_prop
keyword for ZFSerializable to hold attribute or property's name, see ZFSerializableData::propertyName
Definition ZFSerializableData.h:43
#define ZFSerializableKeyword_category
keyword for ZFSerializable's to hold category, see ZFSerializableData::category
Definition ZFSerializableData.h:53
light weight array
Definition ZFCoreArray.h:331
base class of all objects
Definition ZFObjectCore.h:209
path related info storage for impl, actual meaning of the info depends on impl
Definition ZFPathInfo.h:35
ZFSerializable's data container, see ZFSerializable.
Definition ZFSerializableData.h:74
void copyFrom(const ZFSerializableData &ref)
copy all the contents
void attrRemove(const zfstring &name)
remove value with name, see attr
void propertyName(const zfstring &name)
see ZFSerializable, same as set value of attribute "prop"
Definition ZFSerializableData.h:144
zfauto serializableDataTagRemoveAndGet(const zfstring &key)
remove tag, return removed tag or null if not exist
zfindex childForCategory(const zfstring &name) const
see childForName
zfindex objectRetainCount(void) const
get current retain count
void resolveAttrMark(const zfstring &name) const
see resolved
void child(const ZFSerializableData &element)
add child element
zfiter attrIter(void) const
see zfiter
zfbool resolvedAttr(const zfstring &name) const
see resolved
void attrIterRemove(zfiter &it)
see zfiter
zfstring propertyName(void) const
see propertyName
Definition ZFSerializableData.h:148
ZFPathInfo pathInfoCheck(void) const
recursively check path info from child to parent
void serializableDataTagRemove(const zfstring &key)
remove tag, same as set tag to null
void objectInfoT(zfstring &ret) const
see objectInfo
zfbool valid(void) const
whether the data is valid
Definition ZFSerializableData.h:437
zfiter attrIterFind(const zfstring &name) const
see zfiter
zfindex childForName(const zfstring &name) const
find element with name or zfindexMax() if not found
zfbool resolvedAll(ZFSerializableData *firstNotResolvedElement=zft_zfnull, zfstring *firstNotResolvedAttr=zft_zfnull) const
see resolved, check whether self and all attribute and child element resolved
void childRemoveAll(void)
remove all element
ZFSerializableData copy(void) const
return a copy of this data
Definition ZFSerializableData.h:99
void attrIterResolveUnmark(const zfiter &it) const
see zfiter
void resolveUnmarkAll(void) const
see resolved, unmark self and all attribute and child element
ZFCompareResult objectCompareValue(const ZFSerializableData &another) const
compare another serializable data by contents
void attrIterValue(zfiter &it, const zfstring &value)
see zfiter
void serializableDataTagRemoveAll(void)
see serializableDataTag
zfstring attr(const zfstring &name) const
see attr
void resolveCategoryUnmark(void) const
see resolved
Definition ZFSerializableData.h:377
void resolveCategoryMark(void) const
see resolved
Definition ZFSerializableData.h:373
void category(const zfstring &category)
see ZFSerializable, same as set value of attribute "category"
Definition ZFSerializableData.h:160
ZFSerializableData & childAt(zfindex index)
see ZFSerializable
zfbool resolved(void) const
used to mark whether the data is resolved
zfindex attrCount(void) const
see attr
void resolveAttrUnmark(const zfstring &name) const
see resolved
const ZFSerializableData & childAt(zfindex index) const
see ZFSerializable
void attrRemoveAll(void)
remove all attribute
void resolveUnmark(void) const
see resolved
zfstring propertyValue(void) const
see propertyValue
Definition ZFSerializableData.h:156
void resolveMarkAll(void) const
see resolved, mark self and all attribute and child element
void serializableDataTagGetAllKeyValue(ZFCoreArray< zfstring > &allKey, ZFCoreArray< zfauto > &allValue) const
see serializableDataTag
zfindex childCount(void) const
see ZFSerializable
void resolvePropertyValueUnmark(void) const
see resolved
Definition ZFSerializableData.h:364
zfbool resolvedPropertyValue(void) const
see resolved
Definition ZFSerializableData.h:356
void removeAll(void)
clear all the contents
void resolvePropertyNameUnmark(void) const
see resolved
Definition ZFSerializableData.h:351
void resolveAttrMarkAll(void) const
see resolved, mark all attribute
zfbool serializableDataParent(ZFSerializableData &ret) const
access parent of this node, return true if parent exists
void pathInfo(const ZFPathInfo &pathInfo)
see pathInfo
zfbool resolvedPropertyName(void) const
see resolved
Definition ZFSerializableData.h:343
const zfstring & itemClass(void) const
see ZFSerializable
void child(const ZFSerializableData &element, zfindex atIndex)
add child element
void resolveMark(void) const
see resolved
zfbool resolvedCategory(void) const
see resolved
Definition ZFSerializableData.h:369
void itemClass(const zfstring &classNameFull)
see ZFSerializable
void attrIterResolveMark(const zfiter &it) const
see zfiter
void propertyValue(const zfstring &value)
see ZFSerializable, same as set value of attribute "value"
Definition ZFSerializableData.h:152
ZFCompareResult objectCompare(const ZFSerializableData &another) const
compare by instance
Definition ZFSerializableData.h:421
void childRemoveAt(zfindex index)
remove element at index
zfstring attrIterKey(const zfiter &it) const
see zfiter
zfstring category(void) const
see category
Definition ZFSerializableData.h:164
zfbool attrIterResolved(const zfiter &it) const
see zfiter
void serializableDataTag(const zfstring &key, ZFObject *tag)
used to store extra state for this serializable data
void attr(const zfstring &name, const zfstring &value)
see ZFSerializable, remove if value is null (same as attrRemove)
void resolvePropertyNameMark(void) const
see resolved
Definition ZFSerializableData.h:347
ZFPathInfo pathInfo(void) const
used for impl to store path related info, see ZFPathInfo
zfany serializableDataTag(const zfstring &key) const
see serializableDataTag
zfstring objectInfo(void) const
get a short info
Definition ZFSerializableData.h:413
void resolvePropertyValueMark(void) const
see resolved
Definition ZFSerializableData.h:360
zfstring attrIterValue(const zfiter &it) const
see zfiter
void childReplace(zfindex index, const ZFSerializableData &element)
replace existing element at index or assert fail if index out of range
void resolveAttrUnmarkAll(void) const
see resolved, unmark all attribute
base class of call serializable object
Definition ZFSerializable.h:163
util method to cast ZFObject types freely
Definition zfany.h:35
a ZFObject holder which would release content object automatically when destroyed
Definition zfautoFwd.h:34
iterator for ZFFramework
Definition zfiter.h:40
util class to cast ZFObject types freely
smart pointer for ZFObject