文档

JSON与XML解析库

更新时间:

property_parse

JSON 与 XML 解析函数,主要用来解析 JSON 格式。

函数原型

property_parse(string property_value, int property_type) returns(uint result);

请求参数

参数

必选

类型

说明

property_value

string

JSON 格式数据

property_type

int

解析类型,0 表示 JSON,1 表示 XML

返回值

参数

必选

类型

说明

result

uint

处理 JSON 数据解析的标识符

property_destroy

删除 JSON 与 XML 字符串数据解析标志符。

函数原型

property_destroy(uint hanlder) returns(bool result);

请求参数

参数

必选

类型

说明

handler

uint

解析 JSON 字符串函数返回的当前处理 JSON 的标识符

返回值

参数

必选

类型

说明

result

bool

方法返回值,成功则为 true,否则为 false

property_get_bool

解析 JSON 与 XML 中的 bool 类型的节点数值。

函数原型

property_get_bool(uint hanlder, string path) returns(int result,bool data);

请求参数

参数

必选

类型

说明

handler

uint

解析 JSON 字符串函数返回的当前处理 JSON 的标识符

path

string

被解析的属性所在位置

返回值

参数

必选

类型

说明

result

int

方法返回值,成功为 0,否则为 错误码

data

bool

解析当前节点的值

property_get_int

解析 JSON 与 XML 中的 int 类型的节点数值。

函数原型

property_get_int(uint hanlder, string path) returns(int result,int data);

请求参数

参数

必选

类型

说明

handler

uint

解析 JSON 字符串函数返回的当前处理 JSON 的标识符

path

string

被解析的属性所在位置

返回值

参数

必选

类型

说明

result

int

方法返回值,成功为 0,否则为 错误码

data

bool

解析当前节点的值

property_get_uint

解析 JSON 与 XML 中的 uint 类型的节点数值。

函数原型

property_get_uint(uint hanlder, string path) returns(int result, uint data);

请求参数

参数

必选

类型

说明

handler

uint

解析 JSON 字符串函数返回的当前处理 JSON 的标识符

path

string

被解析的属性所在位置

返回值

参数

必选

类型

说明

result

int

方法返回值,成功为 0,否则为 错误码

data

bool

解析当前节点的值

property_get_string

解析 JSON 与 XML 中的 string 类型的节点数值。

函数原型

property_get_string(uint hanlder, string path) returns(int result,string memory);

请求参数

参数

必选

类型

说明

handler

uint

解析 JSON 字符串函数返回的当前处理 JSON 的标识符

path

string

被解析的属性所在位置

返回值

参数

必选

类型

说明

result

int

方法返回值,成功为 0,否则为 错误码

data

bool

解析当前节点的值

property_get_string

接口函数用于解析 JSON 或 XML 中的节点列表大小。

函数原型

property_get_list_count(uint hanlder, string path) returns(uint result);

请求参数

参数

必选

类型

说明

handler

uint

解析 JSON 字符串函数返回的当前处理 JSON 的标识符。

path

string

被解析的属性所在位置。

返回值

参数

必选

类型

说明

result

uint

列表大小。

property_set_bool

构造 JSON 与 XML 格式的数据,向其中插入 bool 类型数据

函数原型

property_set_bool(uint hanlder,string path, bool data) returns(bool result);

请求参数

参数

必选

类型

说明

handler

uint

处理 JSON 字符串函数返回的标识符

path

string

要设置的数据的路径

data

bool

要设置的数据的值

返回值

参数

必选

类型

说明

result

bool

方法返回值,成功为 true,否则为 false

property_set_int

构造 JSON 与 XML 格式的数据,并向其中插入 int 类型数据

函数原型

property_set_int(uint hanlder, string path, int data) returns(bool result);

请求参数

参数

必选

类型

说明

handler

uint

处理JSON字符串函数返回的标识符

path

string

要设置的数据的路径

data

int

要设置的数据的值

返回值

参数

必选

类型

说明

result

bool

方法返回值,成功为 true,否则为 false

property_set_uint

构造 JSON 与 XML 格式的数据,并向其中插入 uint 类型数据。

函数原型

property_set_int(uint hanlder, string path, uint data) returns(bool result);

请求参数

参数

必选

类型

说明

handler

uint

处理 JSON 字符串函数返回的标识符

path

string

要设置的数据的路径

data

uint

要设置的数据的值

返回值

参数

必选

类型

说明

result

bool

方法返回值,成功为 true,否则为 false

property_set_string

构造 JSON 与 XML 格式的数据,并向其中插入 string 类型数据。

函数原型

property_set_string(uint hanlder, string path, val data) returns(bool result);

请求参数

参数

必选

类型

说明

handler

uint

处理 JSON 字符串函数返回的标识符

path

string

要设置的数据的路径

data

val

要设置的数据的值

返回值

参数

必选

类型

说明

result

bool

方法返回值,成功为 true,否则为 false

property_remove

property_remove 接口函数用于构造 JSON 或 XML 格式的数据,删除指定路径的数据。

函数原型

property_remove(uint hanlder, string path) returns(bool result);

请求参数

参数

必选

类型

说明

handler

uint

处理 JSON 字符串函数返回的标识符

path

string

要删除的数据的路径

返回值

参数

必选

类型

说明

result

bool

方法返回值,成功为 true,否则为 false

property_write

property_write 接口函数用于生成 JSON 或 XML 格式的数据。

函数原型

property_write(uint hanlder, int type) returns(string result);

请求参数

参数

必选

类型

说明

handler

uint

处理 JSON 字符串函数返回的标识符

type

string

类型,0:JSON;1:XML

返回值

参数

必选

类型

说明

result

string

生成的 XML 或 JSON 数据

  • 本页导读 (0)
文档反馈