ZFFramework
 
Loading...
Searching...
No Matches
ZFSerializableData Class Reference

ZFSerializable's data container, see ZFSerializable. More...

#include <ZFSerializableData.h>

Public Member Functions

void copyFrom (const ZFSerializableData &ref)
 copy all the contents
 
ZFSerializableData copy (void) const
 return a copy of this data
 
zfindex objectRetainCount (void) const
 get current retain count
 
ZFPathInfo pathInfo (void) const
 used for impl to store path related info, see ZFPathInfo
 
void pathInfo (const ZFPathInfo &pathInfo)
 see pathInfo
 
ZFPathInfo pathInfoCheck (void) const
 recursively check path info from child to parent
 
zfbool serializableDataParent (ZFSerializableData &ret) const
 access parent of this node, return true if parent exists
 
void itemClass (const zfstring &classNameFull)
 see ZFSerializable
 
const zfstringitemClass (void) const
 see ZFSerializable
 
void propertyName (const zfstring &name)
 see ZFSerializable, same as set value of attribute "prop"
 
zfstring propertyName (void) const
 see propertyName
 
void propertyValue (const zfstring &value)
 see ZFSerializable, same as set value of attribute "value"
 
zfstring propertyValue (void) const
 see propertyValue
 
void category (const zfstring &category)
 see ZFSerializable, same as set value of attribute "category"
 
zfstring category (void) const
 see category
 
void removeAll (void)
 clear all the contents
 
void serializableDataTag (const zfstring &key, ZFObject *tag)
 used to store extra state for this serializable data
 
zfany serializableDataTag (const zfstring &key) const
 see serializableDataTag
 
void serializableDataTagGetAllKeyValue (ZFCoreArray< zfstring > &allKey, ZFCoreArray< zfauto > &allValue) const
 see serializableDataTag
 
void serializableDataTagRemove (const zfstring &key)
 remove tag, same as set tag to null
 
zfauto serializableDataTagRemoveAndGet (const zfstring &key)
 remove tag, return removed tag or null if not exist
 
void serializableDataTagRemoveAll (void)
 see serializableDataTag
 
void attr (const zfstring &name, const zfstring &value)
 see ZFSerializable, remove if value is null (same as attrRemove)
 
zfstring attr (const zfstring &name) const
 see attr
 
zfindex attrCount (void) const
 see attr
 
void attrRemove (const zfstring &name)
 remove value with name, see attr
 
void attrRemoveAll (void)
 remove all attribute
 
zfiter attrIterFind (const zfstring &name) const
 see zfiter
 
zfiter attrIter (void) const
 see zfiter
 
zfstring attrIterKey (const zfiter &it) const
 see zfiter
 
zfstring attrIterValue (const zfiter &it) const
 see zfiter
 
void attrIterValue (zfiter &it, const zfstring &value)
 see zfiter
 
void attrIterRemove (zfiter &it)
 see zfiter
 
zfbool attrIterResolved (const zfiter &it) const
 see zfiter
 
void attrIterResolveMark (const zfiter &it) const
 see zfiter
 
void attrIterResolveUnmark (const zfiter &it) const
 see zfiter
 
void child (const ZFSerializableData &element)
 add child element
 
void child (const ZFSerializableData &element, zfindex atIndex)
 add child element
 
void childReplace (zfindex index, const ZFSerializableData &element)
 replace existing element at index or assert fail if index out of range
 
zfindex childForName (const zfstring &name) const
 find element with name or zfindexMax() if not found
 
zfindex childForCategory (const zfstring &name) const
 see childForName
 
zfindex childCount (void) const
 see ZFSerializable
 
const ZFSerializableDatachildAt (zfindex index) const
 see ZFSerializable
 
ZFSerializableDatachildAt (zfindex index)
 see ZFSerializable
 
void childRemoveAt (zfindex index)
 remove element at index
 
void childRemoveAll (void)
 remove all element
 
zfbool resolved (void) const
 used to mark whether the data is resolved
 
void resolveMark (void) const
 see resolved
 
void resolveUnmark (void) const
 see resolved
 
zfbool resolvedAttr (const zfstring &name) const
 see resolved
 
void resolveAttrMark (const zfstring &name) const
 see resolved
 
void resolveAttrUnmark (const zfstring &name) const
 see resolved
 
zfbool resolvedPropertyName (void) const
 see resolved
 
void resolvePropertyNameMark (void) const
 see resolved
 
void resolvePropertyNameUnmark (void) const
 see resolved
 
zfbool resolvedPropertyValue (void) const
 see resolved
 
void resolvePropertyValueMark (void) const
 see resolved
 
void resolvePropertyValueUnmark (void) const
 see resolved
 
zfbool resolvedCategory (void) const
 see resolved
 
void resolveCategoryMark (void) const
 see resolved
 
void resolveCategoryUnmark (void) const
 see resolved
 
zfbool resolvedAll (ZFSerializableData *firstNotResolvedElement=zft_zfnull, zfstring *firstNotResolvedAttr=zft_zfnull) const
 see resolved, check whether self and all attribute and child element resolved
 
void resolveMarkAll (void) const
 see resolved, mark self and all attribute and child element
 
void resolveUnmarkAll (void) const
 see resolved, unmark self and all attribute and child element
 
void resolveAttrMarkAll (void) const
 see resolved, mark all attribute
 
void resolveAttrUnmarkAll (void) const
 see resolved, unmark all attribute
 
void objectInfoT (zfstring &ret) const
 see objectInfo
 
zfstring objectInfo (void) const
 get a short info
 
ZFCompareResult objectCompare (const ZFSerializableData &another) const
 compare by instance
 
ZFCompareResult objectCompareValue (const ZFSerializableData &another) const
 compare another serializable data by contents
 
zfbool valid (void) const
 whether the data is valid
 

Detailed Description

ZFSerializable's data container, see ZFSerializable.

this is a data structure similar to xml, designed to reduce xml dependency

Member Function Documentation

◆ serializableDataTag()

void ZFSerializableData::serializableDataTag ( const zfstring & key,
ZFObject * tag )

used to store extra state for this serializable data

typically used by impl to achieve additional features

◆ serializableDataTagRemoveAll()

void ZFSerializableData::serializableDataTagRemoveAll ( void )

see serializableDataTag

Note
it's unsafe to remove all tag manually, which may break unrelated modules' additional logic, remove only if necessary
typically, you should remove exactly the one you have added

◆ attr()

void ZFSerializableData::attr ( const zfstring & name,
const zfstring & value )

see ZFSerializable, remove if value is null (same as attrRemove)

note that order of attributes is not ensured after you add, remove or modify attributes

◆ child() [1/2]

void ZFSerializableData::child ( const ZFSerializableData & element)

add child element

note this method won't check duplicate data with same name

◆ child() [2/2]

void ZFSerializableData::child ( const ZFSerializableData & element,
zfindex atIndex )

add child element

note this method won't check duplicate data with same name

◆ resolved()

zfbool ZFSerializableData::resolved ( void ) const

used to mark whether the data is resolved

useful while serializing some type from serializable, after operation's done, you may check whether all data resolved to see whether there's extra unrecognized data

◆ objectCompareValue()

ZFCompareResult ZFSerializableData::objectCompareValue ( const ZFSerializableData & another) const

compare another serializable data by contents

if two data considered as same, attribute's order have no need to be same, but child element's order must be same


The documentation for this class was generated from the following file: