|
GREM 3.12.0
Game/Rendering Engine Modules for C++
|
Base interface for a filesystem. More...
#include <GREM/core/system/Filesystem.hpp>

Public Member Functions | |
| constexpr | Filesystem () noexcept=default |
| Default constructor. | |
| virtual | ~Filesystem ()=default |
| Virtual destructor. | |
| constexpr | Filesystem (const Filesystem &)=default |
| Copy constructor. | |
| constexpr | Filesystem (Filesystem &&) noexcept=default |
| Move constructor. | |
| Filesystem & | operator= (const Filesystem &)=default |
| Copy assignment. | |
| Filesystem & | operator= (Filesystem &&) noexcept=default |
| Move assignment. | |
| virtual CStringView | getOutputDirectory () const noexcept=0 |
| Get the current output directory of the filesystem. | |
| virtual CStringView | findInputArchiveOfFile (CStringView filepath) const noexcept=0 |
| Get the host filepath of the mounted input archive on the host filesystem that contains a given virtual file. | |
| virtual void | createOutputDirectory (CStringView filepath)=0 |
| Create a new host directory relative to the current output directory, while also creating any missing parent directories along the way as needed. | |
| virtual void | createParentOutputDirectories (CStringView filepath)=0 |
| Create any missing parent directories above a host directory relative to the current output directory. | |
| virtual void | deleteOutputFile (CStringView filepath)=0 |
| Delete a host file or directory relative to the current output directory. | |
| virtual bool | inputFileExists (CStringView filepath) const =0 |
| Check if a given virtual filepath has a corresponding host file mounted. | |
| virtual File::Metadata | getFileMetadata (CStringView filepath) const =0 |
| Get the metadata of a file that is mounted at a given virtual filepath. | |
| virtual void | forEachInputFilenameInDirectory (CStringView filepath, FunctionView< bool(CStringView filename)> callback) const =0 |
| Iterate the filenames of all readable virtual filepaths that are direct children of a given directory. | |
| void | forEachInputFilenameInDirectory (CStringView filepath, auto callback) const |
| Iterate the filenames of all readable virtual filepaths that are direct children of a given directory. | |
| virtual InputFileHandle | openInputFile (CStringView filepath) const =0 |
| Open an input file in the virtual filesystem for reading. | |
| virtual InputFileHandle | tryOpenInputFile (CStringView filepath) const =0 |
| Try to open an input file in the virtual filesystem for reading. | |
| Allocation< byte > | readInputFile (CStringView filepath) const |
| Open an input file in the virtual filesystem for reading and read its full contents into an array of bytes. | |
| Optional< Allocation< byte > > | tryReadInputFile (CStringView filepath) const |
| Try to open an input file in the virtual filesystem for reading and read its full contents into an array of bytes. | |
| ArrayList< byte > | readInputFileArrayList (CStringView filepath) const |
| Open an input file in the virtual filesystem for reading and read its full contents into an array list of bytes. | |
| Optional< ArrayList< byte > > | tryReadInputFileArrayList (CStringView filepath) const |
| Try to open an input file in the virtual filesystem for reading and read its full contents into an array list of bytes. | |
| Buffer< byte > | readInputFileBuffer (CStringView filepath) const |
| Open an input file in the virtual filesystem for reading and read its full contents into a buffer of bytes. | |
| Optional< Buffer< byte > > | tryReadInputFileBuffer (CStringView filepath) const |
| Try to open an input file in the virtual filesystem for reading and read its full contents into a buffer of bytes. | |
| String | readInputFileString (CStringView filepath) const |
| Open an input file in the virtual filesystem for reading and read its full contents into a string of bytes. | |
| Optional< String > | tryReadInputFileString (CStringView filepath) const |
| Try to open an input file in the virtual filesystem for reading and read its full contents into a string of bytes. | |
| Allocation< char > | readInputFileCString (CStringView filepath) const |
| Open an input file in the virtual filesystem for reading and read its full contents into an allocated null-terminated string of bytes. | |
| Allocation< char > | tryReadInputFileCString (CStringView filepath) const |
| Try to open an input file in the virtual filesystem for reading and read its full contents into an allocated null-terminated string of bytes. | |
| virtual OutputFileHandle | openEmptyOutputFile (CStringView filepath)=0 |
| Create a file relative to the current output directory and open it for writing, overwriting any existing file at the same filepath. | |
| virtual void | createEmptyOutputFile (CStringView filepath)=0 |
| Create an empty file relative to the current output directory, overwriting any existing file at the same filepath. | |
| virtual OutputFileHandle | openOutputFileForAppending (CStringView filepath)=0 |
| Open a file relative to the current output directory for appended writing, or create an empty file and open it if one didn't already exist. | |
Base interface for a filesystem.
|
constexprdefaultnoexcept |
Default constructor.
|
virtualdefault |
Virtual destructor.
|
constexprdefault |
Copy constructor.
|
constexprdefaultnoexcept |
Move constructor.
|
default |
Copy assignment.
|
defaultnoexcept |
Move assignment.
|
nodiscardpure virtualnoexcept |
Get the current output directory of the filesystem.
Implemented in grem::application::VirtualFilesystem, and grem::NativeFilesystem.
|
nodiscardpure virtualnoexcept |
Get the host filepath of the mounted input archive on the host filesystem that contains a given virtual file.
| filepath | virtual filepath of the file to get the archive of. |
Implemented in grem::application::VirtualFilesystem, and grem::NativeFilesystem.
|
pure virtual |
Create a new host directory relative to the current output directory, while also creating any missing parent directories along the way as needed.
| filepath | virtual filepath, relative to the current output directory, of the new directory to be created. |
| File::Error | on failure to create the directories. |
| std::bad_alloc | on allocation failure. |
Implemented in grem::application::VirtualFilesystem, and grem::NativeFilesystem.
|
pure virtual |
Create any missing parent directories above a host directory relative to the current output directory.
| filepath | virtual filepath, relative to the current output directory, of the directory whose missing parent directories to create. |
| File::Error | on failure to create the directories. |
| std::bad_alloc | on allocation failure. |
Implemented in grem::application::VirtualFilesystem, and grem::NativeFilesystem.
|
pure virtual |
Delete a host file or directory relative to the current output directory.
| filepath | virtual filepath, relative to the current output directory, of the file or directory to delete. |
| File::Error | on failure to delete the given file or directory. |
| std::bad_alloc | on allocation failure. |
Implemented in grem::application::VirtualFilesystem, and grem::NativeFilesystem.
|
nodiscardpure virtual |
Check if a given virtual filepath has a corresponding host file mounted.
| filepath | virtual filepath to check for a mounted file. |
Implemented in grem::application::VirtualFilesystem, and grem::NativeFilesystem.
|
nodiscardpure virtual |
Get the metadata of a file that is mounted at a given virtual filepath.
| filepath | virtual filepath of the file to get the metadata of. |
| File::Error | on failure to get the metadata, such as if no file is mounted at the given filepath. |
| std::bad_alloc | on allocation failure. |
Implemented in grem::application::VirtualFilesystem, and grem::NativeFilesystem.
|
pure virtual |
Iterate the filenames of all readable virtual filepaths that are direct children of a given directory.
| filepath | virtual filepath of the input directory to enumerate. |
| callback | function to execute for each file, which should accept the current filename as a parameter and return a bool that specifies whether to stop the traversal or not. A value of true means to stop and return early, while a value of false means to continue traversing. |
| File::Error | on failure to enumerate the directory. |
| std::length_error | if an internal size limit was exceeded. |
| std::bad_array_new_length | if an internal size limit was exceeded. |
| std::bad_alloc | on allocation failure. |
| any | exception thrown by the callback function. |
Implemented in grem::application::VirtualFilesystem, and grem::NativeFilesystem.
|
inline |
Iterate the filenames of all readable virtual filepaths that are direct children of a given directory.
| filepath | virtual filepath of the input directory to enumerate. |
| callback | function to execute for each file, which should accept the current filename as a parameter. |
| File::Error | on failure to enumerate the directory. |
| std::length_error | if an internal size limit was exceeded. |
| std::bad_array_new_length | if an internal size limit was exceeded. |
| std::bad_alloc | on allocation failure. |
| any | exception thrown by the callback function. |
|
nodiscardpure virtual |
Open an input file in the virtual filesystem for reading.
| filepath | virtual filepath of the mounted input file to open. |
| File::Error | on failure to open the file for reading. |
| std::bad_alloc | on allocation failure. |
Implemented in grem::application::VirtualFilesystem, and grem::NativeFilesystem.
|
nodiscardpure virtual |
Try to open an input file in the virtual filesystem for reading.
| filepath | virtual filepath of the mounted input file to open. |
| std::bad_alloc | on allocation failure. |
Implemented in grem::application::VirtualFilesystem, and grem::NativeFilesystem.
|
inlinenodiscard |
Open an input file in the virtual filesystem for reading and read its full contents into an array of bytes.
| filepath | virtual filepath of the mounted input file to read. |
| File::Error | on failure to open the file for reading or read the file contents. |
| std::length_error | if the maximum file size was exceeded. |
| std::bad_alloc | on allocation failure. |
|
inlinenodiscard |
Try to open an input file in the virtual filesystem for reading and read its full contents into an array of bytes.
| filepath | virtual filepath of the mounted input file to read. |
| File::Error | on failure to read the opened file's contents. |
| std::length_error | if the maximum file size was exceeded. |
| std::bad_alloc | on allocation failure. |
|
inlinenodiscard |
Open an input file in the virtual filesystem for reading and read its full contents into an array list of bytes.
| filepath | virtual filepath of the mounted input file to read. |
| File::Error | on failure to open the file for reading or read the file contents. |
| std::length_error | if the maximum file size was exceeded. |
| std::bad_alloc | on allocation failure. |
|
inlinenodiscard |
Try to open an input file in the virtual filesystem for reading and read its full contents into an array list of bytes.
| filepath | virtual filepath of the mounted input file to read. |
| File::Error | on failure to read the opened file's contents. |
| std::length_error | if the maximum file size was exceeded. |
| std::bad_alloc | on allocation failure. |
|
inlinenodiscard |
Open an input file in the virtual filesystem for reading and read its full contents into a buffer of bytes.
| filepath | virtual filepath of the mounted input file to read. |
| File::Error | on failure to open the file for reading or read the file contents. |
| std::length_error | if the maximum file size was exceeded. |
| std::bad_alloc | on allocation failure. |
|
inlinenodiscard |
Try to open an input file in the virtual filesystem for reading and read its full contents into a buffer of bytes.
| filepath | virtual filepath of the mounted input file to read. |
| File::Error | on failure to read the opened file's contents. |
| std::length_error | if the maximum file size was exceeded. |
| std::bad_alloc | on allocation failure. |
|
inlinenodiscard |
Open an input file in the virtual filesystem for reading and read its full contents into a string of bytes.
| filepath | virtual filepath of the mounted input file to read. |
| File::Error | on failure to open the file for reading or read the file contents. |
| std::length_error | if the maximum file size was exceeded. |
| std::bad_alloc | on allocation failure. |
|
inlinenodiscard |
Try to open an input file in the virtual filesystem for reading and read its full contents into a string of bytes.
| filepath | virtual filepath of the mounted input file to read. |
| File::Error | on failure to read the opened file's contents. |
| std::length_error | if the maximum file size was exceeded. |
| std::bad_alloc | on allocation failure. |
|
inlinenodiscard |
Open an input file in the virtual filesystem for reading and read its full contents into an allocated null-terminated string of bytes.
| filepath | virtual filepath of the mounted input file to read. |
| File::Error | on failure to open the file for reading or read the file contents. |
| std::length_error | if the maximum file size was exceeded. |
| std::bad_alloc | on allocation failure. |
|
inlinenodiscard |
Try to open an input file in the virtual filesystem for reading and read its full contents into an allocated null-terminated string of bytes.
| filepath | virtual filepath of the mounted input file to read. |
| File::Error | on failure to read the opened file's contents. |
| std::length_error | if the maximum file size was exceeded. |
| std::bad_alloc | on allocation failure. |
|
nodiscardpure virtual |
Create a file relative to the current output directory and open it for writing, overwriting any existing file at the same filepath.
| filepath | virtual filepath of the new file to be created, relative to the current output directory. |
| File::Error | on failure to delete the existing file, create the new file, or open the new file for writing. |
| std::bad_alloc | on allocation failure. |
Implemented in grem::application::VirtualFilesystem, and grem::NativeFilesystem.
|
pure virtual |
Create an empty file relative to the current output directory, overwriting any existing file at the same filepath.
| filepath | virtual filepath of the new file to be created, relative to the current output directory. |
| File::Error | on failure to delete the existing file or create the new file. |
| std::bad_alloc | on allocation failure. |
Implemented in grem::application::VirtualFilesystem, and grem::NativeFilesystem.
|
nodiscardpure virtual |
Open a file relative to the current output directory for appended writing, or create an empty file and open it if one didn't already exist.
| filepath | virtual filepath of the file to be opened, relative to the current output directory. |
| File::Error | on failure to open the file for writing. |
| std::bad_alloc | on allocation failure. |
Implemented in grem::application::VirtualFilesystem, and grem::NativeFilesystem.