JsonParserInterface Class Reference

#include <parser_json.h>

公共成员函数

MAXON_METHOD Result < void >  Write (const DataDictionary &jsonObject, String &jsonString, Bool niceFormatting)
MAXON_METHOD Result < void >  读取 (const String &jsonString, JSONPARSERFLAGS flags, const ValueReceiver < const DataDictionary & > &jsonObjects)
MAXON_METHOD Result < void >  读取 ( UrlOrInputStream &&nameOrStream, JSONPARSERFLAGS flags, const StringDecodingRef &stringDecoding, const ValueReceiver < const DataDictionary & > &jsonObjects)

静态公共成员函数

static MAXON_METHOD Interface *  Alloc ( MAXON_SOURCE_LOCATION_DECLARATION )

私有成员函数

  MAXON_INTERFACE_NONVIRTUAL ( JsonParserInterface , MAXON_REFERENCE_NORMAL , "net.maxon.interface.jsonparser")

成员函数文档编制

◆  MAXON_INTERFACE_NONVIRTUAL()

MAXON_INTERFACE_NONVIRTUAL ( JsonParserInterface   ,
MAXON_REFERENCE_NORMAL   ,
"net.maxon.interface.jsonparser"   
)
private

◆  Alloc()

static MAXON_METHOD Interface* Alloc ( MAXON_SOURCE_LOCATION_DECLARATION   )
static
参数
[in] allocLocation Source location.

◆  Write()

MAXON_METHOD Result <void> Write ( const DataDictionary &  jsonObject ,
String jsonString ,
Bool   niceFormatting  
)

ConvertToJSON converts a data dictionary into a JSON string.

参数
[in] jsonObject DataDictionary to convert.
[out] jsonString Result string.
[in] niceFormatting True to have nict formatting with idents and new lines. False to get compact format (smaller filesize).
返回
OK on success.

◆  Read() [1/2]

MAXON_METHOD Result <void> Read ( const String jsonString ,
JSONPARSERFLAGS   flags ,
const ValueReceiver < const DataDictionary & > &  jsonObjects  
)

ConvertFromJSON parses a json string into DataDictionary representation.

参数
[in] jsonString JSON formated string to precess.
[in] flags See JSONPARSERFLAGS.
[in] jsonObjects ValueReceiver which receives all processed DataDictionaries.
返回
OK on success. If successful it's guaranteed that at least one DataDictionary was found.

◆  Read() [2/2]

MAXON_METHOD Result <void> Read ( UrlOrInputStream &&  nameOrStream ,
JSONPARSERFLAGS   flags ,
const StringDecodingRef &  stringDecoding ,
const ValueReceiver < const DataDictionary & > &  jsonObjects  
)

ConvertFromJSON parses a json stream or url into DataDictionary representation.

参数
[in] nameOrStream JSON formated input stream or file url.
[in] flags See JSONPARSERFLAGS.
[in] jsonObjects ValueReceiver which receives all processed DataDictionaries.
返回
OK on success. If successful it's guaranteed that at least one DataDictionary was found.