CeresEngine 0.2.0
A game development framework
Loading...
Searching...
No Matches
CeresEngine::Win32FileHandle Class Referencefinal

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

#include <CeresEngine/Platform/Win32/Win32FileHandle.hpp>

Inheritance diagram for CeresEngine::Win32FileHandle:
CeresEngine::LocalFileHandle CeresEngine::IFileHandle

Public Member Functions

 Win32FileHandle (Win32FileSystem &fs, StringView path)
 Constructs a new Win32 File Handle.
 
 Win32FileHandle (const Win32FileHandle &other)
 
 ~Win32FileHandle () final
 
void updateFileInfo () final
 Update file information.
 
Int64 getAccessTime () const final
 Gets the time of last access.
 
Int64 getModificationTime () const final
 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
 

Private Types

using super = LocalFileHandle
 

Private Attributes

UPtr< void, void(*)(void *)> mFileInfo
 Information about the current file (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 on Windows.

Member Typedef Documentation

◆ super

Constructor & Destructor Documentation

◆ Win32FileHandle() [1/2]

CeresEngine::Win32FileHandle::Win32FileHandle ( Win32FileSystem fs,
StringView  path 
)

Constructs a new Win32 File Handle.

Parameters
fsThe file system that created this handle.
pathThe path to file or directory.

◆ Win32FileHandle() [2/2]

CeresEngine::Win32FileHandle::Win32FileHandle ( const Win32FileHandle other)

◆ ~Win32FileHandle()

CeresEngine::Win32FileHandle::~Win32FileHandle ( )
final

Member Function Documentation

◆ getAccessTime()

Int64 CeresEngine::Win32FileHandle::getAccessTime ( ) const
finalvirtual

Gets the time of last access.

Reimplemented from CeresEngine::LocalFileHandle.

◆ getModificationTime()

Int64 CeresEngine::Win32FileHandle::getModificationTime ( ) const
finalvirtual

Gets time of last modification.

Reimplemented from CeresEngine::LocalFileHandle.

◆ readFileInfo()

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

◆ updateFileInfo()

void CeresEngine::Win32FileHandle::updateFileInfo ( )
finalvirtual

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

UPtr<void, void (*)(void*)> CeresEngine::Win32FileHandle::mFileInfo
mutableprivate

Information about the current file (created on demand)


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