Arbiter  0.0.0
Public Member Functions | Friends | List of all members
arbiter::Endpoint Class Reference

A utility class to drive usage from a common root directory. More...

#include <arbiter/endpoint.hpp>

Public Member Functions

std::string root () const
 
std::string prefixedRoot () const
 
std::string type () const
 
bool isRemote () const
 
bool isLocal () const
 
bool isHttpDerived () const
 
std::string get (std::string subpath) const
 
std::unique_ptr< std::string > tryGet (std::string subpath) const
 
std::vector< char > getBinary (std::string subpath) const
 
std::unique_ptr< std::vector< char > > tryGetBinary (std::string subpath) const
 
std::size_t getSize (std::string subpath) const
 
std::unique_ptr< std::size_t > tryGetSize (std::string subpath) const
 
void put (std::string subpath, const std::string &data) const
 
void put (std::string subpath, const std::vector< char > &data) const
 
std::string get (std::string subpath, http::Headers headers, http::Query=http::Query()) const
 
std::unique_ptr< std::string > tryGet (std::string subpath, http::Headers headers, http::Query=http::Query()) const
 
std::vector< char > getBinary (std::string path, http::Headers headers, http::Query query=http::Query()) const
 
std::unique_ptr< std::vector< char > > tryGetBinary (std::string path, http::Headers headers, http::Query query=http::Query()) const
 
void put (std::string path, const std::string &data, http::Headers headers, http::Query query=http::Query()) const
 
void put (std::string path, const std::vector< char > &data, http::Headers headers, http::Query query=http::Query()) const
 
std::string fullPath (const std::string &subpath) const
 
std::string prefixedFullPath (const std::string &subpath) const
 
Endpoint getSubEndpoint (std::string subpath) const
 

Friends

class Arbiter
 

Detailed Description

A utility class to drive usage from a common root directory.

Acts as a reusable Driver based on a single root directory. The interface is the same as a Driver, although path parameters represent subpaths which will be appended to the value from Endpoint::root to form a full path.

An Endpoint may be created using Arbiter::getEndpoint.

Member Function Documentation

std::string arbiter::Endpoint::fullPath ( const std::string &  subpath) const

Get the full path corresponding to this subpath. The path will not be prefixed with the driver type or the :// delimiter.

std::string arbiter::Endpoint::get ( std::string  subpath) const

Passthrough to Driver::get.

std::string arbiter::Endpoint::get ( std::string  subpath,
http::Headers  headers,
http::Query  query = http::Query() 
) const
std::vector< char > arbiter::Endpoint::getBinary ( std::string  subpath) const

Passthrough to Driver::getBinary.

std::vector< char > arbiter::Endpoint::getBinary ( std::string  path,
http::Headers  headers,
http::Query  query = http::Query() 
) const
std::size_t arbiter::Endpoint::getSize ( std::string  subpath) const

Passthrough to Driver::getSize.

Endpoint arbiter::Endpoint::getSubEndpoint ( std::string  subpath) const

Get a further nested subpath relative to this Endpoint's root.

bool arbiter::Endpoint::isHttpDerived ( ) const
bool arbiter::Endpoint::isLocal ( ) const

Negation of Endpoint::isRemote.

bool arbiter::Endpoint::isRemote ( ) const

Passthrough to Driver::isRemote.

std::string arbiter::Endpoint::prefixedFullPath ( const std::string &  subpath) const

Get the full path corresponding to this subpath. If isRemote is true, then the path will be prefixed with type() + "://".

std::string arbiter::Endpoint::prefixedRoot ( ) const

Returns root directory name ending with the character /. If isRemote is true, then the path will be prefixed with type() + "://".

void arbiter::Endpoint::put ( std::string  subpath,
const std::string &  data 
) const
void arbiter::Endpoint::put ( std::string  subpath,
const std::vector< char > &  data 
) const
void arbiter::Endpoint::put ( std::string  path,
const std::string &  data,
http::Headers  headers,
http::Query  query = http::Query() 
) const
void arbiter::Endpoint::put ( std::string  path,
const std::vector< char > &  data,
http::Headers  headers,
http::Query  query = http::Query() 
) const
std::string arbiter::Endpoint::root ( ) const

Returns root directory name without any type-prefixing, and will always end with the character /. For example ~/data/, or my-bucket/nested-directory/.

std::unique_ptr< std::string > arbiter::Endpoint::tryGet ( std::string  subpath) const

Passthrough to Driver::tryGet.

std::unique_ptr< std::string > arbiter::Endpoint::tryGet ( std::string  subpath,
http::Headers  headers,
http::Query  query = http::Query() 
) const
std::unique_ptr< std::vector< char > > arbiter::Endpoint::tryGetBinary ( std::string  subpath) const

Passthrough to Driver::tryGetBinary.

std::unique_ptr< std::vector< char > > arbiter::Endpoint::tryGetBinary ( std::string  path,
http::Headers  headers,
http::Query  query = http::Query() 
) const
std::unique_ptr< std::size_t > arbiter::Endpoint::tryGetSize ( std::string  subpath) const

Passthrough to Driver::tryGetSize.

std::string arbiter::Endpoint::type ( ) const

Passthrough to Driver::type.


The documentation for this class was generated from the following files: