Classes | |
class | ClientConfig |
High level interface to ignition fuel. More... | |
class | CollectionIdentifier |
Defines how to identify a collection. More... | |
class | FuelClient |
High level interface to ignition fuel. More... | |
class | JSONParser |
A helper class for making REST requests. More... | |
class | LocalCache |
Class for managing stuff in the local cache. More... | |
class | Model |
Defines how to identify a model. More... | |
class | ModelIdentifier |
Defines how to identify a model. More... | |
class | ModelIter |
class for iterating through models More... | |
class | Rest |
A helper class for making REST requests. More... | |
struct | RestResponse |
Stores a response to a RESTful request. More... | |
class | Result |
Class describing a result of an operation. More... | |
class | ServerConfig |
Describes options needed for a server. More... | |
class | WorldIdentifier |
Defines how to identify a world. More... | |
class | WorldIter |
class for iterating through worlds More... | |
class | Zip |
A helper class for making REST requests. More... | |
Enumerations | |
enum | HttpMethod { GET, POST, DELETE, PUT, PATCH, POST_FORM, PATCH_FORM } |
the types of HTTP methods More... | |
enum | ResultType { UNKNOWN = 0, DELETE, DELETE_NOT_FOUND, DELETE_ERROR, FETCH, FETCH_ALREADY_EXISTS, FETCH_NOT_FOUND, FETCH_ERROR, UPLOAD, UPLOAD_ALREADY_EXISTS, UPLOAD_ERROR, PATCH_ERROR, PATCH } |
Result type. More... | |
Functions | |
std::string | fetchResource (const std::string &_uri) |
Download the specified resource into the default configuration of fuel tools. This will place the asset in ~/.ignition/fuel. More... | |
std::string | fetchResourceWithClient (const std::string &_uri, FuelClient &_client) |
Download the specified resource using the ClientConfig contained in the FuelClient parameter. More... | |
std::string | sdfFromPath (const std::string &_path) |
Get the SDF file path for a model or world based on a directory containing a Fuel model or world. Here is a typical use case: More... | |
std::string | uriToPath (const common::URI &_uri) |
Convert a URI to a string suitable to use as a path on disk. It strips the scheme and authority's // prefix. More... | |
Enumeration Type Documentation
◆ HttpMethod
|
strong |
◆ ResultType
|
strong |
Result type.
Enumerator | |
---|---|
UNKNOWN | Uninitialized type. |
DELETE | Delete successful. |
DELETE_NOT_FOUND | Model not found. |
DELETE_ERROR | Delete failed. Other errors.
|
FETCH | Fetch successful. |
FETCH_ALREADY_EXISTS | Model already exists. |
FETCH_NOT_FOUND | Model not found. |
FETCH_ERROR | Fetch failed. Other errors.
|
UPLOAD | Upload successful. |
UPLOAD_ALREADY_EXISTS | Model already exists. |
UPLOAD_ERROR | Upload failed. Other errors.
|
PATCH_ERROR | Patch failed. |
PATCH | Patch successful. |
Function Documentation
◆ fetchResource()
std::string ignition::fuel_tools::fetchResource | ( | const std::string & | _uri | ) |
Download the specified resource into the default configuration of fuel tools. This will place the asset in ~/.ignition/fuel.
- Parameters
-
[in] _uri URI to the asset.
- Returns
- Path to the downloaded asset. Empty on error.
◆ fetchResourceWithClient()
std::string ignition::fuel_tools::fetchResourceWithClient | ( | const std::string & | _uri, |
FuelClient & | _client | ||
) |
Download the specified resource using the ClientConfig contained in the FuelClient parameter.
- Parameters
-
[in] _uri URI to the asset. [in] _client Custom FuelClient configuration.
- Returns
- Path to the downloaded asset. Empty on error.
◆ sdfFromPath()
std::string ignition::fuel_tools::sdfFromPath | ( | const std::string & | _path | ) |
Get the SDF file path for a model or world based on a directory containing a Fuel model or world. Here is a typical use case:
- Fetch a Fuel resource:
std::string resourcePath = fetchResource("https://...")
- Get the SDF file for the resource:
std::string resourceSdf = sdfFromPath(resourcePath)
- Parse the SDF file using libsdformat.
This function will determine the SDF file according to the following:
- Check for a metadata.pbtxt file, and return the SDF file specified within the metadata.pbtxt file.
- Check for a model.config file, and return the SDF file specified withing the model.config file.
- Return the first file with an
.sdf
extension.- Parameters
-
[in] _path Filesystem path to a Fuel model or world directory.
- Returns
- Full path to the model or world SDF file, or empty string if the SDF file coult not be determined.
◆ uriToPath()
std::string ignition::fuel_tools::uriToPath | ( | const common::URI & | _uri | ) |
Convert a URI to a string suitable to use as a path on disk. It strips the scheme and authority's //
prefix.
- Parameters
-
[in] _uri URI to convert.
- Returns
- String suitable to use in file paths