|
CeresEngine 0.2.0
A game development framework
|
Base interface for file handles implementation. More...
#include <CeresEngine/Foundation/IO/FileHandle.hpp>
Public Member Functions | |
| IFileHandle ()=default | |
| virtual | ~IFileHandle ()=default |
| virtual IFileSystem * | getFileSystem () const =0 |
Gets the backing IFileSystem for the handle. | |
| virtual void | updateFileInfo ()=0 |
| Update file information. | |
| virtual StringView | getPath () const =0 |
| virtual bool | exists () const =0 |
| Checks if the file exists on the file system. | |
| virtual bool | isFile () const =0 |
| Checks if item is a file. | |
| virtual bool | isDirectory () const =0 |
| Checks if item is a directory. | |
| virtual bool | isSymbolicLink () const =0 |
| Checks if item is a symbolic link. | |
| virtual FileIterator | begin () const =0 |
| Gets an iterator that points to the first directory entry. | |
| virtual UInt64 | getSize () const =0 |
| Gets the file size. | |
| virtual Int64 | getAccessTime () const =0 |
| Gets the time of last access. | |
| virtual Int64 | getModificationTime () const =0 |
| Gets time of last modification. | |
| virtual bool | createDirectory ()=0 |
| Creates a new directory. | |
| virtual bool | removeDirectory ()=0 |
| Removes a directory. | |
| virtual bool | copy (IFileHandle &dest)=0 |
| Copies a file. | |
| virtual bool | move (IFileHandle &dest)=0 |
| Moves a file. | |
| virtual bool | createLink (IFileHandle &dest)=0 |
| Creates a hard link. | |
| virtual bool | createSymbolicLink (IFileHandle &dest)=0 |
| Creates a symbolic link. | |
| virtual bool | rename (StringView filename)=0 |
| Renames a file or directory. | |
| virtual bool | remove ()=0 |
| Removes a file. | |
| virtual InputStream | createInputStream (std::ios_base::openmode mode) const =0 |
| Creates an input stream to read from the file. | |
| virtual OutputStream | createOutputStream (std::ios_base::openmode mode)=0 |
| Creates an output stream to write to the file. | |
Base interface for file handles implementation.
|
default |
|
virtualdefault |
|
pure virtual |
Gets an iterator that points to the first directory entry.
Implemented in CeresEngine::LocalFileHandle.
|
pure virtual |
Copies a file.
| dest | The destination file or directory. |
true if successful, else false. Implemented in CeresEngine::LocalFileHandle.
Creates a new directory.
true if successful, else false. Implemented in CeresEngine::LocalFileHandle.
|
pure virtual |
Creates an input stream to read from the file.
nullptr if opening the stream failed. Implemented in CeresEngine::LocalFileHandle.
|
pure virtual |
Creates a hard link.
| dest | The destination file or directory. |
true if successful, else false. Implemented in CeresEngine::LocalFileHandle.
|
pure virtual |
Creates an output stream to write to the file.
nullptr if opening the stream failed. Implemented in CeresEngine::LocalFileHandle.
|
pure virtual |
Creates a symbolic link.
| dest | The destination file or directory. |
true if successful, else false. Implemented in CeresEngine::LocalFileHandle.
Checks if the file exists on the file system.
true if it exists, else false. Implemented in CeresEngine::LocalFileHandle.
Gets the time of last access.
Implemented in CeresEngine::Win32FileHandle, CeresEngine::LocalFileHandle, and CeresEngine::POSIXFileHandle.
|
pure virtual |
Gets the backing IFileSystem for the handle.
Can be nullptr if the handle is empty.
Implemented in CeresEngine::LocalFileHandle.
Gets time of last modification.
Implemented in CeresEngine::Win32FileHandle, CeresEngine::LocalFileHandle, and CeresEngine::POSIXFileHandle.
|
pure virtual |
Implemented in CeresEngine::LocalFileHandle.
Gets the file size.
Implemented in CeresEngine::LocalFileHandle.
Checks if item is a directory.
true if it is a directory, else false. Implemented in CeresEngine::LocalFileHandle.
Checks if item is a file.
true if it is a file, else false. Implemented in CeresEngine::LocalFileHandle.
Checks if item is a symbolic link.
true if it is a symbolic link, else false. Implemented in CeresEngine::LocalFileHandle.
|
pure virtual |
Moves a file.
| dest | The destination file or directory. |
true if successful, else false. Implemented in CeresEngine::LocalFileHandle.
Removes a file.
true if successful, else false.Implemented in CeresEngine::LocalFileHandle.
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. Implemented in CeresEngine::LocalFileHandle.
|
pure virtual |
Renames a file or directory.
| filename | The new file name to rename the file to. |
true if successful, else false. Implemented in CeresEngine::LocalFileHandle.
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.
Implemented in CeresEngine::Win32FileHandle, CeresEngine::LocalFileHandle, and CeresEngine::POSIXFileHandle.