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

JSON item. More...

#include <ZFJson.h>

Public Member Functions

void objectInfoT (zfstring &ret) const
 see objectInfo
 
zfstring objectInfo (void) const
 return object info
 
zfindex objectRetainCount (void) const
 get current retain count
 
ZFJsonType type (void) const
 type of this item
 
zfbool valid (void) const
 true if type is not v_ZFJsonType::e_Null
 
ZFJson copy (void) const
 return a copy of this node as well as all of its content
 
ZFJsonmerge (const ZFJson &other)
 util to merge from other json
 
ZFJsonvalue (const zfstring &value)
 value of the node, valid only for v_ZFJsonType::e_Value type
 
const zfstringvalue (void) const
 see value
 
zfindex attrCount (void) const
 json item count, valid only for v_ZFJsonType::e_Object
 
ZFJsonattr (const zfstring &key, const zfstring &value)
 set json item for key, valid only for v_ZFJsonType::e_Object
 
ZFJsonattr (const zfstring &key, const ZFJson &item)
 set json item for key, valid only for v_ZFJsonType::e_Object
 
ZFJson attr (const zfstring &key) const
 get json item for key, valid only for v_ZFJsonType::e_Object
 
zfstring attrValue (const zfstring &key) const
 util method to access json value, valid only for v_ZFJsonType::e_Object
 
ZFJsonattrRemove (const zfstring &key)
 remove json item, valid only for v_ZFJsonType::e_Object
 
ZFJsonattrRemoveAll (void)
 remove all json item, valid only for v_ZFJsonType::e_Object
 
zfiter attrIter (void) const
 see zfiter
 
zfiter attrIterFind (const zfstring &key) const
 see zfiter
 
zfstring attrIterKey (const zfiter &it) const
 see zfiter
 
ZFJson attrIterValue (const zfiter &it) const
 see zfiter
 
void attrIterValue (zfiter &it, const ZFJson &item)
 see zfiter
 
void attrIterRemove (zfiter &it)
 see zfiter
 
zfindex childCount (void) const
 json child count, valid only for v_ZFJsonType::e_Array
 
ZFJson childAt (zfindex index) const
 get json child at index, valid only for v_ZFJsonType::e_Array
 
ZFJsonchild (const zfstring &value, zfindex index=((zfindex) -1))
 add json child to specified index (ranged in [0, count]), valid only for v_ZFJsonType::e_Array
 
ZFJsonchild (const ZFJson &item, zfindex index=((zfindex) -1))
 add json child to specified index (ranged in [0, count]), valid only for v_ZFJsonType::e_Array
 
ZFJsonchildRemoveAt (zfindex index)
 remove json child at index, valid only for v_ZFJsonType::e_Array
 
ZFJsonchildRemoveAll (void)
 remove all json child, valid only for v_ZFJsonType::e_Array
 
zfindex childFind (const ZFJson &item) const
 find json child, valid only for v_ZFJsonType::e_Array
 
 operator zfstring (void) const
 return ZFJsonToString
 
 operator zfbool (void) const
 return valid
 
ZFJson operator[] (const zfchar *key) const
 access attr
 
ZFJson operator[] (const zfstring &key) const
 access attr
 
ZFJson operator[] (zfindex const &index) const
 access childAt
 
zfstring toString (const ZFJsonOutputToken &token=ZFJsonOutputTokenDefault()) const
 return ZFJsonToString
 

Detailed Description

JSON item.

Member Function Documentation

◆ copy()

ZFJson ZFJson::copy ( void ) const

return a copy of this node as well as all of its content

the newly created tree has no parent

◆ merge()

ZFJson & ZFJson::merge ( const ZFJson & other)

util to merge from other json

  • arrays: would be replaced
  • objects: all attr value or array would be replaced, all attr object would be merged recursively

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