Functions for dealing with JSON.
Definition at line 15 of file VuoJsonUtilities.hh.
Static Public Member Functions | |
static string | parseString (json_object *o, string key, string defaultString="", bool *foundValue=NULL) |
Parses the string value for key in the top level of the JSON object. | |
static string | parseObjectString (json_object *o, string outerKey, string innerKey, string defaultString="", bool *foundValue=NULL) |
Parses the string value for path outerKey/innerKey of the JSON object. | |
static int | parseInt (json_object *o, string key, int defaultInt=0, bool *foundValue=NULL) |
Parses the integer value for key in the top level of the JSON object. | |
static bool | parseBool (json_object *o, string key, bool defaultBool=false, bool *foundValue=NULL) |
Parses the boolean value for key in the top level of the JSON object. | |
static vector< string > | parseArrayOfStrings (json_object *o, string key) |
Parses the array-of-strings value for key in the top level of the JSON object. | |
static map< string, string > | parseObjectWithStringValues (json_object *o, string key) |
Parses the keys and string values from the object value for key in the top level of the JSON object. | |
static json_object * | getJson (vector< string > strings) |
Converts a vector of std::strings into a JSON array of strings. | |
|
static |
Converts a vector of std::strings into a JSON array of strings.
Definition at line 167 of file VuoJsonUtilities.cc.
|
static |
Parses the array-of-strings value for key
in the top level of the JSON object.
If no such value is found, returns an empty vector.
Definition at line 121 of file VuoJsonUtilities.cc.
|
static |
Parses the boolean value for key
in the top level of the JSON object.
If no such value is found, returns defaultBool
.
Definition at line 96 of file VuoJsonUtilities.cc.
|
static |
Parses the integer value for key
in the top level of the JSON object.
If no such value is found, returns defaultInt
.
Definition at line 71 of file VuoJsonUtilities.cc.
|
static |
Parses the string value for path outerKey/innerKey
of the JSON object.
If no such value is found, returns defaultString
.
Definition at line 42 of file VuoJsonUtilities.cc.
|
static |
Parses the keys and string values from the object value for key
in the top level of the JSON object.
If no such value is found, returns an empty map.
Definition at line 146 of file VuoJsonUtilities.cc.
|
static |
Parses the string value for key
in the top level of the JSON object.
If no such value is found, returns defaultString
.
Definition at line 17 of file VuoJsonUtilities.cc.