JSONParser Class Reference
A helper class for making REST requests. More...
#include <JSONParser.hh>
Static Public Member Functions | |
static std::string | BuildModel (ModelIter _modelIt) |
Build a model iterator from a JSON string. More... | |
static std::string | BuildWorld (WorldIter _worldIt) |
Build a world iterator from a JSON string. More... | |
static bool | ParseLicenses (const std::string &_json, std::map< std::string, unsigned int > &_licenses) |
Parse a license array JSON string and return a map of licenses. More... | |
static ModelIdentifier | ParseModel (const std::string &_json, const ServerConfig &_server) |
Parse a model JSON string and return a model identifier. More... | |
static std::vector< ModelIdentifier > | ParseModels (const std::string &_json, const ServerConfig &_server) |
Parse a model array JSON string and return a model iterator. More... | |
static WorldIdentifier | ParseWorld (const std::string &_json, const ServerConfig &_server) |
Parse a world JSON string and return a world identifier. More... | |
static std::vector< WorldIdentifier > | ParseWorlds (const std::string &_json, const ServerConfig &_server) |
Parse a world array JSON string and return a world iterator. More... | |
Detailed Description
A helper class for making REST requests.
Member Function Documentation
◆ BuildModel()
|
static |
Build a model iterator from a JSON string.
- Parameters
-
[in] _modelIt A model iterator containing only one model
- Returns
- A JSON string representing a single model
◆ BuildWorld()
|
static |
Build a world iterator from a JSON string.
- Parameters
-
[in] _worldIt A world iterator containing only one world
- Returns
- A JSON string representing a single world
◆ ParseLicenses()
|
static |
Parse a license array JSON string and return a map of licenses.
- Parameters
-
[in] _json JSON string containing an array of models [out] _licenses License information where the keys are license names and values are license id's on the Fuel server.
- Returns
- True on success, false otherwise.
◆ ParseModel()
|
static |
Parse a model JSON string and return a model identifier.
- Parameters
-
[in] _json JSON string containing a model. [in] _server The server sending the JSON. This information is populated into some fields of the model.
- Returns
- a model identifier
◆ ParseModels()
|
static |
Parse a model array JSON string and return a model iterator.
- Parameters
-
[in] _json JSON string containing an array of models [in] _server The server sending the JSON. This information is populated into some fields of the models.
- Returns
- vector of model identifiers
◆ ParseWorld()
|
static |
Parse a world JSON string and return a world identifier.
- Parameters
-
[in] _json JSON string containing a world. [in] _server The server sending the JSON. This information is populated into some fields of the world.
- Returns
- A world identifier
◆ ParseWorlds()
|
static |
Parse a world array JSON string and return a world iterator.
- Parameters
-
[in] _json JSON string containing an array of worlds [in] _server The server sending the JSON. This information is populated into some fields of the worlds.
- Returns
- vector of world identifiers
The documentation for this class was generated from the following file: