This class provides an interface to a file manager. More...
#include "FileMan.hpp"
Public Member Functions | |
virtual | ~FileManI () |
The destructor. More... | |
virtual FileSystemT * | MountFileSystem (FileSystemTypeT Type, const std::string &Descr, const std::string &MountPoint, const std::string &Password="")=0 |
"Mounts" (or "registers") a new file system into the scope of the file manager. More... | |
virtual void | Unmount (FileSystemT *FileSystem)=0 |
"Unmounts" (or "unregisters") a file system from the file manager. More... | |
virtual InFileI * | OpenRead (const std::string &FileName)=0 |
Opens the file with the given name for reading. More... | |
virtual void | Close (FileI *File)=0 |
Closes the given file. More... | |
This class provides an interface to a file manager.
The interface is specified as an ABC in order to be able to share it across exe/dll boundaries.
|
inlinevirtual |
The destructor.
This ABC does neither have nor need a destructor, because no implementation will ever be deleted via a pointer to a FileManI. (The implementations are singletons after all.) See the Singleton pattern and the C++ FAQ 21.05 (the "precise rule") for more information. g++ however issues a warning with no such destructor, so I provide one anyway and am safe.
|
pure virtual |
Closes the given file.
Implemented in cf::FileSys::FileManImplT.
|
pure virtual |
"Mounts" (or "registers") a new file system into the scope of the file manager.
For example, you can register paths on a local hard-disk, compressed archives and HTTP connections as file systems.
Type | The type of the file system to be mounted. |
Descr | A description/specification of the file system to be mounted, for example "Games/DeathMatch/", "MyArchive.zip", etc. |
MountPoint | The mount point of the file system, i.e. the path where the contents of the file system is attached to. |
Password | The password string that might be required to access the specified file system (e.g. encrypted zip archives). |
Implemented in cf::FileSys::FileManImplT.
|
pure virtual |
Opens the file with the given name for reading.
The registered file systems are probed in opposite order in which they have been registered for opening the file.
FileName | The name of the file to be opened within one of the previously registered file systems. |
Implemented in cf::FileSys::FileManImplT.
|
pure virtual |
"Unmounts" (or "unregisters") a file system from the file manager.
FileSystem | The handle to the file system that was obtained by the call to MountFileSystem. |
Implemented in cf::FileSys::FileManImplT.