3#ifndef ENGINE_SHARED_DATAFILE_H
4#define ENGINE_SHARED_DATAFILE_H
40 Other.m_pDataFile =
nullptr;
44 bool Open(
class IStorage *pStorage,
const char *pFilename,
int StorageType);
53 void ReplaceData(
int Index,
char *pData,
size_t Size);
58 void *
GetItem(
int Index,
int *pType =
nullptr,
int *pId =
nullptr,
CUuid *pUuid =
nullptr);
59 void GetType(
int Type,
int *pStart,
int *pNum);
133 m_vItems = std::move(Other.m_vItems);
134 m_vDatas = std::move(Other.m_vDatas);
140 int AddItem(
int Type,
int Id,
size_t Size,
const void *pData,
const CUuid *pUuid =
nullptr);
Definition: datafile.h:24
int GetItemSize(int Index) const
Definition: datafile.cpp:446
void * GetItem(int Index, int *pType=nullptr, int *pId=nullptr, CUuid *pUuid=nullptr)
Definition: datafile.cpp:502
int GetFileDataSize(int Index) const
Definition: datafile.cpp:274
struct CDatafile * m_pDataFile
Definition: datafile.h:25
bool Open(class IStorage *pStorage, const char *pFilename, int StorageType)
Definition: datafile.cpp:103
void GetType(int Type, int *pStart, int *pNum)
Definition: datafile.cpp:521
int FindItemIndex(int Type, int Id)
Definition: datafile.cpp:540
int GetInternalItemType(int ExternalType)
Definition: datafile.cpp:478
void UnloadData(int Index)
Definition: datafile.cpp:434
bool Close()
Definition: datafile.cpp:240
IOHANDLE File() const
Definition: datafile.cpp:259
int GetDataSize(int Index) const
Definition: datafile.cpp:285
bool IsOpen() const
Definition: datafile.h:46
void ReplaceData(int Index, char *pData, size_t Size)
Definition: datafile.cpp:424
SHA256_DIGEST Sha256() const
Definition: datafile.cpp:575
unsigned Crc() const
Definition: datafile.cpp:582
void * FindItem(int Type, int Id)
Definition: datafile.cpp:558
int NumData() const
Definition: datafile.cpp:266
void * GetData(int Index)
Definition: datafile.cpp:399
int GetExternalItemType(int InternalType, CUuid *pUuid)
Definition: datafile.cpp:455
int MapSize() const
Definition: datafile.cpp:589
int NumItems() const
Definition: datafile.cpp:568
CDataFileReader()
Definition: datafile.h:33
~CDataFileReader()
Definition: datafile.h:35
void * GetDataSwapped(int Index)
Definition: datafile.cpp:404
const char * GetDataString(int Index)
Definition: datafile.cpp:409
void * GetDataImpl(int Index, bool Swap)
Definition: datafile.cpp:311
CDataFileReader & operator=(CDataFileReader &&Other)
Definition: datafile.h:37
Definition: datafile.h:71
@ MAX_ITEM_TYPES
Definition: datafile.h:114
~CDataFileWriter()
Definition: datafile.cpp:601
ECompressionLevel
Definition: datafile.h:74
@ COMPRESSION_DEFAULT
Definition: datafile.h:75
@ COMPRESSION_BEST
Definition: datafile.h:76
CDataFileWriter()
Definition: datafile.cpp:596
std::vector< CDataInfo > m_vDatas
Definition: datafile.h:120
void Finish()
Definition: datafile.cpp:770
int AddDataSwapped(size_t Size, const void *pData)
Definition: datafile.cpp:729
int GetTypeFromIndex(int Index) const
Definition: datafile.cpp:628
std::map< uint16_t, CItemTypeInfo, std::less<> > m_ItemTypes
Definition: datafile.h:118
CDataFileWriter(CDataFileWriter &&Other)
Definition: datafile.h:128
bool Open(class IStorage *pStorage, const char *pFilename, int StorageType=IStorage::TYPE_SAVE)
Definition: datafile.cpp:621
int AddDataString(const char *pStr)
Definition: datafile.cpp:747
int GetExtendedItemTypeIndex(int Type, const CUuid *pUuid)
Definition: datafile.cpp:633
int AddData(size_t Size, const void *pData, ECompressionLevel CompressionLevel=COMPRESSION_DEFAULT)
Definition: datafile.cpp:712
std::vector< CItemInfo > m_vItems
Definition: datafile.h:119
int AddItem(int Type, int Id, size_t Size, const void *pData, const CUuid *pUuid=nullptr)
Definition: datafile.cpp:667
IOHANDLE m_File
Definition: datafile.h:117
std::vector< CExtendedItemType > m_vExtendedItemTypes
Definition: datafile.h:121
@ TYPE_SAVE
Definition: storage.h:25
@ ITEMTYPE_EX
Definition: datafile.h:19
void * IOHANDLE
Definition: logger.h:11
Definition: datafile.h:81
int m_CompressedSize
Definition: datafile.h:85
int m_UncompressedSize
Definition: datafile.h:83
void * m_pCompressedData
Definition: datafile.h:84
void * m_pUncompressedData
Definition: datafile.h:82
ECompressionLevel m_CompressionLevel
Definition: datafile.h:86
Definition: datafile.h:107
int m_Type
Definition: datafile.h:108
CUuid m_Uuid
Definition: datafile.h:109
Definition: datafile.h:90
int m_Prev
Definition: datafile.h:95
int m_Next
Definition: datafile.h:94
int m_Id
Definition: datafile.h:92
int m_Size
Definition: datafile.h:93
void * m_pData
Definition: datafile.h:96
int m_Type
Definition: datafile.h:91
Definition: datafile.h:100
int m_Last
Definition: datafile.h:103
int m_Num
Definition: datafile.h:101
int m_First
Definition: datafile.h:102
Definition: datafile.cpp:91
Definition: uuid_manager.h:17