#include <FileSystem.h>
Inheritance diagram for NSFileSystem::TFSFileSystem:
Public Member Functions | |
TFSFileSystem (void) | |
Constructor. | |
~TFSFileSystem (void) | |
Destructor. | |
TFSFileSystem (const TFSFileSystem &orig) | |
fake copy constructor | |
void | operator= (const TFSFileSystem &orig) |
fake assignment operator | |
BOOL | RegisterPath (const TString &path) |
Register next path into system. | |
BOOL | RegisterCabinet (const TString &filename) |
Register next cabinet into system. | |
DWORD | RegisterMultiplePaths (const TString &paths) |
This method register more paths into VFS. | |
DWORD | RegisterMultipleCabinets (const TString &cabinets) |
This method register more cabinets into VFS. | |
TVirtualFile * | GetFile (const TString &filename) const |
This method try to find given file in filesystem. | |
DWORD | GetRegisteredPathCount (void) const |
Return number of registered paths in manager. | |
DWORD | GetRegisteredCabinetCount (void) const |
Return number of registered cabinets in manager. | |
const TString & | GetRegisteredPath (const DWORD &index) const |
Return name of specified register path on given index. | |
const TString & | GetRegisteredCabinet (const DWORD &index) const |
Return name of specified register cabinet on given index. | |
BOOL | Exists (const TString &filename) const |
Determines whether specified file exists in filesystem. | |
TBuffer * | GetFileData (const TString &filename) const |
This method read all data from specified file and returns it in dynamically allocated buffer. |
You can use filesystem to get data from real files or from files stored inside cabinet.
After constructing filesystem has registered only path "." - actual directory.
You may register next directories or cabinet files to filesystem.
While finding file, filesystem at first search real files and when no file was found it tries find file in registred cabinets.
When you get pointer to file it is independent on VFS from which has been loaded. Thus you can destroy file system after getting file without problem.
Definition at line 49 of file FileSystem.h.
|
Constructor. Creates filesystem which has registered actual directory "./". Definition at line 24 of file FileSystem.cpp. References TArrayPtrs< T, size, step >::AddItem(). Here is the call graph for this function: ![]() |
|
Destructor.
Definition at line 32 of file FileSystem.cpp. |
|
fake copy constructor
|
|
Determines whether specified file exists in filesystem.
Definition at line 212 of file FileSystem.cpp. References TString::c_str(), TArrayPtrs< T, size, step >::Size(), and TRUE. Here is the call graph for this function: ![]() |
|
This method try to find given file in filesystem. At first registered paths are traverse in order of registered paths (first path is always "./"). If file wasn't found cabinet are searched through. Method returns NULL if file couldn't be found.
Definition at line 163 of file FileSystem.cpp. References NSFileSystem::TVirtualFileReal::OpenFile(), and TArrayPtrs< T, size, step >::Size(). Referenced by GetFileData(), NSConfigFile::TConfigFile::LoadConfigFileFromVFS(), NSMeshes::TDeclarationLoader::LoadDeclarationFromFile(), NSMeshes::TMeshLoader::LoadMeshDataFromFile(), and NSMeshes::TMeshLoader::LoadMeshFromFile(). Here is the call graph for this function: ![]() |
|
This method read all data from specified file and returns it in dynamically allocated buffer. If specified file doesnt exists then NULL is returned. This method allocates memory which must be deallocated by caller!!!
Definition at line 256 of file FileSystem.cpp. References NSFileSystem::TVirtualFile::Close(), DBGTEXTF, TBuffer::GetData(), GetFile(), NSFileSystem::TVirtualFile::GetSize(), and NSFileSystem::TVirtualFile::Read(). Here is the call graph for this function: ![]() |
|
Return name of specified register cabinet on given index.
Definition at line 111 of file FileSystem.h. |
|
Return number of registered cabinets in manager.
Definition at line 93 of file FileSystem.h. References TArrayPtrs< T, size, step >::Count(). Here is the call graph for this function: ![]() |
|
Return name of specified register path on given index.
Definition at line 102 of file FileSystem.h. |
|
Return number of registered paths in manager.
Definition at line 86 of file FileSystem.h. References TArrayPtrs< T, size, step >::Count(). Here is the call graph for this function: ![]() |
|
fake assignment operator
|
|
Register next cabinet into system.
Definition at line 61 of file FileSystem.cpp. References TArrayPtrs< T, size, step >::AddItem(), FALSE, NSFileSystem::TFSCabinet::LoadCabinet(), and TRUE. Referenced by RegisterMultipleCabinets(). Here is the call graph for this function: ![]() |
|
This method register more cabinets into VFS. Cabinets are contained in string, each must be terminated by ';' Method returns number of successfully registered cabinets.
Definition at line 123 of file FileSystem.cpp. References TString::Add(), TString::At(), TString::ClearDeallocOff(), TString::Length(), and RegisterCabinet(). Here is the call graph for this function: ![]() |
|
This method register more paths into VFS. Paths are contained in string, each path must be terminated by '/;' Method returns number of successfully registered paths.
Definition at line 85 of file FileSystem.cpp. References TString::Add(), TString::At(), TString::ClearDeallocOff(), TString::Length(), and RegisterPath(). Here is the call graph for this function: ![]() |
|
Register next path into system. This path must have '/' as last character and must be valid!!!
Definition at line 42 of file FileSystem.cpp. References TArrayPtrs< T, size, step >::AddItem(), TString::At(), DBGTEXTF, FALSE, TString::Length(), and TRUE. Referenced by RegisterMultiplePaths(). Here is the call graph for this function: ![]() |