|
CeresEngine 0.2.0
A game development framework
|
File handle for the local file system. More...
#include <CeresEngine/Platform/Generic/LocalFileHandle.hpp>
Public Member Functions | |
| LocalFileHandle (LocalFileSystem &fileSystem, StringView path) | |
| LocalFileHandle (LocalFileSystem &fileSystem, String &&path) | |
| ~LocalFileHandle () override | |
| IFileSystem * | getFileSystem () const override |
Gets the backing IFileSystem for the handle. | |
| void | updateFileInfo () override |
| Update file information. | |
| StringView | getPath () const override |
| bool | exists () const override |
| Checks if the file exists on the file system. | |
| bool | isFile () const override |
| Checks if item is a file. | |
| bool | isDirectory () const override |
| Checks if item is a directory. | |
| bool | isSymbolicLink () const override |
| Checks if item is a symbolic link. | |
| FileIterator | begin () const override |
| Gets an iterator that points to the first directory entry. | |
| UInt64 | getSize () const override |
| Gets the file size. | |
| Int64 | getAccessTime () const override |
| Gets the time of last access. | |
| Int64 | getModificationTime () const override |
| Gets time of last modification. | |
| bool | createDirectory () override |
| Creates a new directory. | |
| bool | removeDirectory () override |
| Removes a directory. | |
| bool | copy (IFileHandle &dest) override |
| Copies a file. | |
| bool | move (IFileHandle &dest) override |
| Moves a file. | |
| bool | createLink (IFileHandle &dest) override |
| Creates a hard link. | |
| bool | createSymbolicLink (IFileHandle &dest) override |
| Creates a symbolic link. | |
| bool | rename (StringView filename) override |
| Renames a file or directory. | |
| bool | remove () override |
| Removes a file. | |
| InputStream | createInputStream (std::ios_base::openmode mode) const override |
| Creates an input stream to read from the file. | |
| OutputStream | createOutputStream (std::ios_base::openmode mode) override |
| Creates an output stream to write to the file. | |
Public Member Functions inherited from CeresEngine::IFileHandle | |
| IFileHandle ()=default | |
| virtual | ~IFileHandle ()=default |
Protected Attributes | |
| RC< LocalFileSystem > | mFileSystem |
| The file system that created this handle. | |
| FilePath | mPath |
| Path to file or directory. | |
| std::filesystem::path | mFileSystemPath |
Same as mPath, but in the C++17 std::filesystem format. | |
File handle for the local file system.
| CeresEngine::LocalFileHandle::LocalFileHandle | ( | LocalFileSystem & | fileSystem, |
| StringView | path | ||
| ) |
| CeresEngine::LocalFileHandle::LocalFileHandle | ( | LocalFileSystem & | fileSystem, |
| String && | path | ||
| ) |
|
override |
|
overridevirtual |
Gets an iterator that points to the first directory entry.
Implements CeresEngine::IFileHandle.
|
overridevirtual |
Copies a file.
| dest | The destination file or directory. |
true if successful, else false. Implements CeresEngine::IFileHandle.
|
overridevirtual |
Creates a new directory.
true if successful, else false. Implements CeresEngine::IFileHandle.
|
overridevirtual |
Creates an input stream to read from the file.
nullptr if opening the stream failed. Implements CeresEngine::IFileHandle.
|
overridevirtual |
Creates a hard link.
| dest | The destination file or directory. |
true if successful, else false. Implements CeresEngine::IFileHandle.
|
overridevirtual |
Creates an output stream to write to the file.
nullptr if opening the stream failed. Implements CeresEngine::IFileHandle.
|
overridevirtual |
Creates a symbolic link.
| dest | The destination file or directory. |
true if successful, else false. Implements CeresEngine::IFileHandle.
|
overridevirtual |
Checks if the file exists on the file system.
true if it exists, else false. Implements CeresEngine::IFileHandle.
|
overridevirtual |
Gets the time of last access.
Implements CeresEngine::IFileHandle.
Reimplemented in CeresEngine::Win32FileHandle, and CeresEngine::POSIXFileHandle.
|
overridevirtual |
Gets the backing IFileSystem for the handle.
Can be nullptr if the handle is empty.
Implements CeresEngine::IFileHandle.
|
overridevirtual |
Gets time of last modification.
Implements CeresEngine::IFileHandle.
Reimplemented in CeresEngine::Win32FileHandle, and CeresEngine::POSIXFileHandle.
|
overridevirtual |
Implements CeresEngine::IFileHandle.
|
overridevirtual |
Gets the file size.
Implements CeresEngine::IFileHandle.
|
overridevirtual |
Checks if item is a directory.
true if it is a directory, else false. Implements CeresEngine::IFileHandle.
|
overridevirtual |
Checks if item is a file.
true if it is a file, else false. Implements CeresEngine::IFileHandle.
|
overridevirtual |
Checks if item is a symbolic link.
true if it is a symbolic link, else false. Implements CeresEngine::IFileHandle.
|
overridevirtual |
Moves a file.
| dest | The destination file or directory. |
true if successful, else false. Implements CeresEngine::IFileHandle.
|
overridevirtual |
Removes a file.
true if successful, else false.Implements CeresEngine::IFileHandle.
|
overridevirtual |
Removes a directory.
true if successful, else false. RemoveDirectoryFlag::Recursive is not set, the call will only succeed if the directory exists and is empty. Implements CeresEngine::IFileHandle.
|
overridevirtual |
Renames a file or directory.
| filename | The new file name to rename the file to. |
true if successful, else false. Implements CeresEngine::IFileHandle.
|
overridevirtual |
Update file information.
Must reload and update the file information. It will for example be called after a file has been created, copied, or removed to ensure that the file information returned by the handle is correct.
Implements CeresEngine::IFileHandle.
Reimplemented in CeresEngine::Win32FileHandle, and CeresEngine::POSIXFileHandle.
|
protected |
The file system that created this handle.
|
protected |
Same as mPath, but in the C++17 std::filesystem format.
|
protected |
Path to file or directory.