CompositeResourceRetriever allows multiple ResourceRetriever to be used interchangably by: (1) associating each ResourceRetriever with a particular URI schema and/or (2) providing a precedence order for trying multiple retrievers.
More...
#include <CompositeResourceRetriever.hpp>
CompositeResourceRetriever allows multiple ResourceRetriever to be used interchangably by: (1) associating each ResourceRetriever with a particular URI schema and/or (2) providing a precedence order for trying multiple retrievers.
◆ ~CompositeResourceRetriever()
virtual dart::utils::CompositeResourceRetriever::~CompositeResourceRetriever |
( |
| ) |
|
|
virtualdefault |
◆ addDefaultRetriever()
Add a default ResourceRetriever for all URIs.
This ResourceRetriever will be called after all schema-specific ResourceRetrievers, if any, have failed. This method may be called multiple times. In that case, the ResourceRetrievers will be queried in the same order in which they were added.
◆ addSchemaRetriever()
bool dart::utils::CompositeResourceRetriever::addSchemaRetriever |
( |
const std::string & |
_schema, |
|
|
const common::ResourceRetrieverPtr & |
_resourceRetriever |
|
) |
| |
Add a default ResourceRetriever for _schema This ResourceRetriever will be called after URIs that match the specified schema.
This method may be called multiple times. In that case, the ResourceRetrievers will be queried in the same order in which they were added.
◆ exists()
bool dart::utils::CompositeResourceRetriever::exists |
( |
const common::Uri & |
uri | ) |
|
|
overridevirtual |
◆ getFilePath()
std::string dart::utils::CompositeResourceRetriever::getFilePath |
( |
const common::Uri & |
uri | ) |
|
|
overridevirtual |
Returns absolute file path to uri
; an empty string if unavailable.
This base class returns an empty string by default.
Reimplemented from dart::common::ResourceRetriever.
◆ getRetrievers()
◆ readAll()
std::string dart::common::ResourceRetriever::readAll |
( |
const Uri & |
uri | ) |
|
|
virtualinherited |
Reads all data from the resource of uri, and returns it as a string.
- Parameters
-
[in] | uri | URI to the resource to be retrieved. |
- Returns
- The string retrieved from the resource.
- Exceptions
-
std::runtime_error | when failed to read sucessfully. |
◆ retrieve()
◆ mDefaultResourceRetrievers
◆ mResourceRetrievers