NetBurner 3.5.0
PDF Version
 
JsonLexerFDAdapter Class Reference

Get the type name of the JSON primitive type passed in. More...

#include <json_lexer.h>

Inherits ParsedJsonDataSet, and fd_adapter.

Additional Inherited Members

- Public Member Functions inherited from ParsedJsonDataSet
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.
 
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.
 
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.
 
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.
 
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.
 
ParsedJsonDataSetStartBuilding ()
 Use to start building the JSON data set.
 
ParsedJsonDataSetAddObjectStart (const char *name)
 Use to start an object in the JSON data set.
 
ParsedJsonDataSetAddMyMac (const char *name)
 Add the device MAC address to the JSON data set.
 
ParsedJsonDataSetAdd (const char *name, int i)
 Add a name/value pair to the JSON data set where the value is an int.
 
ParsedJsonDataSetAdd (const char *name, short i)
 Add a name/value pair to the JSON data set where the value is a short.
 
ParsedJsonDataSetAdd (const char *name, long i)
 Add a name/value pair to the JSON data set where the value is a long.
 
ParsedJsonDataSetAdd (const char *name, unsigned int i)
 Add a name/value pair to the JSON data set where the value is an unsigned int.
 
ParsedJsonDataSetAdd (const char *name, unsigned short i)
 Add a name/value pair to the JSON data set where the value is a unsigned short.
 
ParsedJsonDataSetAdd (const char *name, unsigned long i)
 Add a name/value pair to the JSON data set where the value is a unsigned long.
 
ParsedJsonDataSetAdd (const char *name, double d)
 Add a name/value pair to the JSON data set where the value is a double.
 
ParsedJsonDataSetAdd (const char *name, const char *str)
 Add a name/value pair to the JSON data set where the value is a string.
 
ParsedJsonDataSetAdd (const char *name, bool b)
 Add a name/value pair to the JSON data set where the value is a bool.
 
ParsedJsonDataSetAdd (const char *name, IPADDR4 i4)
 Add a name/value pair to the JSON data set where the value is an IPv4 address.
 
ParsedJsonDataSetAdd (const char *name, const IPADDR &i)
 Add a name/value pair to the JSON data set where the value is an IP address.
 
ParsedJsonDataSetAdd (const char *name, const MACADR &ma)
 Add a name/value pair to the JSON data set where the value is a MAC address.
 
ParsedJsonDataSetAddNull (const char *name)
 Add a name/value pair to the JSON data set where the value is null.
 
ParsedJsonDataSetAddArrayStart (const char *name)
 Add an ARRAY start to the JSON data set.
 
ParsedJsonDataSetEndArray ()
 Add an ARRAY end to the JSON data set.
 
ParsedJsonDataSetAddArrayElement (int i)
 Add an integer value to the current array.
 
ParsedJsonDataSetAddArrayElement (short i)
 Add a short value to the current array.
 
ParsedJsonDataSetAddArrayElement (long i)
 Add a long value to the current array.
 
ParsedJsonDataSetAddArrayElement (unsigned int i)
 Add an unsigned int value to the current array.
 
ParsedJsonDataSetAddArrayElement (unsigned short i)
 Add an unsigned short value to the current array.
 
ParsedJsonDataSetAddArrayElement (unsigned long i)
 Add an unsigned long value to the current array.
 
ParsedJsonDataSetAddArrayElement (double d)
 Add a double to the current array.
 
ParsedJsonDataSetAddArrayElement (const char *str)
 Add a string to the current array.
 
ParsedJsonDataSetAddArrayElement (bool b)
 Add a bool to the current array.
 
ParsedJsonDataSetAddArrayElement (const IPADDR &i)
 Add an IP address to the current array.
 
ParsedJsonDataSetAddArrayElementArray ()
 Add the start of an array element to the current array.
 
ParsedJsonDataSetAddArrayObjectStart ()
 Add the start of an object element to the current array.
 
ParsedJsonDataSetAddNullArrayElement ()
 Add a null element to the current array.
 
ParsedJsonDataSetEndObject ()
 Add an end to the current object.
 
ParsedJsonDataSetDoneBuilding ()
 Add an end JSON data set and finish building.
 

Detailed Description

Get the type name of the JSON primitive type passed in.

Parameters
tThe JSON primitive type to get the name of.
Returns
The name of the JSON primitive type passed in.

The documentation for this class was generated from the following file: