MySQL 9.3.0
Source Code Documentation
shcore::polyglot::IFile_system Class Referenceabstract

#include <polyglot_file_system.h>

Inheritance diagram for shcore::polyglot::IFile_system:
[legend]

Public Member Functions

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

Constructor & Destructor Documentation

◆ ~IFile_system()

virtual shcore::polyglot::IFile_system::~IFile_system ( )
virtualdefault

Member Function Documentation

◆ check_access()

virtual void shcore::polyglot::IFile_system::check_access ( const std::string &  path,
int64_t  flags 
)
pure virtual

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

Implemented in mrs::file_system::DbServiceFileSystem.

◆ create_directory()

virtual void shcore::polyglot::IFile_system::create_directory ( const std::string &  path)
pure virtual

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

Implemented in mrs::file_system::DbServiceFileSystem.

◆ new_byte_channel()

virtual std::shared_ptr< ISeekable_channel > shcore::polyglot::IFile_system::new_byte_channel ( const std::string &  path)
pure virtual

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

Implemented in mrs::file_system::DbServiceFileSystem.

◆ new_directory_stream()

virtual std::shared_ptr< IDirectory_stream > shcore::polyglot::IFile_system::new_directory_stream ( const std::string &  path)
pure virtual

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

Implemented in mrs::file_system::DbServiceFileSystem.

◆ parse_string_path()

virtual std::string shcore::polyglot::IFile_system::parse_string_path ( const std::string &  path)
pure virtual

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

Implemented in mrs::file_system::DbServiceFileSystem.

◆ parse_uri_path()

virtual std::string shcore::polyglot::IFile_system::parse_uri_path ( const std::string &  uri)
pure virtual

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.

Implemented in mrs::file_system::DbServiceFileSystem.

◆ remove()

virtual void shcore::polyglot::IFile_system::remove ( const std::string &  path)
pure virtual

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

Implemented in mrs::file_system::DbServiceFileSystem.

◆ to_absolute_path()

virtual std::string shcore::polyglot::IFile_system::to_absolute_path ( const std::string &  path)
pure virtual

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

Implemented in mrs::file_system::DbServiceFileSystem.

◆ to_real_path()

virtual std::string shcore::polyglot::IFile_system::to_real_path ( const std::string &  path)
pure virtual

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

Implemented in mrs::file_system::DbServiceFileSystem.


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