A class for parsing json strings
More...
|
| Json (const char *jsonString) |
| Parses the json_string into a new JsonData object More...
|
|
| ~Json () |
| A deconstructor for the Json object. It will free the object from memory. This function fires automatically when this object is no longer needed. More...
|
|
String | toString () const |
| Returns the object as a JSON string. This string should be a valid JSON string, ready to be sent over the wire. More...
|
|
String | toTree () const |
| Showing objects and sub-objects In a treeview. That is child objects have additional tabs relative to parent objects. More...
|
|
bool | isValid () const |
| Will tell you if the current object is invalid More...
|
|
JsonData * | getRootObject () |
| Use this function access the root JsonData object More...
|
|
|
static String | trim (String jsonStringToTrim) |
| Removes all unnecessary white spaces like tab end line and carriage return More...
|
|
A class for parsing json strings
Example on how to create a json object from a string:
1 Json json("{\"hello\":\"world\",\"array\":[1,2,-4,-5.22,\"string in a array\"]}");
Json::Json |
( |
const char * |
jsonString | ) |
|
Parses the json_string into a new JsonData object
// Create an empty object
1 // Create an empty json object
2 JsonData jsEmptyObject("{}");
4 // Create an empty json array
5 JsonData jsEmptyArray("[]");
- Parameters
-
jsonString | Must be a valid JSON string |
A deconstructor for the Json object. It will free the object from memory. This function fires automatically when this object is no longer needed.
Use this function access the root JsonData object
- Returns
- The root JsonData object. If the object is invalid NULL is returned.
bool Json::isValid |
( |
| ) |
const |
Will tell you if the current object is invalid
String Json::toString |
( |
| ) |
const |
Returns the object as a JSON string. This string should be a valid JSON string, ready to be sent over the wire.
- Returns
- The current object returned as an JSON String.
String Json::toTree |
( |
| ) |
const |
Showing objects and sub-objects In a treeview. That is child objects have additional tabs relative to parent objects.
- Returns
- The json object as a tree view string.
String Json::trim |
( |
String |
jsonStringToTrim | ) |
|
|
static |
Removes all unnecessary white spaces like tab end line and carriage return
- Parameters
-
jsonStringToTrim | The input string that will be unchanged |
- Returns
- Copy of the input string without all white spaces
The documentation for this class was generated from the following file: