mirror of
https://github.com/1dot13/source.git
synced 2026-07-29 13:52:17 +02:00
- Virtual File System (VFS) by birdflu. This is needed for Multiplayer and is also used for Single Player. Very neat system :-) - Multiplayer Version 1.1 + some additional features and bugfixes * INFO: If you compile a new EXE and want to test, be sure to also use the latest SVN GameDir files in your JA2 install directory * git-svn-id: https://ja2svn.mooo.com/source/ja2/trunk/GameSource/ja2_v1.13/Build@2961 3b4a5df2-a311-0410-b5c6-a8a6f20db521
55 lines
1.5 KiB
C++
55 lines
1.5 KiB
C++
#ifndef _VFS_LIB_DIR_H_
|
|
#define _VFS_LIB_DIR_H_
|
|
|
|
#include "../Interface/vfs_directory_interface.h"
|
|
|
|
namespace vfs
|
|
{
|
|
|
|
class CLibDirectory : public vfs::IDirectory<vfs::IWriteType>
|
|
{
|
|
typedef std::map<vfs::Path, tFileType*, vfs::Path::Less> tFileCatalogue;
|
|
|
|
class IterImpl : public tClassType::Iterator::IImplemetation
|
|
{
|
|
public:
|
|
IterImpl(CLibDirectory& lib);
|
|
virtual ~IterImpl();
|
|
virtual tFileType* value();
|
|
virtual void next();
|
|
private:
|
|
CLibDirectory& _lib;
|
|
tFileCatalogue::iterator _iter;
|
|
};
|
|
public:
|
|
CLibDirectory(vfs::Path const& sLocalPath, vfs::Path const& sRealPath)
|
|
: vfs::IDirectory<vfs::IWriteType>(sLocalPath,sRealPath)
|
|
{};
|
|
virtual ~CLibDirectory();
|
|
|
|
/**
|
|
* IDirectory interface
|
|
*/
|
|
virtual tFileType* AddFile(vfs::Path const& sFilename, bool bDeleteOldFile=false);
|
|
virtual bool AddFile(tFileType* pFile, bool bDeleteOldFile=false);
|
|
virtual bool DeleteFileFromDirectory(vfs::Path const& sFileName);
|
|
virtual bool CreateSubDirectory(vfs::Path const& sSubDirPath);
|
|
virtual bool DeleteDirectory(vfs::Path const& sDirPath);
|
|
|
|
/**
|
|
* IVFSLocation interface
|
|
*/
|
|
virtual bool FileExists(vfs::Path const& sFileName);
|
|
virtual vfs::IBaseFile* GetFile(vfs::Path const& sFileName);
|
|
virtual tFileType* GetFileTyped(vfs::Path const& sFileName);
|
|
virtual void GetSubDirList(std::list<vfs::Path>& rlSubDirs);
|
|
|
|
virtual Iterator begin();
|
|
protected:
|
|
tFileCatalogue m_mapFiles;
|
|
};
|
|
|
|
} // -end- namespace
|
|
|
|
#endif // _VFS_LIB_DIR_H_
|