DART  6.10.1
dart::common::LocalResourceRetriever Class Reference

LocalResourceRetriever provides access to local resources specified by file:// URIs by wrapping the standard C and C++ file manipulation routines. More...

#include <LocalResourceRetriever.hpp>

Inheritance diagram for dart::common::LocalResourceRetriever:
dart::common::ResourceRetriever

Public Member Functions

virtual ~LocalResourceRetriever ()=default
 
bool exists (const Uri &_uri) override
 Returns whether the resource specified by a URI exists. More...
 
ResourcePtr retrieve (const Uri &_uri) override
 Returns the resource specified by a URI or nullptr on failure. More...
 
std::string getFilePath (const Uri &uri) override
 Returns absolute file path to uri; an empty string if unavailable. More...
 
virtual std::string readAll (const Uri &uri)
 Reads all data from the resource of uri, and returns it as a string. More...
 

Detailed Description

LocalResourceRetriever provides access to local resources specified by file:// URIs by wrapping the standard C and C++ file manipulation routines.

Constructor & Destructor Documentation

◆ ~LocalResourceRetriever()

virtual dart::common::LocalResourceRetriever::~LocalResourceRetriever ( )
virtualdefault

Member Function Documentation

◆ exists()

bool dart::common::LocalResourceRetriever::exists ( const Uri uri)
overridevirtual

Returns whether the resource specified by a URI exists.

Implements dart::common::ResourceRetriever.

◆ getFilePath()

std::string dart::common::LocalResourceRetriever::getFilePath ( const 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.

◆ 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]uriURI to the resource to be retrieved.
Returns
The string retrieved from the resource.
Exceptions
std::runtime_errorwhen failed to read sucessfully.

◆ retrieve()

common::ResourcePtr dart::common::LocalResourceRetriever::retrieve ( const Uri uri)
overridevirtual

Returns the resource specified by a URI or nullptr on failure.

Implements dart::common::ResourceRetriever.