mirror of
https://github.com/1dot13/source.git
synced 2026-07-29 13:52:17 +02:00
** Big Maps Projects code (incl. Multiplayer v1.5 ** ********************************************************** - Merged Big Maps Project code from BMP+MP trunk (Revision: 3340) o Complete SVN Revision history: https://81.169.133.124/source/ja2/branches/Wanne/JA2%201.13%20MP - Before THIS merge, I made a branch of the existing 1.13 source o SVN Branch: https://81.169.133.124/source/ja2/branches/JA2_rev.3336/src - Removed old VS 6.0 and VS 2003 project and solutions files, because compilation is broken long time ago - I will add VS 2010 projects and solution file in the next few days git-svn-id: https://ja2svn.mooo.com/source/ja2/trunk/GameSource/ja2_v1.13/Build@3341 3b4a5df2-a311-0410-b5c6-a8a6f20db521
78 lines
2.5 KiB
C++
78 lines
2.5 KiB
C++
#ifndef _VFS_H_
|
|
#define _VFS_H_
|
|
|
|
#include "Interface/vfs_file_interface.h"
|
|
#include "Interface/vfs_location_interface.h"
|
|
#include "Interface/vfs_iterator_interface.h"
|
|
#include "vfs_vloc.h"
|
|
#include "vfs_vfile.h"
|
|
#include "vfs_types.h"
|
|
#include <map>
|
|
|
|
class CFileAllocator
|
|
{
|
|
public:
|
|
static void registerAllocator(BasicAllocator* allocator);
|
|
|
|
static void clear();
|
|
private:
|
|
static std::vector<BasicAllocator*> _valloc;
|
|
};
|
|
|
|
namespace vfs
|
|
{
|
|
class CProfileStack;
|
|
|
|
class VFS_API CVirtualFileSystem
|
|
{
|
|
typedef std::map<vfs::Path,CVirtualLocation*,vfs::Path::Less> tVFS;
|
|
|
|
class CRegularIterator;
|
|
class CMatchingIterator;
|
|
public:
|
|
typedef TIterator<vfs::tReadableFile> Iterator;
|
|
|
|
~CVirtualFileSystem();
|
|
|
|
static CVirtualFileSystem* getVFS();
|
|
static void shutdownVFS();
|
|
|
|
vfs::CProfileStack* getProfileStack();
|
|
|
|
vfs::CVirtualLocation* getVirtualLocation(vfs::Path const& sPath, bool bCreate = false);
|
|
bool addLocation(vfs::IBaseLocation* pLocation,
|
|
utf8string const& sProfileName,
|
|
bool bIsWritable = false);
|
|
|
|
bool fileExists(vfs::Path const& rLocalFilePath, vfs::CVirtualFile::ESearchFile eSF = vfs::CVirtualFile::SF_TOP );
|
|
bool fileExists(vfs::Path const& rLocalFilePath, std::string const& sProfileName);
|
|
|
|
vfs::IBaseFile* getFile(vfs::Path const& rLocalFilePath, vfs::CVirtualFile::ESearchFile eSF = vfs::CVirtualFile::SF_TOP );
|
|
vfs::IBaseFile* getFile(vfs::Path const& rLocalFilePath, utf8string const& sProfileName);
|
|
|
|
vfs::tReadableFile* getReadFile(vfs::Path const& rLocalFilePath, vfs::CVirtualFile::ESearchFile eSF = vfs::CVirtualFile::SF_TOP );
|
|
vfs::tReadableFile* getReadFile(vfs::Path const& rLocalFilePath, utf8string const& sProfileName);
|
|
|
|
vfs::tWritableFile* getWriteFile(vfs::Path const& rLocalFilePath, vfs::CVirtualFile::ESearchFile eSF = vfs::CVirtualFile::SF_TOP );
|
|
vfs::tWritableFile* getWriteFile(vfs::Path const& rLocalFilePath, utf8string const& sProfileName);
|
|
|
|
bool removeFileFromFS(vfs::Path const& sFilePath);
|
|
bool removeDirectoryFromFS(vfs::Path const& sDir);
|
|
bool createNewFile(vfs::Path const& sFileName);
|
|
|
|
Iterator begin();
|
|
Iterator begin(vfs::Path const& sPattern);
|
|
private:
|
|
vfs::CProfileStack m_oProfileStack;
|
|
tVFS m_mapFS;
|
|
private:
|
|
CVirtualFileSystem();
|
|
static CVirtualFileSystem* m_pSingleton;
|
|
};
|
|
|
|
} // end namespace
|
|
|
|
VFS_API vfs::CVirtualFileSystem* getVFS();
|
|
|
|
#endif // _VFS_H_
|