Apache OpenDALâ„¢ C++ Binding
The C++ binding for Apache OpenDALâ„¢
Public Member Functions | List of all members
opendal::Operator Class Reference

Operator is the entry for all public APIs. More...

#include <opendal.hpp>

Public Member Functions

 Operator ()=default
 
 Operator (std::string_view scheme, const std::unordered_map< std::string, std::string > &config={})
 Construct a new Operator object. More...
 
 Operator (const Operator &)=delete
 
Operatoroperator= (const Operator &)=delete
 
 Operator (Operator &&)=default
 
Operatoroperator= (Operator &&)=default
 
 ~Operator ()=default
 
bool available () const
 Check if the operator is available. More...
 
std::vector< uint8_t > read (std::string_view path)
 Read data from the operator. More...
 
void write (std::string_view path, const std::vector< uint8_t > &data)
 Write data to the operator. More...
 
Reader reader (std::string_view path)
 Read data from the operator. More...
 
bool is_exist (std::string_view path)
 Check if the path exists. More...
 
void create_dir (std::string_view path)
 Create a directory. More...
 
void copy (std::string_view src, std::string_view dst)
 Copy a file from src to dst. More...
 
void rename (std::string_view src, std::string_view dst)
 Rename a file from src to dst. More...
 
void remove (std::string_view path)
 Remove a file or directory. More...
 
Metadata stat (std::string_view path)
 Get the metadata of a file or directory. More...
 
std::vector< Entrylist (std::string_view path)
 List the entries of a directory. More...
 
Lister lister (std::string_view path)
 

Detailed Description

Operator is the entry for all public APIs.

Constructor & Destructor Documentation

◆ Operator() [1/4]

opendal::Operator::Operator ( )
default

◆ Operator() [2/4]

opendal::Operator::Operator ( std::string_view  scheme,
const std::unordered_map< std::string, std::string > &  config = {} 
)

Construct a new Operator object.

Parameters
schemeThe scheme of the operator, same as the name of rust doc
configThe configuration of the operator, same as the service doc

◆ Operator() [3/4]

opendal::Operator::Operator ( const Operator )
delete

◆ Operator() [4/4]

opendal::Operator::Operator ( Operator &&  )
default

◆ ~Operator()

opendal::Operator::~Operator ( )
default

Member Function Documentation

◆ available()

bool opendal::Operator::available ( ) const

Check if the operator is available.

Returns
true if the operator is available, false otherwise

◆ copy()

void opendal::Operator::copy ( std::string_view  src,
std::string_view  dst 
)

Copy a file from src to dst.

Parameters
srcThe source path
dstThe destination path

◆ create_dir()

void opendal::Operator::create_dir ( std::string_view  path)

Create a directory.

Parameters
pathThe path of the directory

◆ is_exist()

bool opendal::Operator::is_exist ( std::string_view  path)

Check if the path exists.

Parameters
pathThe path to check
Returns
true if the path exists, false otherwise

◆ list()

std::vector<Entry> opendal::Operator::list ( std::string_view  path)

List the entries of a directory.

Note
The returned entries are sorted by name.
Parameters
pathThe path of the directory
Returns
The entries of the directory

◆ lister()

Lister opendal::Operator::lister ( std::string_view  path)

◆ operator=() [1/2]

Operator& opendal::Operator::operator= ( const Operator )
delete

◆ operator=() [2/2]

Operator& opendal::Operator::operator= ( Operator &&  )
default

◆ read()

std::vector<uint8_t> opendal::Operator::read ( std::string_view  path)

Read data from the operator.

Note
The operation will make unnecessary copy. So we recommend to use the reader method.
Parameters
pathThe path of the data
Returns
The data read from the operator

◆ reader()

Reader opendal::Operator::reader ( std::string_view  path)

Read data from the operator.

Parameters
pathThe path of the data
Returns
The reader of the data

◆ remove()

void opendal::Operator::remove ( std::string_view  path)

Remove a file or directory.

Parameters
pathThe path of the file or directory

◆ rename()

void opendal::Operator::rename ( std::string_view  src,
std::string_view  dst 
)

Rename a file from src to dst.

Parameters
srcThe source path
dstThe destination path

◆ stat()

Metadata opendal::Operator::stat ( std::string_view  path)

Get the metadata of a file or directory.

Parameters
pathThe path of the file or directory
Returns
The metadata of the file or directory

◆ write()

void opendal::Operator::write ( std::string_view  path,
const std::vector< uint8_t > &  data 
)

Write data to the operator.

Parameters
pathThe path of the data
dataThe data to write

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