ZFFramework
 
Loading...
Searching...
No Matches
ZFJson.h File Reference

JSON processing. More...

#include "ZFAlgorithmDef.h"

Go to the source code of this file.

Classes

class  v_ZFJsonType
 json item type More...
 
class  ZFJsonOutputToken
 token for output json More...
 
class  v_ZFJsonOutputToken
 type wrapper for ZFTypeId::Value More...
 
class  ZFJson
 JSON item. More...
 
class  v_ZFJson
 type wrapper for ZFTypeId::Value More...
 

Typedefs

typedef v_ZFJsonType::ZFEnumType ZFJsonType
 see v_ZFJsonType
 

Functions

ZFLIB_ZFAlgorithm zfbool ZFJsonTypeFromStringT (zfauto &ret, const zfchar *src, zfindex srcLen=((zfindex) -1), zfstring *errorHint=zft_zfnull)
 see v_ZFJsonType, return enum object if success
 
ZFLIB_ZFAlgorithm zfbool ZFJsonTypeToStringT (zfstring &ret, v_ZFJsonType *const &value, zfstring *errorHint=zft_zfnull)
 see ZFJsonType, return empty string if error
 
zfstring ZFJsonTypeToString (v_ZFJsonType *const &value, zfstring *errorHint=zft_zfnull)
 see v_ZFJsonType, return empty string if error
 
const zfstringZFTypeId_ZFJsonType (void)
 
ZFLIB_ZFAlgorithm zfbool ZFJsonTypeFromDataT (_ZFP_PropTypeW_ZFJsonType &v, const ZFSerializableData &serializableData, zfstring *outErrorHint=zft_zfnull, ZFSerializableData *outErrorPos=zft_zfnull)
 see ZFTYPEID_DECLARE
 
_ZFP_PropTypeW_ZFJsonType ZFJsonTypeFromData (const ZFSerializableData &serializableData, zfstring *outErrorHint=zft_zfnull, ZFSerializableData *outErrorPos=zft_zfnull)
 see ZFTYPEID_DECLARE
 
ZFLIB_ZFAlgorithm zfbool ZFJsonTypeToDataT (ZFSerializableData &serializableData, _ZFP_PropTypeW_ZFJsonType const &v, zfstring *outErrorHint=zft_zfnull)
 see ZFTYPEID_DECLARE
 
ZFSerializableData ZFJsonTypeToData (_ZFP_PropTypeW_ZFJsonType const &v, zfstring *outErrorHint=zft_zfnull)
 see ZFTYPEID_DECLARE
 
ZFLIB_ZFAlgorithm zfbool ZFJsonTypeFromStringT (_ZFP_PropTypeW_ZFJsonType &v, const zfchar *src, zfindex srcLen=((zfindex) -1), zfstring *errorHint=zft_zfnull)
 util method to convert ZFJsonType from string
 
_ZFP_PropTypeW_ZFJsonType ZFJsonTypeFromString (const zfchar *src, zfindex srcLen=((zfindex) -1), zfstring *errorHint=zft_zfnull)
 util method to convert ZFJsonType from string
 
ZFLIB_ZFAlgorithm zfbool ZFJsonTypeToStringT (zfstring &s, _ZFP_PropTypeW_ZFJsonType const &v, zfstring *errorHint=zft_zfnull)
 util method to convert ZFJsonType to string
 
zfstring ZFJsonTypeToString (_ZFP_PropTypeW_ZFJsonType const &v, zfstring *errorHint=zft_zfnull)
 util method to convert ZFJsonType to string
 
const zfstringZFTypeId_ZFJsonOutputToken (void)
 
ZFJsonOutputTokenZFJsonOutputTokenTrim (void)
 trim output token for ZFJsonToOutput
 
void ZFJsonOutputTokenTrim (ZFJsonOutputToken const &v)
 see ZFJsonOutputTokenTrim
 
ZFJsonOutputTokenZFJsonOutputTokenDetail (void)
 detailed output token for ZFJsonToOutput
 
void ZFJsonOutputTokenDetail (ZFJsonOutputToken const &v)
 see ZFJsonOutputTokenDetail
 
ZFJsonOutputTokenZFJsonOutputTokenDefault (void)
 default output token for ZFJsonToOutput
 
void ZFJsonOutputTokenDefault (ZFJsonOutputToken const &v)
 see ZFJsonOutputTokenDefault
 
const zfstringZFTypeId_ZFJson (void)
 
ZFLIB_ZFAlgorithm zfbool ZFJsonFromDataT (_ZFP_PropTypeW_ZFJson &v, const ZFSerializableData &serializableData, zfstring *outErrorHint=zft_zfnull, ZFSerializableData *outErrorPos=zft_zfnull)
 see ZFTYPEID_DECLARE
 
