mirror of
https://github.com/1dot13/source.git
synced 2026-09-09 14:46:05 +02:00
*** Merged Code from Multiplayer Branch Revision 2960 ***
- 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
This commit is contained in:
@@ -0,0 +1,64 @@
|
||||
#ifndef _VFS_CREATE_7Z_LIBRARY_H_
|
||||
#define _VFS_CREATE_7Z_LIBRARY_H_
|
||||
|
||||
//#include "Interface/vfs_library_interface.h"
|
||||
//#include "Interface/vfs_directory_interface.h"
|
||||
#include "../Interface/vfs_file_interface.h"
|
||||
#include <sstream>
|
||||
#include <map>
|
||||
#include <list>
|
||||
|
||||
namespace vfs
|
||||
{
|
||||
class CCreateUncompressed7zLibrary
|
||||
{
|
||||
public:
|
||||
CCreateUncompressed7zLibrary();
|
||||
virtual ~CCreateUncompressed7zLibrary();
|
||||
|
||||
bool AddFile(vfs::tReadableFile* pFile);
|
||||
|
||||
bool WriteLibrary(vfs::Path const& sLibName);
|
||||
bool WriteLibrary(vfs::tWriteableFile* pFile);
|
||||
protected:
|
||||
bool WriteSignatureHeader(std::ostream& out);
|
||||
bool WriteNextHeader(std::ostream& out);
|
||||
bool WriteMainStreamsInfo(std::ostream &out);
|
||||
bool WritePackInfo(std::ostream& out);
|
||||
bool WriteUnPackInfo(std::ostream& out);
|
||||
bool WriteSubStreamsInfo(std::ostream& out);
|
||||
bool WriteFolder(std::ostream& out);
|
||||
bool WriteFilesInfo(std::ostream& out);
|
||||
private:
|
||||
unsigned int WriteFileName(std::ostream& out, utf8string const& filename);
|
||||
|
||||
protected:
|
||||
vfs::tWriteableFile* m_pLibFile;
|
||||
|
||||
struct SFileInfo
|
||||
{
|
||||
SFileInfo()
|
||||
: name(L""), CRC(0), offset(0), size(0), time_creation(0), time_last_access(0), time_write(0)
|
||||
{};
|
||||
//////
|
||||
utf8string::str_t name;
|
||||
UInt32 CRC;
|
||||
UInt64 offset;
|
||||
UInt64 size;
|
||||
UInt64 time_creation,time_last_access,time_write;
|
||||
};
|
||||
typedef std::map<utf8string::str_t,SFileInfo> tDirInfo;
|
||||
|
||||
std::list<SFileInfo> m_lFileInfo;
|
||||
tDirInfo m_mapDirInfo;
|
||||
|
||||
// keeping pointers to files to write their contents lates is not enough,
|
||||
// as the file may only exist for a short time
|
||||
std::stringstream m_ssFileStream;
|
||||
|
||||
std::stringstream m_ssInfoStream;
|
||||
};
|
||||
} // end namespace
|
||||
|
||||
#endif // _VFS_CREATE_7Z_LIBRARY_H_
|
||||
|
||||
Reference in New Issue
Block a user