NetBurner 3.5.0
PDF Version |
|
A class to create, read, and modify a JSON object. More...
#include <json_lexer.h>
Inherits buffer_object.
Inherited by AcmeJsonBuffer, AcmeServletBuffer, and JsonLexerFDAdapter.
Public Member Functions | |
Parsing | |
Ingesting raw JSON data from some source, or resetting. Enables compatibility with buffer_object and WebClient. | |
void | EnableLargeStrings (bool b) |
Call to allow allocation of strings larger than 1500 bytes. | |
virtual int | WriteData (const unsigned char *pCopyFrom, int numBytes) |
Writes the passed in data to the JSON data set. | |
virtual int | ReadFrom (int fd) |
Reads in data from the specified file descriptor and parses it into the JSON data set. | |
bool | CopyObject (ParsedJsonDataSet &src_set) |
Copies the provided JSON data set into the current one. | |
void | ClearObject () |
Clears all data from the object and resets it to its initial state. | |
Querying the Data Structure | |
Allows easy retrieval of entities by array index or object key name
| |
JsonRef | operator[] (int i) |
Get a JsonRef from an array by numerical index. | |
JsonRef | operator() (const char *name) |
Get a JsonRef representing any entity from a parent object by key name. | |
JsonRef | name (const char *name) |
Get a JsonRef representing any entity from a parent object by key name. | |
JsonRef | object (const char *name) |
Get a JsonRef representing an object from a parent object by key name. | |
Traversing the Data Structure | |
Used for scanning through the JSON elements | |
JsonRef | start () |
Begin traversal: check for ref validity and reset the position. | |
JsonRef | next () |
Traverse: check for ref validity and increment the position. | |
json_primitive_type | GetFirst () |
Get the first element of the JSON data set. | |
json_primitive_type | GetNext () |
Get the element at the next position of the JSON data set. | |
json_primitive_type | GetCurrent () |
Get the element at the current position of the JSON data set. | |
json_primitive_type | GetRawCurrent () |
Get the element at the current position of the JSON data set, including non-public types. | |
json_primitive_type | GetNextName () |
Iterates the current element of the JSON data set until it finds one of type NAME. | |
json_primitive_type | GetNextObject () |
Get the next element of type name that exists in the current OBJECT after the current position. | |
json_primitive_type | GetNextArray () |
Iterates the current element of the JSON data set until it finds one of type BEGIN_ARRAY. | |
json_primitive_type | GetNextNameInCurrentObject () |
Get the next element of type NAME that exists in the current OBJECT after the current position. | |
json_primitive_type | GetNextNameInCurrentArray () |
Get the next element of type NAME that exists in the current ARRAY after the current position. | |
json_primitive_type | GetNextNumberInCurrentArray () |
Get the next element of type NUMBER that exists in the current ARRAY after the current position. | |
json_primitive_type | GetNextStringInCurrentArray () |
Get the next element of type STRING that exists in the current ARRAY after the current position. | |
json_primitive_type | GetNextBoolInCurrentArray () |
Get the next element of type TRUE_EL that exists in the current ARRAY after the current position. | |
json_primitive_type | GetNextObjectInCurrentArray () |
Get the next element of type BEGIN_OBJECT that exists in the current ARRAY after the current position. | |
json_primitive_type | SkipCurrentValue () |
Skips over the current value, and get the next element. If called inside an ARRAY or OBJECT, it will walk to the end of the ARRAY or OJBECT and return the next element it finds. If it reaches the end of the ARRAY or OBJECT before it finds a value, it will return NOTFOUND. | |
void | ResetPosition () |
Resets the parser position to the beginning of the JSON data set. | |
JsonRef | GetParsePosition () |
Gets the current parse position object for the JSON data set. | |
JsonRef | SetParsePosition (JsonRef pos) |
Sets the current parse position object for the JSON data set. | |
Advanced Finding and Returning | |
Advanced functions for scanning and returning specific objects. All of these can return NOTFOUND.
| |
json_primitive_type | FindFullName (const char *name) |
Find the element in the data set with the given name and move the parser to the next element. This searches a full name path, such as ob1.ob2.ob3.ob4. | |
json_primitive_type | FindFullAtName (const char *name) |
Find the element in the data set with the given name and move the parser to that element. This searches a full name path, such as ob1.ob2.ob3.ob4. | |
json_primitive_type | FindElementAfterName (const char *name) |
Finds name in current object points at element after name. This only supports simple, single element names. This searches from the current position to the end. | |
json_primitive_type | FindGlobalElementAfterName (const char *name) |
Finds name in current object points at element after name. This only supports simple, single element names. It starts the search from the parser's current position, and if it doesn't find it, it will start the search over from the beginning. | |
json_primitive_type | FindElementAfterNameInCurrentObject (const char *name) |
Looks for elements with the current name in the current OBJECT only. Does not search sub objects. | |
json_primitive_type | FindElementAfterNameInCurrentArray (const char *name) |
Looks for elements with the current name in the current ARRAY only. Does not search sub arrays. | |
bool | CurrentBool () |
Returns true if the current element a TRUE_EL primitive type. | |
bool | PermissiveCurrentBool () |
Returns true if the current element a TRUE_EL primitive type, is "True", "true", or is a non-zero number. | |
double | CurrentNumber () |
Get the number value of the current element. | |
const char * | CurrentString () |
Get the string value of the current element. | |
const char * | CurrentName () |
Get the name of the current element. | |
bool | FindFullNameBoolean (const char *name) |
Find the boolean value of a given element. | |
bool | FindGlobalBoolean (const char *name) |
Find the boolean value of a given element. Starts at the current position and then starts again at the beginning of the data set if the element isn't found. This supports only simple, single element names. | |
bool | FindBoolean (const char *name) |
Find the boolean value of the element after the element with the given name. | |
bool | FindBooleanInCurentObject (const char *name) |
Find the boolean value of the element within the current object. Does not search sub-objects. | |
bool | FindFullNamePermissiveBoolean (const char *name) |
Find the permissive boolean value of a given element. | |
bool | FindGlobalPermissiveBoolean (const char *name) |
Find the permissive boolean value of a given element. Starts at the current position and then starts again at the beginning of the data set if the element isn't found. This supports only simple, single element names. | |
bool | FindPermissiveBoolean (const char *name) |
Find the permissive boolean value of the element after the element with the provided name. | |
bool | FindPermissiveBooleanInCurentObject (const char *name) |
Find the permissive boolean value of the element with the given name in the current object. Does not search sub-objects. | |
const char * | FindFullNameString (const char *name) |
Find the string value of the element with the given name in the current object. | |
const char * | FindGlobalString (const char *name) |
Find the string value of a given element. Starts at the current position and then starts again at the beginning of the data set if the element isn't found. This supports only simple, single element names. | |
const char * | FindString (const char *name) |
Find the string value of the element after the element with the given name. | |
const char * | FindStringInCurentObject (const char *name) |
Find the string value of the element with the given name in the current object. Does not search sub-objects. | |
double | FindFullNameNumber (const char *name) |
Find the number value of the element with the given name in the current object. | |
double | FindGlobalNumber (const char *name) |
Find the number value of a given element. Starts at the current position and then starts again at the beginning of the data set if the element isn't found. This supports only simple, single element names. | |
double | FindNumber (const char *name) |
Find the number value of the element after the element with the given name. | |
double | FindNumberInCurentObject (const char *name) |
Find the number value of the element with the given name in the current object. Does not search sub-objects. | |
bool | FindGlobalObject (const char *name) |
Find the OBJECT with the given name. Starts at the current position and then starts again at the beginning of the data set if the element isn't found. This supports only simple, single element names. | |
bool | FindObject (const char *name) |
Find the OBJECT of the element after the element with the given name. | |
bool | FindObjectInCurentObject (const char *name) |
Find the OBJECT of the element with the given name in the current OBJECT. Does not search sub-objects. | |
Utility | |
Ingesting raw JSON data from some source, or resetting | |
void | DumpState () |
Outputs what's in the parse tree to stdout. | |
int | PrintObject (bool pretty=false) |
Prints the JSON data set to stdout. | |
int | PrintObjectToBuffer (char *buffer, int maxlen, bool pretty=false) |
Prints the JSON data set to a provided buffer. | |
int | PrintObjectToFd (int fd, bool pretty=false) |
Prints the JSON data set to a specified file descriptor. | |
int | PrintObjectToString (NBString &s, bool pretty=false) |
Prints the JSON data set to a NBString object. | |
int | PrintChildren (bool pretty=false) |
Output child objects of this JsonRef as JSON text to stdout. | |
int | PrintChildrenToFd (int fd, bool pretty=false) |
Output child objects of this JsonRef as JSON text to a file descriptor. | |
int | PrintChildrenToBuffer (char *buffer, int maxlen, bool pretty=false) |
Output child objects of this JsonRef as JSON text to a buffer pointer. | |
int | GetPrintSize (bool pretty=false) |
Calculates how many characters the JSON data set would take to print. | |
Building | |
Programmatically creating or modifying a JSON dataset | |
ParsedJsonDataSet * | StartBuilding () |
Use to start building the JSON data set. | |
ParsedJsonDataSet * | AddObjectStart (const char *name) |
Use to start an object in the JSON data set. | |
ParsedJsonDataSet * | AddMyMac (const char *name) |
Add the device MAC address to the JSON data set. | |
ParsedJsonDataSet * | Add (const char *name, int i) |
Add a name/value pair to the JSON data set where the value is an int. | |
ParsedJsonDataSet * | Add (const char *name, short i) |
Add a name/value pair to the JSON data set where the value is a short. | |
ParsedJsonDataSet * | Add (const char *name, long i) |
Add a name/value pair to the JSON data set where the value is a long. | |
ParsedJsonDataSet * | Add (const char *name, unsigned int i) |
Add a name/value pair to the JSON data set where the value is an unsigned int. | |
ParsedJsonDataSet * | Add (const char *name, unsigned short i) |
Add a name/value pair to the JSON data set where the value is a unsigned short. | |
ParsedJsonDataSet * | Add (const char *name, unsigned long i) |
Add a name/value pair to the JSON data set where the value is a unsigned long. | |
ParsedJsonDataSet * | Add (const char *name, double d) |
Add a name/value pair to the JSON data set where the value is a double. | |
ParsedJsonDataSet * | Add (const char *name, const char *str) |
Add a name/value pair to the JSON data set where the value is a string. | |
ParsedJsonDataSet * | Add (const char *name, bool b) |
Add a name/value pair to the JSON data set where the value is a bool. | |
ParsedJsonDataSet * | Add (const char *name, IPADDR4 i4) |
Add a name/value pair to the JSON data set where the value is an IPv4 address. | |
ParsedJsonDataSet * | Add (const char *name, const IPADDR &i) |
Add a name/value pair to the JSON data set where the value is an IP address. | |
ParsedJsonDataSet * | Add (const char *name, const MACADR &ma) |
Add a name/value pair to the JSON data set where the value is a MAC address. | |
ParsedJsonDataSet * | AddNull (const char *name) |
Add a name/value pair to the JSON data set where the value is null. | |
ParsedJsonDataSet * | AddArrayStart (const char *name) |
Add an ARRAY start to the JSON data set. | |
ParsedJsonDataSet * | EndArray () |
Add an ARRAY end to the JSON data set. | |
ParsedJsonDataSet * | AddArrayElement (int i) |
Add an integer value to the current array. | |
ParsedJsonDataSet * | AddArrayElement (short i) |
Add a short value to the current array. | |
ParsedJsonDataSet * | AddArrayElement (long i) |
Add a long value to the current array. | |
ParsedJsonDataSet * | AddArrayElement (unsigned int i) |
Add an unsigned int value to the current array. | |
ParsedJsonDataSet * | AddArrayElement (unsigned short i) |
Add an unsigned short value to the current array. | |
ParsedJsonDataSet * | AddArrayElement (unsigned long i) |
Add an unsigned long value to the current array. | |
ParsedJsonDataSet * | AddArrayElement (double d) |
Add a double to the current array. | |
ParsedJsonDataSet * | AddArrayElement (const char *str) |
Add a string to the current array. | |
ParsedJsonDataSet * | AddArrayElement (bool b) |
Add a bool to the current array. | |
ParsedJsonDataSet * | AddArrayElement (const IPADDR &i) |
Add an IP address to the current array. | |
ParsedJsonDataSet * | AddArrayElementArray () |
Add the start of an array element to the current array. | |
ParsedJsonDataSet * | AddArrayObjectStart () |
Add the start of an object element to the current array. | |
ParsedJsonDataSet * | AddNullArrayElement () |
Add a null element to the current array. | |
ParsedJsonDataSet * | EndObject () |
Add an end to the current object. | |
ParsedJsonDataSet * | DoneBuilding () |
Add an end JSON data set and finish building. | |
Friends | |
class | JsonRef |
A class to create, read, and modify a JSON object.
Many of the methods on ParsedJsonDataSet return a JsonRef which is a pointer to a variable or sub object inside the ParsedJsonDataSet. So, once data is parsed and traversal or querying has begun most of the work will be inside the JsonRef class.
ParsedJsonDataSet * ParsedJsonDataSet::Add | ( | const char * | name, |
bool | b ) |
Add a name/value pair to the JSON data set where the value is a bool.
name | The name of the pair. |
b | The value for the pair. |
ParsedJsonDataSet * ParsedJsonDataSet::Add | ( | const char * | name, |
const char * | str ) |
Add a name/value pair to the JSON data set where the value is a string.
name | The name of the pair. |
str | A pointer to the value for the pair. |
ParsedJsonDataSet * ParsedJsonDataSet::Add | ( | const char * | name, |
const IPADDR & | i ) |
Add a name/value pair to the JSON data set where the value is an IP address.
name | The name of the pair. |
i | The IP address to add. |
ParsedJsonDataSet * ParsedJsonDataSet::Add | ( | const char * | name, |
const MACADR & | ma ) |
Add a name/value pair to the JSON data set where the value is a MAC address.
name | The name of the pair. |
ma | The MAC address to add. |
ParsedJsonDataSet * ParsedJsonDataSet::Add | ( | const char * | name, |
double | d ) |
Add a name/value pair to the JSON data set where the value is a double.
name | The name of the pair. |
d | The value for the pair. |
ParsedJsonDataSet * ParsedJsonDataSet::Add | ( | const char * | name, |
int | i ) |
Add a name/value pair to the JSON data set where the value is an int.
name | The name of the pair. |
i | The value for the pair. |
ParsedJsonDataSet * ParsedJsonDataSet::Add | ( | const char * | name, |
IPADDR4 | i4 ) |
Add a name/value pair to the JSON data set where the value is an IPv4 address.
name | The name of the pair. |
i4 | The IPv4 address to add. |
ParsedJsonDataSet * ParsedJsonDataSet::Add | ( | const char * | name, |
long | i ) |
Add a name/value pair to the JSON data set where the value is a long.
name | The name of the pair. |
i | The value for the pair. |
ParsedJsonDataSet * ParsedJsonDataSet::Add | ( | const char * | name, |
short | i ) |
Add a name/value pair to the JSON data set where the value is a short.
name | The name of the pair. |
i | The value for the pair. |
ParsedJsonDataSet * ParsedJsonDataSet::Add | ( | const char * | name, |
unsigned int | i ) |
Add a name/value pair to the JSON data set where the value is an unsigned int.
name | The name of the pair. |
i | The value for the pair. |
ParsedJsonDataSet * ParsedJsonDataSet::Add | ( | const char * | name, |
unsigned long | i ) |
Add a name/value pair to the JSON data set where the value is a unsigned long.
name | The name of the pair. |
i | The value for the pair. |
ParsedJsonDataSet * ParsedJsonDataSet::Add | ( | const char * | name, |
unsigned short | i ) |
Add a name/value pair to the JSON data set where the value is a unsigned short.
name | The name of the pair. |
i | The value for the pair. |
ParsedJsonDataSet * ParsedJsonDataSet::AddArrayElement | ( | bool | b | ) |
Add a bool to the current array.
b | The bool value to add. |
ParsedJsonDataSet * ParsedJsonDataSet::AddArrayElement | ( | const char * | str | ) |
Add a string to the current array.
str | A char* pointing to the string value to add. |
ParsedJsonDataSet * ParsedJsonDataSet::AddArrayElement | ( | const IPADDR & | i | ) |
Add an IP address to the current array.
i | The IP address to add. |
ParsedJsonDataSet * ParsedJsonDataSet::AddArrayElement | ( | double | d | ) |
Add a double to the current array.
d | The double value to add. |
ParsedJsonDataSet * ParsedJsonDataSet::AddArrayElement | ( | int | i | ) |
Add an integer value to the current array.
i | The integer value to add. |
ParsedJsonDataSet * ParsedJsonDataSet::AddArrayElement | ( | long | i | ) |
Add a long value to the current array.
i | The long value to add. |
ParsedJsonDataSet * ParsedJsonDataSet::AddArrayElement | ( | short | i | ) |
Add a short value to the current array.
i | The short value to add. |
ParsedJsonDataSet * ParsedJsonDataSet::AddArrayElement | ( | unsigned int | i | ) |
Add an unsigned int value to the current array.
i | The unsigned int value to add. |
ParsedJsonDataSet * ParsedJsonDataSet::AddArrayElement | ( | unsigned long | i | ) |
Add an unsigned long value to the current array.
i | The unsigned long value to add. |
ParsedJsonDataSet * ParsedJsonDataSet::AddArrayElement | ( | unsigned short | i | ) |
Add an unsigned short value to the current array.
i | The unsigned short value to add. |
ParsedJsonDataSet * ParsedJsonDataSet::AddArrayStart | ( | const char * | name | ) |
Add an ARRAY start to the JSON data set.
name | The name of the array to start. |
ParsedJsonDataSet * ParsedJsonDataSet::AddMyMac | ( | const char * | name | ) |
Add the device MAC address to the JSON data set.
name | The name of the field containing the MAC address. |
ParsedJsonDataSet * ParsedJsonDataSet::AddNull | ( | const char * | name | ) |
Add a name/value pair to the JSON data set where the value is null.
name | The name of the pair. |
ParsedJsonDataSet * ParsedJsonDataSet::AddObjectStart | ( | const char * | name | ) |
Use to start an object in the JSON data set.
name | The name of the object to start. |
bool ParsedJsonDataSet::CopyObject | ( | ParsedJsonDataSet & | src_set | ) |
Copies the provided JSON data set into the current one.
true | The copy succeeded. |
false | The copy failed. |
|
inline |
Returns true if the current element a TRUE_EL primitive type.
true | If the current element is a TRUE_EL primitive type. |
false | If the current element is not a TRUE_EL primitive type. |
|
inline |
Get the name of the current element.
|
inline |
Get the number value of the current element.
|
inline |
Get the string value of the current element.
|
inline |
Find the boolean value of the element after the element with the given name.
name | The name of the element to find. |
true | If the element is of the TRUE_EL primitive type. |
false | If the element is not of the TRUE_EL primitive type. |
|
inline |
Find the boolean value of the element within the current object. Does not search sub-objects.
name | The name of the element to find. |
true | If the element is of the TRUE_EL primitive type. |
false | If the element is not of the TRUE_EL primitive type. |
|
inline |
Finds name in current object points at element after name. This only supports simple, single element names. This searches from the current position to the end.
name | The name to look for. |
NOTFOUND | If the an element with the name wasn't found. |
|
inline |
Looks for elements with the current name in the current ARRAY only. Does not search sub arrays.
name | The name to look for. |
NOTFOUND | If the an element with the name wasn't found. |
|
inline |
Looks for elements with the current name in the current OBJECT only. Does not search sub objects.
name | The name to look for. |
NOTFOUND | If the an element with the name wasn't found. |
|
inline |
Find the element in the data set with the given name and move the parser to that element. This searches a full name path, such as ob1.ob2.ob3.ob4.
name | The full name to look for. |
NOTFOUND | If the an element with the name wasn't found. |
|
inline |
Find the element in the data set with the given name and move the parser to the next element. This searches a full name path, such as ob1.ob2.ob3.ob4.
name | The full name to look for. |
NOTFOUND | If the an element with the name wasn't found, or there is no element after the named element. |
|
inline |
Find the boolean value of a given element.
name | The full name of the element to find. |
true | If the element is of the TRUE_EL primitive type. |
false | If the element is not of the TRUE_EL primitive type. |
|
inline |
Find the number value of the element with the given name in the current object.
name | The full name of the element to find. |
|
inline |
Find the permissive boolean value of a given element.
name | The full name of the element to find. |
true | If the current element a TRUE_EL primitive type, is "True", "true", or is a non-zero number. |
false | If the current element is not a TRUE_EL primitive type, "True", "true", or is 0. |
|
inline |
Find the string value of the element with the given name in the current object.
name | The full name of the element to find. |
|
inline |
Find the boolean value of a given element. Starts at the current position and then starts again at the beginning of the data set if the element isn't found. This supports only simple, single element names.
name | The name of the element to find. |
true | If the element is of the TRUE_EL primitive type. |
false | If the element is not of the TRUE_EL primitive type. |
|
inline |
Finds name in current object points at element after name. This only supports simple, single element names. It starts the search from the parser's current position, and if it doesn't find it, it will start the search over from the beginning.
name | The name to look for. |
NOTFOUND | If the an element with the name wasn't found. |
|
inline |
Find the number value of a given element. Starts at the current position and then starts again at the beginning of the data set if the element isn't found. This supports only simple, single element names.
name | The name of the element to find. |
|
inline |
Find the OBJECT with the given name. Starts at the current position and then starts again at the beginning of the data set if the element isn't found. This supports only simple, single element names.
name | The name of the OBJECT to find. |
true | If the OBJECT was found. The current position will be set to the start of the OBJECT. |
false | If the OBJECT was not found. |
|
inline |
Find the permissive boolean value of a given element. Starts at the current position and then starts again at the beginning of the data set if the element isn't found. This supports only simple, single element names.
name | The name of the element to find. |
true | If the current element a TRUE_EL primitive type, is "True", "true", or is a non-zero number. |
false | If the current element is not a TRUE_EL primitive type, "True", "true", or is 0. |
|
inline |
Find the string value of a given element. Starts at the current position and then starts again at the beginning of the data set if the element isn't found. This supports only simple, single element names.
name | The name of the element to find. |
|
inline |
Find the number value of the element after the element with the given name.
name | The name of the element to find. |
|
inline |
Find the number value of the element with the given name in the current object. Does not search sub-objects.
name | The name of the element to find. |
|
inline |
Find the OBJECT of the element after the element with the given name.
name | The name of the OBJECT to find. |
true | If the OBJECT was found. The current position will be set to the start of the OBJECT. |
false | If the OBJECT was not found. |
|
inline |
Find the OBJECT of the element with the given name in the current OBJECT. Does not search sub-objects.
name | The name of the OBJECT to find. |
true | If the OBJECT was found. The current position will be set to the start of the OBJECT. |
false | If the OBJECT was not found. |
|
inline |
Find the permissive boolean value of the element after the element with the provided name.
name | The name of element to search on. |
true | If the current element a TRUE_EL primitive type, is "True", "true", or is a non-zero number. |
false | If the current element is not a TRUE_EL primitive type, "True", "true", or is 0. |
|
inline |
Find the permissive boolean value of the element with the given name in the current object. Does not search sub-objects.
name | The name of the element to find. |
true | If the current element a TRUE_EL primitive type, is "True", "true", or is a non-zero number. |
false | If the current element is not a TRUE_EL primitive type, "True", "true", or is 0. |
|
inline |
Find the string value of the element after the element with the given name.
name | The name of the element to find. |
|
inline |
Find the string value of the element with the given name in the current object. Does not search sub-objects.
name | The name of the element to find. |
|
inline |
Get the element at the current position of the JSON data set.
UNDEFINED | If there is an error in the parsing or if the parsing is not complete. |
EOF_EL | If it's the last element in the data set. |
|
inline |
Get the first element of the JSON data set.
UNDEFINED | If there is an error in the parsing or if the parsing is not complete. |
EOF_EL | If it's the last element in the data set. |
|
inline |
Get the element at the next position of the JSON data set.
UNDEFINED | If there is an error in the parsing or if the parsing is not complete. |
EOF_EL | If it's the last element in the data set. |
json_primitive_type ParsedJsonDataSet::GetNextArray | ( | ) |
Iterates the current element of the JSON data set until it finds one of type BEGIN_ARRAY.
NOTFOUND | If there is no BEGIN_ARRAY element after the current position. |
json_primitive_type ParsedJsonDataSet::GetNextBoolInCurrentArray | ( | ) |
Get the next element of type TRUE_EL that exists in the current ARRAY after the current position.
NOTFOUND | If there is no NAME element after the current position. |
|
inline |
Iterates the current element of the JSON data set until it finds one of type NAME.
NOTFOUND | If there is no NAME element after the current position. |
|
inline |
Get the next element of type NAME that exists in the current ARRAY after the current position.
NOTFOUND | If there is no NAME element after the current position. |
|
inline |
Get the next element of type NAME that exists in the current OBJECT after the current position.
NOTFOUND | If there is no NAME element after the current position. |
json_primitive_type ParsedJsonDataSet::GetNextNumberInCurrentArray | ( | ) |
Get the next element of type NUMBER that exists in the current ARRAY after the current position.
NOTFOUND | If there is no NAME element after the current position. |
json_primitive_type ParsedJsonDataSet::GetNextObject | ( | ) |
Get the next element of type name that exists in the current OBJECT after the current position.
NOTFOUND | If there is no BEGIN_OBJECT element after the current position. |
json_primitive_type ParsedJsonDataSet::GetNextObjectInCurrentArray | ( | ) |
Get the next element of type BEGIN_OBJECT that exists in the current ARRAY after the current position.
NOTFOUND | If there is no BEGIN_OBJECT element after the current position. |
json_primitive_type ParsedJsonDataSet::GetNextStringInCurrentArray | ( | ) |
Get the next element of type STRING that exists in the current ARRAY after the current position.
NOTFOUND | If there is no NAME element after the current position. |
JsonRef ParsedJsonDataSet::GetParsePosition | ( | ) |
Gets the current parse position object for the JSON data set.
|
inline |
Calculates how many characters the JSON data set would take to print.
pretty | Whether indentation and new lines should be provided between elements. |
|
inline |
Get the element at the current position of the JSON data set, including non-public types.
UNDEFINED | If there is an error in the parsing or if the parsing is not complete. |
EOF_EL | If it's the last element in the data set. |
|
inline |
Get a JsonRef representing any entity from a parent object by key name.
Useful if more than one JSON object/element has the same name.
*name | Pointer to name of the entity to find |
|
inline |
Get a JsonRef representing an object from a parent object by key name.
*name | Pointer to name of the object to find |
|
inline |
Get a JsonRef representing any entity from a parent object by key name.
Shortcut for JsonRef::name()
*name | Pointer to name of the entity to find |
|
inline |
|
inline |
Returns true if the current element a TRUE_EL primitive type, is "True", "true", or is a non-zero number.
true | If the current element a TRUE_EL primitive type, is "True", "true", or is a non-zero number. |
false | If the current element does not meet the true condition.. |
|
inline |
Prints the JSON data set to stdout.
pretty | Whether to show indentation and new lines between JSON elements. |
|
inline |
Prints the JSON data set to a provided buffer.
buffer | The buffer to print to. |
maxlen | The max length of the buffer. |
pretty | Whether indentation and new lines should be provided between elements. |
|
inline |
Prints the JSON data set to a specified file descriptor.
fd | The file descriptor to print to. |
pretty | Whether indentation and new lines should be provided between elements. |
|
inline |
|
virtual |
Reads in data from the specified file descriptor and parses it into the JSON data set.
fd | The file descriptor to read data from. |
|
inline |
Resets the parser position to the beginning of the JSON data set.
Sets the current parse position object for the JSON data set.
pos | The JsonRef that you want to set the current position to. |
|
inline |
Skips over the current value, and get the next element. If called inside an ARRAY or OBJECT, it will walk to the end of the ARRAY or OJBECT and return the next element it finds. If it reaches the end of the ARRAY or OBJECT before it finds a value, it will return NOTFOUND.
NOTFOUND | If there are no other elements after the current one. |
|
virtual |
Writes the passed in data to the JSON data set.
pCopyFrom | What data to write. |
numBytes | How many bytes to copy. |