Apache OpenDALâ„¢ C++ Binding
The C++ binding for Apache OpenDALâ„¢
Loading...
Searching...
No Matches
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 () noexcept
 
 Operator (std::string_view scheme, const std::unordered_map< std::string, std::string > &config={}, std::vector< std::unique_ptr< OperatorOption > > options={})
 Construct a new Operator object.
 
 Operator (const Operator &)=delete
 
Operatoroperator= (const Operator &)=delete
 
 Operator (Operator &&other) noexcept
 
Operatoroperator= (Operator &&other) noexcept
 
 ~Operator () noexcept
 
bool Available () const
 Check if the operator is available.
 
std::string Read (std::string_view path)
 Read data from the operator.
 
std::string Read (std::string_view path, const ReadOptions &options)
 Read data from the operator with extra options.
 
void Write (std::string_view path, std::string_view data)
 Write data to the operator.
 
void Write (std::string_view path, std::string_view data, const WriteOptions &options)
 Write data to the operator with extra options.
 
Reader GetReader (std::string_view path)
 Read data from the operator.
 
Reader GetReader (std::string_view path, const ReaderOptions &options)
 
Writer GetWriter (std::string_view path)
 
Writer GetWriter (std::string_view path, const WriteOptions &options)
 
bool IsExist (std::string_view path)
 Check if the path exists.
 
bool Exists (std::string_view path)
 Check if the path exists.
 
void CreateDir (std::string_view path)
 Create a directory.
 
void Copy (std::string_view src, std::string_view dst)
 Copy a file from src to dst.
 
void Copy (std::string_view src, std::string_view dst, const CopyOptions &options)
 
void Rename (std::string_view src, std::string_view dst)
 Rename a file from src to dst.
 
void Rename (std::string_view src, std::string_view dst, const RenameOptions &options)
 
void Remove (std::string_view path)
 Remove a file or directory.
 
void Remove (std::string_view path, const DeleteOptions &options)
 
void RemoveAll (const std::vector< std::string > &paths)
 
Metadata Stat (std::string_view path)
 Get the metadata of a file or directory.
 
Metadata Stat (std::string_view path, const StatOptions &options)
 
std::vector< EntryList (std::string_view path)
 List the entries of a directory.
 
std::vector< EntryList (std::string_view path, const ListOptions &options)
 
Lister GetLister (std::string_view path)
 
Lister GetLister (std::string_view path, const ListOptions &options)
 
Capability Info ()
 

Detailed Description

Operator is the entry for all public APIs.

Constructor & Destructor Documentation

◆ Operator() [1/4]

opendal::Operator::Operator ( )
noexcept

◆ Operator() [2/4]

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

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
optionsOptional layers to apply during construction

◆ Operator() [3/4]

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

◆ Operator() [4/4]

opendal::Operator::Operator ( Operator &&  other)
noexcept

◆ ~Operator()

opendal::Operator::~Operator ( )
noexcept

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() [1/2]

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

◆ Copy() [2/2]

void opendal::Operator::Copy ( std::string_view  src,
std::string_view  dst,
const CopyOptions options 
)

◆ CreateDir()

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

Create a directory.

Parameters
pathThe path of the directory

◆ Exists()

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

Check if the path exists.

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

◆ GetLister() [1/2]

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

◆ GetLister() [2/2]

Lister opendal::Operator::GetLister ( std::string_view  path,
const ListOptions options 
)

◆ GetReader() [1/2]

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

Read data from the operator.

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

◆ GetReader() [2/2]

Reader opendal::Operator::GetReader ( std::string_view  path,
const ReaderOptions options 
)

◆ GetWriter() [1/2]

Writer opendal::Operator::GetWriter ( std::string_view  path)

◆ GetWriter() [2/2]

Writer opendal::Operator::GetWriter ( std::string_view  path,
const WriteOptions options 
)

◆ Info()

Capability opendal::Operator::Info ( )

◆ IsExist()

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

Check if the path exists.

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

◆ List() [1/2]

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

◆ List() [2/2]

std::vector< Entry > opendal::Operator::List ( std::string_view  path,
const ListOptions options 
)

◆ operator=() [1/2]

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

◆ operator=() [2/2]

Operator & opendal::Operator::operator= ( Operator &&  other)
noexcept

◆ Read() [1/2]

std::string 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 GetReader method.
Parameters
pathThe path of the data
Returns
The data read from the operator

◆ Read() [2/2]

std::string opendal::Operator::Read ( std::string_view  path,
const ReadOptions options 
)

Read data from the operator with extra options.

Parameters
pathThe path of the data
optionsThe read options
Returns
The data read from the operator

◆ Remove() [1/2]

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

Remove a file or directory.

Parameters
pathThe path of the file or directory

◆ Remove() [2/2]

void opendal::Operator::Remove ( std::string_view  path,
const DeleteOptions options 
)

◆ RemoveAll()

void opendal::Operator::RemoveAll ( const std::vector< std::string > &  paths)

◆ Rename() [1/2]

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

◆ Rename() [2/2]

void opendal::Operator::Rename ( std::string_view  src,
std::string_view  dst,
const RenameOptions options 
)

◆ Stat() [1/2]

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

◆ Stat() [2/2]

Metadata opendal::Operator::Stat ( std::string_view  path,
const StatOptions options 
)

◆ Write() [1/2]

void opendal::Operator::Write ( std::string_view  path,
std::string_view  data 
)

Write data to the operator.

Parameters
pathThe path of the data
dataThe data to write

◆ Write() [2/2]

void opendal::Operator::Write ( std::string_view  path,
std::string_view  data,
const WriteOptions options 
)

Write data to the operator with extra options.

Parameters
pathThe path of the data
dataThe data to write
optionsThe write options

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