Gazebo Fuel_tools

API Reference

7.3.1

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< ModelIdentifierParseModels (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< WorldIdentifierParseWorlds (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 std::string BuildModel ( ModelIter  _modelIt)
static

Build a model iterator from a JSON string.

Parameters
[in]_modelItA model iterator containing only one model
Returns
A JSON string representing a single model

◆ BuildWorld()

static std::string BuildWorld ( WorldIter  _worldIt)
static

Build a world iterator from a JSON string.

Parameters
[in]_worldItA world iterator containing only one world
Returns
A JSON string representing a single world

◆ ParseLicenses()

static bool ParseLicenses ( const std::string _json,
std::map< std::string, unsigned int > &  _licenses 
)
static

Parse a license array JSON string and return a map of licenses.

Parameters
[in]_jsonJSON string containing an array of models
[out]_licensesLicense 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 ModelIdentifier ParseModel ( const std::string _json,
const ServerConfig _server 
)
static

Parse a model JSON string and return a model identifier.

Parameters
[in]_jsonJSON string containing a model.
[in]_serverThe server sending the JSON. This information is populated into some fields of the model.
Returns
a model identifier

◆ ParseModels()

static std::vector<ModelIdentifier> ParseModels ( const std::string _json,
const ServerConfig _server 
)
static

Parse a model array JSON string and return a model iterator.

Parameters
[in]_jsonJSON string containing an array of models
[in]_serverThe server sending the JSON. This information is populated into some fields of the models.
Returns
vector of model identifiers

◆ ParseWorld()

static WorldIdentifier ParseWorld ( const std::string _json,
const ServerConfig _server 
)
static

Parse a world JSON string and return a world identifier.

Parameters
[in]_jsonJSON string containing a world.
[in]_serverThe server sending the JSON. This information is populated into some fields of the world.
Returns
A world identifier

◆ ParseWorlds()

static std::vector<WorldIdentifier> ParseWorlds ( const std::string _json,
const ServerConfig _server 
)
static

Parse a world array JSON string and return a world iterator.

Parameters
[in]_jsonJSON string containing an array of worlds
[in]_serverThe 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: