Provides an ability to operator files on a virtual file system defined by the user.
More...
#include <virtual_fs_operator.hpp>
|
template<typename T >
requires (!std::same_as<std::decay_t<T>, virtual_fs_operator>) |
| virtual_fs_operator (T &&value) |
|
bool | exists (std::string_view path) const |
| Checks whether a file exists.
|
|
bool | is_file (std::string_view path) const |
| Checks whether a path names a regular file.
|
|
bool | is_directory (std::string_view path) const |
| Checks whether a path names a directory.
|
|
std::unique_ptr< std::iostream > | open (std::string_view path, std::ios_base::openmode mode=std::ios_base::in|std::ios_base::out) const |
| Opens a file in read-write mode.
|
|
std::unique_ptr< std::istream > | open_read (std::string_view path, std::ios_base::openmode mode=std::ios_base::in) const |
| Opens a file in read-only mode.
|
|
std::unique_ptr< std::ostream > | open_write (std::string_view path, std::ios_base::openmode mode=std::ios_base::out) const |
| Opens a file in write-only mode.
|
|
Provides an ability to operator files on a virtual file system defined by the user.
◆ exists()
bool essence::io::abstract::virtual_fs_operator::exists |
( |
std::string_view | path | ) |
const |
|
inlinenodiscard |
Checks whether a file exists.
- Parameters
-
path | The path of the file. |
- Returns
- True if the file exists; otherwise false.
◆ is_directory()
bool essence::io::abstract::virtual_fs_operator::is_directory |
( |
std::string_view | path | ) |
const |
|
inlinenodiscard |
Checks whether a path names a directory.
- Parameters
-
- Returns
- True if the path names a directory; otherwise false.
◆ is_file()
bool essence::io::abstract::virtual_fs_operator::is_file |
( |
std::string_view | path | ) |
const |
|
inlinenodiscard |
Checks whether a path names a regular file.
- Parameters
-
- Returns
- True if the path names a regular file; otherwise false.
◆ open()
std::unique_ptr< std::iostream > essence::io::abstract::virtual_fs_operator::open |
( |
std::string_view | path, |
|
|
std::ios_base::openmode | mode = std::ios_base::in | std::ios_base::out ) const |
|
inlinenodiscard |
Opens a file in read-write mode.
- Parameters
-
path | The path of the file. |
mode | The open mode. |
- Returns
- A std::iostream to read or write the file.
◆ open_read()
std::unique_ptr< std::istream > essence::io::abstract::virtual_fs_operator::open_read |
( |
std::string_view | path, |
|
|
std::ios_base::openmode | mode = std::ios_base::in ) const |
|
inlinenodiscard |
Opens a file in read-only mode.
- Parameters
-
path | The path of the file. |
mode | The open mode. |
- Returns
- A std::istream to read the file.
◆ open_write()
std::unique_ptr< std::ostream > essence::io::abstract::virtual_fs_operator::open_write |
( |
std::string_view | path, |
|
|
std::ios_base::openmode | mode = std::ios_base::out ) const |
|
inlinenodiscard |
Opens a file in write-only mode.
- Parameters
-
path | The path of the file. |
mode | The open mode. |
- Returns
- A std::istream to write the file.
The documentation for this class was generated from the following file: