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

An implementation of a local file system. More...

#include <CeresEngine/Platform/Generic/LocalFileSystem.hpp>

Inheritance diagram for CeresEngine::LocalFileSystem:
CeresEngine::IFileSystem CeresEngine::RefCounted< IFileSystem > CeresEngine::POSIXFileSystem CeresEngine::Win32FileSystem CeresEngine::AppleFileSystem CeresEngine::LinuxFileSystem

Public Member Functions

 LocalFileSystem ()
 
virtual ~LocalFileSystem ()
 
FileHandle open (StringView path) override
 Opens a file or directory in file system.
 
FileHandle open (String &&path) override
 Opens a file or directory in file system.
 
FileWatcher createFileWatcher (ExecutionContext &executionContext, const FileHandle &directory, const FileEvents &events=FileEvent::Default, bool recursive=true) override
 Watches a directory for changes.
 
- Public Member Functions inherited from CeresEngine::IFileSystem
 IFileSystem ()
 
virtual ~IFileSystem ()
 
FileHandle open (const char *path)
 Opens a file or directory in file system.
 
- Public Member Functions inherited from CeresEngine::RefCounted< IFileSystem >
 RefCounted (Args &&... args)
 Creates a new RefCounted object and constructs a new Deleter by forwarding Args to it.
 
void retain () noexcept
 Retains the object by increment it's reference count by one.
 
bool release () noexcept
 Relases the object by decrementing it's reference count by one.
 

Additional Inherited Members

- Static Public Member Functions inherited from CeresEngine::IFileSystem
static IFileSystemgetLocal () noexcept
 Gets the underlying platform local file system implementation.
 

Detailed Description

An implementation of a local file system.

Constructor & Destructor Documentation

◆ LocalFileSystem()

CeresEngine::LocalFileSystem::LocalFileSystem ( )

◆ ~LocalFileSystem()

virtual CeresEngine::LocalFileSystem::~LocalFileSystem ( )
virtual

Member Function Documentation

◆ createFileWatcher()

FileWatcher CeresEngine::LocalFileSystem::createFileWatcher ( ExecutionContext executionContext,
const FileHandle directory,
const FileEvents events = FileEvent::Default,
bool  recursive = true 
)
overridevirtual

Watches a directory for changes.

Note
The file handle must belong to the same file system as the file watcher, otherwise it will be ignored. Therefore, one file watcher object can only be used to watch files on a single file system. Also note that file watching may not supported for some file systems.
Parameters
executionContextThe execution context where the callbacks will be called from.
directoryA handle to directory that shall be watched.
eventsThe events that are watched (combination of FileEvent values).
recursiveDetermines whether the directory will be recursively watched.

Implements CeresEngine::IFileSystem.

Reimplemented in CeresEngine::Win32FileSystem.

◆ open() [1/2]

FileHandle CeresEngine::LocalFileSystem::open ( String &&  path)
overridevirtual

Opens a file or directory in file system.

Parameters
pathThe path to file or directory

Implements CeresEngine::IFileSystem.

Reimplemented in CeresEngine::Win32FileSystem, and CeresEngine::POSIXFileSystem.

◆ open() [2/2]

FileHandle CeresEngine::LocalFileSystem::open ( StringView  path)
overridevirtual

Opens a file or directory in file system.

Parameters
pathThe path to file or directory

Implements CeresEngine::IFileSystem.

Reimplemented in CeresEngine::Win32FileSystem, and CeresEngine::POSIXFileSystem.


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