MySQL 9.3.0
Source Code Documentation
mrs::file_system::DbServiceFileSystem Class Reference

#include <db_service_file_system.h>

Inheritance diagram for mrs::file_system::DbServiceFileSystem:
[legend]

Public Member Functions

 DbServiceFileSystem (endpoint::DbServiceEndpoint *endpoint)
 
std::string parse_uri_path (const std::string &uri) override
 Parses a path from an URI. More...
 
std::string parse_string_path (const std::string &path) override
 Parses a path from a String. More...
 
void check_access (const std::string &path, int64_t flags) override
 Checks existence and accessibility of a file. More...
 
void create_directory (const std::string &path) override
 Creates a directory. More...
 
void remove (const std::string &path) override
 Deletes a file. More...
 
std::shared_ptr< shcore::polyglot::ISeekable_channelnew_byte_channel (const std::string &path) override
 Opens or creates a file returning a SeekableByteChannel to access the file content. More...
 
std::shared_ptr< shcore::polyglot::IDirectory_streamnew_directory_stream (const std::string &path) override
 Returns directory entries. More...
 
std::string to_absolute_path (const std::string &path) override
 Resolves given path to an absolute path. More...
 
std::string to_real_path (const std::string &path) override
 Returns the real (canonical) path of an existing file. More...
 
 ~DbServiceFileSystem () override=default
 
- Public Member Functions inherited from shcore::polyglot::IFile_system
virtual ~IFile_system ()=default
 

Private Member Functions

void traverse_files (std::function< bool(const ContentFilePtr &)> callback)
 
ContentFilePtr lookup_file (const std::string &request_path)
 

Private Attributes

endpoint::DbServiceEndpointm_service_endpoint
 

Constructor & Destructor Documentation

◆ DbServiceFileSystem()

mrs::file_system::DbServiceFileSystem::DbServiceFileSystem ( endpoint::DbServiceEndpoint endpoint)

◆ ~DbServiceFileSystem()

mrs::file_system::DbServiceFileSystem::~DbServiceFileSystem ( )
overridedefault

Member Function Documentation

◆ check_access()

void mrs::file_system::DbServiceFileSystem::check_access ( const std::string &  path,
int64_t  flags 
)
overridevirtual

Checks existence and accessibility of a file.

Parameters
paththe path to the file to check
flagsthe access modes to check, as a binary mask RWX only.
Exceptions
NoSuchFileExceptionif the file denoted by the path does not exist
IOExceptionin case of IO error
SecurityExceptionif this FileSystem denied the operation

Implements shcore::polyglot::IFile_system.

◆ create_directory()

void mrs::file_system::DbServiceFileSystem::create_directory ( const std::string &  path)
overridevirtual

Creates a directory.

param dir the directory to create param attrs the optional attributes to set atomically when creating the directory

Exceptions
FileAlreadyExistsExceptionif a file on given path already exists
IOExceptionin case of IO error
UnsupportedOperationExceptionif the attributes contain an attribute which cannot be set atomically
SecurityExceptionif this FileSystem denied the operation

Implements shcore::polyglot::IFile_system.

◆ lookup_file()

ContentFilePtr mrs::file_system::DbServiceFileSystem::lookup_file ( const std::string &  request_path)
private

◆ new_byte_channel()

std::shared_ptr< shcore::polyglot::ISeekable_channel > mrs::file_system::DbServiceFileSystem::new_byte_channel ( const std::string &  path)
overridevirtual

Opens or creates a file returning a SeekableByteChannel to access the file content.

Parameters
paththe path to the file to open
Returns
the created SeekableByteChannel
Exceptions
FileAlreadyExistsExceptionif CREATE_NEW option is set and a file already exists on given path
IOExceptionin case of IO error
UnsupportedOperationExceptionif the attributes contain an attribute which cannot be set atomically
IllegalArgumentExceptionin case of invalid options combination
SecurityExceptionif this FileSystem denied the operation

Implements shcore::polyglot::IFile_system.

◆ new_directory_stream()

std::shared_ptr< shcore::polyglot::IDirectory_stream > mrs::file_system::DbServiceFileSystem::new_directory_stream ( const std::string &  path)
overridevirtual

Returns directory entries.

param dir the path to the directory to iterate entries for param filter the filter

Returns
the new DirectoryStream
Exceptions
NotDirectoryExceptionwhen given path does not denote a directory
IOExceptionin case of IO error
SecurityExceptionif this FileSystem denied the operation

Implements shcore::polyglot::IFile_system.

◆ parse_string_path()

std::string mrs::file_system::DbServiceFileSystem::parse_string_path ( const std::string &  path)
overridevirtual

Parses a path from a String.

This method is called only on the FileSystem with

Definition: os0file.h:89

scheme.

Parameters
paththe string path to be converted to Path
Returns
the Path
Exceptions
UnsupportedOperationExceptionwhen the FileSystem supports only URI
IllegalArgumentExceptionif the
static char * path
Definition: mysqldump.cc:150
string cannot be converted to a Path

Implements shcore::polyglot::IFile_system.

◆ parse_uri_path()

std::string mrs::file_system::DbServiceFileSystem::parse_uri_path ( const std::string &  uri)
overridevirtual

Parses a path from an URI.

Parameters
urithe URI to be converted to Path
Returns
the Path representing given URI
Exceptions
UnsupportedOperationExceptionwhen URI scheme is not supported
IllegalArgumentExceptionif preconditions on the
uri
do not hold. The format of the URI is FileSystem specific.

Implements shcore::polyglot::IFile_system.

◆ remove()

void mrs::file_system::DbServiceFileSystem::remove ( const std::string &  path)
overridevirtual

Deletes a file.

Parameters
paththe path to the file to delete
Exceptions
NoSuchFileExceptionif a file on given path does not exist
DirectoryNotEmptyExceptionif the path denotes a non empty directory
IOExceptionin case of IO error
SecurityExceptionif this FileSystem denied the operation

Implements shcore::polyglot::IFile_system.

◆ to_absolute_path()

std::string mrs::file_system::DbServiceFileSystem::to_absolute_path ( const std::string &  path)
overridevirtual

Resolves given path to an absolute path.

Parameters
paththe path to resolve, may be a non normalized path
Returns
an absolute Path
Exceptions
SecurityExceptionif this FileSystem denied the operation

Implements shcore::polyglot::IFile_system.

◆ to_real_path()

std::string mrs::file_system::DbServiceFileSystem::to_real_path ( const std::string &  path)
overridevirtual

Returns the real (canonical) path of an existing file.

Parameters
paththe path to resolve, may be a non normalized path param linkOptions options determining how the symbolic links should be handled
Returns
an absolute canonical path
Exceptions
IOExceptionin case of IO error
SecurityExceptionif this FileSystem denied the operation

Implements shcore::polyglot::IFile_system.

◆ traverse_files()

void mrs::file_system::DbServiceFileSystem::traverse_files ( std::function< bool(const ContentFilePtr &)>  callback)
private

Member Data Documentation

◆ m_service_endpoint

endpoint::DbServiceEndpoint* mrs::file_system::DbServiceFileSystem::m_service_endpoint
private

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