Arbiter  0.0.0
Public Member Functions | Static Public Member Functions | Protected Member Functions | List of all members
arbiter::drivers::Fs Class Reference

Local filesystem driver. More...

#include <arbiter/drivers/fs.hpp>

Inheritance diagram for arbiter::drivers::Fs:
arbiter::Driver arbiter::drivers::Test

Public Member Functions

virtual std::string type () const override
 
virtual std::unique_ptr< std::size_t > tryGetSize (std::string path) const override
 
virtual void put (std::string path, const std::vector< char > &data) const override
 
virtual std::vector< std::string > glob (std::string path, bool verbose) const override
 Resolve a wildcard path. More...
 
virtual bool isRemote () const override
 
- Public Member Functions inherited from arbiter::Driver
std::string get (std::string path) const
 
std::unique_ptr< std::string > tryGet (std::string path) const
 
std::vector< char > getBinary (std::string path) const
 
std::unique_ptr< std::vector< char > > tryGetBinary (std::string path) const
 
std::size_t getSize (std::string path) const
 
void put (std::string path, const std::string &data) const
 
std::vector< std::string > resolve (std::string path, bool verbose=false) const
 Resolve a possibly globbed path. More...
 

Static Public Member Functions

static std::unique_ptr< Fscreate (const Json::Value &json)
 

Protected Member Functions

virtual bool get (std::string path, std::vector< char > &data) const override
 

Detailed Description

Local filesystem driver.

Member Function Documentation

bool arbiter::drivers::Fs::get ( std::string  path,
std::vector< char > &  data 
) const
overrideprotectedvirtual
Parameters
pathPath with the type-specifying prefix information stripped.
[out]dataEmpty vector in which to write resulting data.

Implements arbiter::Driver.

std::vector< std::string > arbiter::drivers::Fs::glob ( std::string  path,
bool  verbose 
) const
overridevirtual

Resolve a wildcard path.

This operation should return a non-recursive resolution of the files matching the given wildcard path (no directories). With the exception of the filesystem Driver, results should be prefixed with type() + "://".

Note
The default behavior is to throw ArbiterError, so derived classes may optionally override if they can perform this behavior.
Parameters
pathA string ending with the character *, and with all type-specifying prefix information like http:// or s3:// stripped.
verboseIf true, this function may print out minimal information to indicate that progress is occurring.

Reimplemented from arbiter::Driver.

virtual bool arbiter::drivers::Fs::isRemote ( ) const
inlineoverridevirtual

True for remote paths, otherwise false. If true, a fs::LocalHandle request will download and write this file to the local filesystem.

Reimplemented from arbiter::Driver.

Reimplemented in arbiter::drivers::Test.

void arbiter::drivers::Fs::put ( std::string  path,
const std::vector< char > &  data 
) const
overridevirtual

Write data to the given path.

Note
Derived classes must override.
Parameters
pathPath with the type-specifying prefix information stripped.

Implements arbiter::Driver.

std::unique_ptr< std::size_t > arbiter::drivers::Fs::tryGetSize ( std::string  path) const
overridevirtual

Get the file size in bytes, if available.

Implements arbiter::Driver.

virtual std::string arbiter::drivers::Fs::type ( ) const
inlineoverridevirtual

Returns a string identifying this driver type, which should be unique among all other drivers. Paths that begin with the substring <type>:// will be routed to this driver. For example, fs, s3, or http.

Note
Derived classes must override.

Implements arbiter::Driver.

Reimplemented in arbiter::drivers::Test.


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