CeresEngine 0.2.0
A game development framework
Loading...
Searching...
No Matches
CeresEngine::POSIXFileHandle Class Reference

File handle for the local file system. More...

#include <CeresEngine/Platform/POSIX/POSIXFileHandle.hpp>

Inheritance diagram for CeresEngine::POSIXFileHandle:
CeresEngine::LocalFileHandle CeresEngine::IFileHandle

Public Member Functions

 POSIXFileHandle (POSIXFileSystem &fileSystem, StringView path)
 
 POSIXFileHandle (POSIXFileSystem &fileSystem, String &&path)
 
 ~POSIXFileHandle () override
 
void updateFileInfo () override
 Update file information.
 
Int64 getAccessTime () const override
 Gets the time of last access.
 
Int64 getModificationTime () const override
 Gets time of last modification.
 
- Public Member Functions inherited from CeresEngine::LocalFileHandle
 LocalFileHandle (LocalFileSystem &fileSystem, StringView path)
 
 LocalFileHandle (LocalFileSystem &fileSystem, String &&path)
 
 ~LocalFileHandle () override
 
IFileSystemgetFileSystem () const override
 Gets the backing IFileSystem for the handle.
 
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.
 
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 Member Functions

void readFileInfo () const
 
void readLinkInfo () const
 

Private Types

using super = LocalFileHandle
 

Private Attributes

voidmFileInfo
 Information about the current file (resolves links, created on demand)
 
voidmLinkInfo
 Information about the current file (does not resolve links, created on demand)
 

Additional Inherited Members

- Protected Attributes inherited from CeresEngine::LocalFileHandle
RC< LocalFileSystemmFileSystem
 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.
 

Detailed Description

File handle for the local file system.

Member Typedef Documentation

◆ super

Constructor & Destructor Documentation

◆ POSIXFileHandle() [1/2]

CeresEngine::POSIXFileHandle::POSIXFileHandle ( POSIXFileSystem fileSystem,
StringView  path 
)

◆ POSIXFileHandle() [2/2]

CeresEngine::POSIXFileHandle::POSIXFileHandle ( POSIXFileSystem fileSystem,
String &&  path 
)

◆ ~POSIXFileHandle()

CeresEngine::POSIXFileHandle::~POSIXFileHandle ( )
override

Member Function Documentation

◆ getAccessTime()

Int64 CeresEngine::POSIXFileHandle::getAccessTime ( ) const
overridevirtual

Gets the time of last access.

Reimplemented from CeresEngine::LocalFileHandle.

◆ getModificationTime()

Int64 CeresEngine::POSIXFileHandle::getModificationTime ( ) const
overridevirtual

Gets time of last modification.

Reimplemented from CeresEngine::LocalFileHandle.

◆ readFileInfo()

void CeresEngine::POSIXFileHandle::readFileInfo ( ) const
protected

◆ readLinkInfo()

void CeresEngine::POSIXFileHandle::readLinkInfo ( ) const
protected

◆ updateFileInfo()

void CeresEngine::POSIXFileHandle::updateFileInfo ( )
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.

Reimplemented from CeresEngine::LocalFileHandle.

Member Data Documentation

◆ mFileInfo

void* CeresEngine::POSIXFileHandle::mFileInfo
mutableprivate

Information about the current file (resolves links, created on demand)

◆ mLinkInfo

void* CeresEngine::POSIXFileHandle::mLinkInfo
mutableprivate

Information about the current file (does not resolve links, created on demand)


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