Cafu Engine
cf::FileSys::FileManImplT Class Reference

This class implements the FileManI interface. More...

#include "FileManImpl.hpp"

Inheritance diagram for cf::FileSys::FileManImplT:

Public Member Functions

 FileManImplT ()
 The constructor. More...
 
 ~FileManImplT ()
 The destructor. More...
 
FileSystemTMountFileSystem (FileSystemTypeT Type, const std::string &Descr, const std::string &MountPoint, const std::string &Password="")
 "Mounts" (or "registers") a new file system into the scope of the file manager. More...
 
void Unmount (FileSystemT *FileSystem)
 "Unmounts" (or "unregisters") a file system from the file manager. More...
 
InFileIOpenRead (const std::string &FileName)
 Opens the file with the given name for reading. More...
 
void Close (FileI *File)
 Closes the given file. More...
 
- Public Member Functions inherited from cf::FileSys::FileManI
virtual ~FileManI ()
 The destructor. More...
 

Detailed Description

This class implements the FileManI interface.

Constructor & Destructor Documentation

FileManImplT::FileManImplT ( )

The constructor.

FileManImplT::~FileManImplT ( )

The destructor.

Member Function Documentation

void FileManImplT::Close ( FileI File)
virtual

Closes the given file.

Implements cf::FileSys::FileManI.

FileSystemT * FileManImplT::MountFileSystem ( FileSystemTypeT  Type,
const std::string &  Descr,
const std::string &  MountPoint,
const std::string &  Password = "" 
)
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.

Parameters
TypeThe type of the file system to be mounted.
DescrA description/specification of the file system to be mounted, for example "Games/DeathMatch/", "MyArchive.zip", etc.
MountPointThe mount point of the file system, i.e. the path where the contents of the file system is attached to.
PasswordThe password string that might be required to access the specified file system (e.g. encrypted zip archives).
Returns
a handle to the mounted file system, or NULL on error. Note that the handle is "opaque" for the user code. That is, it can do nothing with it but check it for NULL in order to learn if an error occurred, and pass it to Unregister() later. Also note that a mount failure (getting a NULL result) here is not necessarily reason enough to terminate the entire application - the file manager is robust enough to deal with the situation (i.e. you can pass NULL to Unregister()), but of course opening files that are supposed to be in the file system that failed to mount will not succeed.

Implements cf::FileSys::FileManI.

InFileI * FileManImplT::OpenRead ( const std::string &  FileName)
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.

Parameters
FileNameThe name of the file to be opened within one of the previously registered file systems.
Returns
The pointer to the file or NULL if the file could not be opened.

Implements cf::FileSys::FileManI.

void FileManImplT::Unmount ( FileSystemT FileSystem)
virtual

"Unmounts" (or "unregisters") a file system from the file manager.

Parameters
FileSystemThe handle to the file system that was obtained by the call to MountFileSystem.

Implements cf::FileSys::FileManI.


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