class QPanda::RJson

Overview

a wrapper class of rapidjson. More...

Detailed Documentation

a wrapper class of rapidjson.

Methods

get the val by the name of a key

Parameters:

rapidjson::Value** Pointer of a pointer, pointer to the storage Memory address.
char* the name of key
rapidjson::Value* parent node pointer

Returns:

int 0: on success, -1: others

get the val by index

Parameters:

rapidjson::Value** Pointer of a pointer, pointer to the storage Memory address.
size_t the target index
rapidjson::Value* parent node pointer

Returns:

int 0: on success, -1: others

get the object by tag

Parameters:

rapidjson::Value** Pointer of a pointer, pointer to the storage Memory address.
T tag
rapidjson::Value* parent node pointer

Returns:

int 0: on success, -1: others

get the array by tag

Parameters:

rapidjson::Value** Pointer of a pointer, pointer to the storage Memory address.
T tag
rapidjson::Value* parent node pointer

Returns:

int 0: on success, -1: others

get the string of tag

Parameters:

std::string& the string of tag
T tag
rapidjson::Value* parent node pointer

Returns:

int 0: on success, -1: others

get the bool val of tag

Parameters:

bool& the bool val
T tag
rapidjson::Value* parent node pointer

Returns:

int 0: on success, -1: others

get the int val of tag

Parameters:

int& the int val
T tag
rapidjson::Value* parent node pointer

Returns:

int 0: on success, -1: others

get the double val of tag

Parameters:

double& the double val
T tag
rapidjson::Value* parent node pointer

Returns:

int 0: on success, -1: others

get the val of t1.t2

Parameters:

rapidjson::Value** Pointer of a pointer, pointer to the storage Memory address.
T1 t1
T2 t2
rapidjson::Value* parent node pointer

Returns:

int 0: on success, -1: others

get the object pointer of t1.t2

Parameters:

rapidjson::Value** Pointer of a pointer, pointer to the storage Memory address.
T1 t1
T2 t2
rapidjson::Value* parent node pointer

Returns:

int 0: on success, -1: others

get the Array pointer of t1.t2

Parameters:

rapidjson::Value** Pointer of a pointer, pointer to the storage Memory address.
T1 t1
T2 t2
rapidjson::Value* parent node pointer

Returns:

int 0: on success, -1: others

get the string of t1.t2

Parameters:

std::string& the target string
T1 t1
T2 t2
rapidjson::Value* parent node pointer

Returns:

int 0: on success, -1: others

get the bool val of t1.t2

Parameters:

bool& the target bool val
T1 t1
T2 t2
rapidjson::Value* parent node pointer

Returns:

int 0: on success, -1: others

get the int val of t1.t2

Parameters:

int& the target int val
T1 t1
T2 t2
rapidjson::Value* parent node pointer

Returns:

int 0: on success, -1: others

get the double val of t1.t2

Parameters:

double& the target double val
T1 t1
T2 t2
rapidjson::Value* parent node pointer

Returns:

int 0: on success, -1: others

node data to string

Parameters:

std::string& the string of node data
rapidjson::Value* the target node

Returns:

int 0: on success, -1: others

node data to string

Parameters:

rapidjson::Value* the target node

Returns:

std::string the string of node data. if any error occurred, the returned string is empty.

parse a faile

Parameters:

std::string& the target file name
rapidjson::Document& JSON file parser

Returns:

bool return true on success, or else false on any error occurred

judge the file whether valid or not.

Parameters:

std::string& the target file name
std::string& the config schema
rapidjson::Document& JSON file parser

Returns:

bool if file is valid return true, or else return false