|
string | fwJsonSerialize (const shared_ptr< type >|const type &obj, const dyn_string &noSerialize=makeDynString(), bool compact=true) |
|
int | fwJsonDeserialize (const string &json, shared_ptr< type >|type &obj) |
|
CtrlJsonSerialize module provides the tools to serialize and deserialize CTRL++ objects into/from their JSON representation.
Please refer to the CtrlJsonSerialize Programmer Manual section for a comprehensive programmer's guide.
string fwJsonSerialize |
( |
const shared_ptr< type >|const type & |
obj, |
|
|
const dyn_string & |
noSerialize = makeDynString() , |
|
|
bool |
compact = true |
|
) |
| |
Serialize given object, pointer or variable into string containing its JSON equivalent
- Parameters
-
[in] | obj | Object, pointer or variable to be serialized |
[in] | noSerialize | List of object properties to be excluded from serialization (by default empty) - note: not implemented |
[in] | compact | Flag indicating whether produced string should contain JSON in compated (true - default) indented (false) format |
- Returns
- String containing JSON representation of given value
-
Empty string in case of errors
int fwJsonDeserialize |
( |
const string & |
json, |
|
|
shared_ptr< type >|type & |
obj |
|
) |
| |
Deserialize string with JSON encoded data into given object, pointer or variable
- Parameters
-
[in] | json | String containing JSON encoded data |
[out] | obj | Object, pointer or variable to which deserialized data is assigned |
- Returns
- 0 when deserialization successfull
-
1 when deserialization finished with warnings (to be retrieved with getLastError())
-
-1 when an error occured during deserialization and it can't be finished