_ZFP_PropTypeW_ZFJson ZFJsonFromData (const ZFSerializableData &serializableData, zfstring *outErrorHint=zft_zfnull, ZFSerializableData *outErrorPos=zft_zfnull)
 see ZFTYPEID_DECLARE
 
ZFLIB_ZFAlgorithm zfbool ZFJsonToDataT (ZFSerializableData &serializableData, _ZFP_PropTypeW_ZFJson const &v, zfstring *outErrorHint=zft_zfnull)
 see ZFTYPEID_DECLARE
 
ZFSerializableData ZFJsonToData (_ZFP_PropTypeW_ZFJson const &v, zfstring *outErrorHint=zft_zfnull)
 see ZFTYPEID_DECLARE
 
ZFLIB_ZFAlgorithm zfbool ZFJsonFromStringT (_ZFP_PropTypeW_ZFJson &v, const zfchar *src, zfindex srcLen=((zfindex) -1), zfstring *errorHint=zft_zfnull)
 util method to convert ZFJson from string
 
_ZFP_PropTypeW_ZFJson ZFJsonFromString (const zfchar *src, zfindex srcLen=((zfindex) -1), zfstring *errorHint=zft_zfnull)
 util method to convert ZFJson from string
 
ZFLIB_ZFAlgorithm zfbool ZFJsonToStringT (zfstring &s, _ZFP_PropTypeW_ZFJson const &v, zfstring *errorHint=zft_zfnull)
 util method to convert ZFJson to string
 
zfstring ZFJsonToString (_ZFP_PropTypeW_ZFJson const &v, zfstring *errorHint=zft_zfnull)
 util method to convert ZFJson to string
 
ZFLIB_ZFAlgorithm ZFJson ZFJsonObject ()
 util to create ZFJson
 
ZFLIB_ZFAlgorithm ZFJson ZFJsonArray ()
 util to create ZFJson
 
ZFLIB_ZFAlgorithm ZFJson ZFJsonFromInput (const ZFInput &input, zfstring *errorHint=(zft_zfnull))
 parse json, or return an item with null type if fail
 
ZFLIB_ZFAlgorithm zfbool ZFJsonToOutput (const ZFOutput &output, const ZFJson &item, const ZFJsonOutputToken &token=(ZFJsonOutputTokenDefault()))
 convert json to output
 
ZFLIB_ZFAlgorithm zfbool ZFJsonToStringT (zfstring &ret, const ZFJson &item, const ZFJsonOutputToken &token)
 convert json to string
 
ZFLIB_ZFAlgorithm zfstring ZFJsonToString (const ZFJson &item, const ZFJsonOutputToken &token)
 see ZFJsonToStringT
 
ZFLIB_ZFAlgorithm void ZFJsonEscapeCharEncode (zfstring &dst, const zfstring &src, zfindex count=(((zfindex) -1)))
 encode json chars
 
ZFLIB_ZFAlgorithm void ZFJsonEscapeCharEncode (const ZFOutput &dst, const zfchar *src, zfindex count=(((zfindex) -1)))
 see ZFJsonEscapeCharEncode
 
ZFLIB_ZFAlgorithm void ZFJsonEscapeCharDecode (zfstring &dst, const zfchar *src, zfindex count=(((zfindex) -1)))
 see ZFJsonEscapeCharEncode
 
ZFLIB_ZFAlgorithm void ZFJsonEscapeCharDecode (const ZFOutput &dst, const zfchar *src, zfindex count=(((zfindex) -1)))
 see ZFJsonEscapeCharEncode
 

Detailed Description

JSON processing.

Function Documentation

◆ ZFTypeId_ZFJsonType()

const zfstring & ZFTypeId_ZFJsonType ( void )
inline


◆ ZFTypeId_ZFJsonOutputToken()

const zfstring & ZFTypeId_ZFJsonOutputToken ( void )
inline


◆ ZFTypeId_ZFJson()

const zfstring & ZFTypeId_ZFJson ( void )
inline


◆ ZFJsonToOutput()

ZFLIB_ZFAlgorithm zfbool ZFJsonToOutput ( const ZFOutput & output,
const ZFJson & item,
const ZFJsonOutputToken & token = (ZFJsonOutputTokenDefault()) )
extern

convert json to output

Note
result string is not ensured to be a valid json string if source is not valid

◆ ZFJsonToStringT()

ZFLIB_ZFAlgorithm zfbool ZFJsonToStringT ( zfstring & ret,
const ZFJson & item,
const ZFJsonOutputToken & token )
extern

convert json to string

Note
result string is not ensured to be a valid json string if source is not valid

◆ ZFJsonEscapeCharEncode()

ZFLIB_ZFAlgorithm void ZFJsonEscapeCharEncode ( zfstring & dst,
const zfstring & src,
zfindex count = (((zfindex) -1)) )
extern

encode json chars

\\b \b
\\t \t
\\n \n
\\f \f
\\r \r
\" "
\\ \

result would be appended to dst