Vuo  2.3.2
Static Public Member Functions | List of all members
VuoJsonUtilities Class Reference

Description

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. More...
 
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. More...
 
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. More...
 
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. More...
 
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. More...
 
static json_objectgetJson (vector< string > strings)
 Converts a vector of std::strings into a JSON array of strings. More...
 

Member Function Documentation

◆ getJson()

json_object * VuoJsonUtilities::getJson ( vector< string >  strings)
static

Converts a vector of std::strings into a JSON array of strings.

Definition at line 144 of file VuoJsonUtilities.cc.

◆ parseArrayOfStrings()

vector< string > VuoJsonUtilities::parseArrayOfStrings ( json_object o,
string  key 
)
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.

◆ parseBool()

bool VuoJsonUtilities::parseBool ( json_object o,
string  key,
bool  defaultBool = false,
bool *  foundValue = NULL 
)
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.

◆ parseInt()

int VuoJsonUtilities::parseInt ( json_object o,
string  key,
int  defaultInt = 0,
bool *  foundValue = NULL 
)
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.

◆ parseObjectString()

string VuoJsonUtilities::parseObjectString ( json_object o,
string  outerKey,
string  innerKey,
string  defaultString = "",
bool *  foundValue = NULL 
)
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.

◆ parseString()

string VuoJsonUtilities::parseString ( json_object o,
string  key,
string  defaultString = "",
bool *  foundValue = NULL 
)
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.


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