DDraceNetwork Docs
CDataFileWriter Class Reference

#include <datafile.h>

Classes

struct  CDataInfo
 
struct  CExtendedItemType
 
struct  CItemInfo
 
struct  CItemTypeInfo
 

Public Types

enum  ECompressionLevel { COMPRESSION_DEFAULT , COMPRESSION_BEST }
 

Public Member Functions

 CDataFileWriter ()
 
 CDataFileWriter (CDataFileWriter &&Other)
 
 ~CDataFileWriter ()
 
bool Open (class IStorage *pStorage, const char *pFilename, int StorageType=IStorage::TYPE_SAVE)
 
int AddItem (int Type, int Id, size_t Size, const void *pData, const CUuid *pUuid=nullptr)
 
int AddData (size_t Size, const void *pData, ECompressionLevel CompressionLevel=COMPRESSION_DEFAULT)
 
int AddDataSwapped (size_t Size, const void *pData)
 
int AddDataString (const char *pStr)
 
void Finish ()
 

Private Types

enum  { MAX_ITEM_TYPES = 0x10000 }
 

Private Member Functions

int GetTypeFromIndex (int Index) const
 
int GetExtendedItemTypeIndex (int Type, const CUuid *pUuid)
 

Private Attributes

IOHANDLE m_File
 
std::map< uint16_t, CItemTypeInfo, std::less<> > m_ItemTypes
 
std::vector< CItemInfom_vItems
 
std::vector< CDataInfom_vDatas
 
std::vector< CExtendedItemTypem_vExtendedItemTypes
 

Member Enumeration Documentation

◆ anonymous enum

anonymous enum
private
Enumerator
MAX_ITEM_TYPES 

◆ ECompressionLevel

Enumerator
COMPRESSION_DEFAULT 
COMPRESSION_BEST 

Constructor & Destructor Documentation

◆ CDataFileWriter() [1/2]

CDataFileWriter::CDataFileWriter ( )

◆ CDataFileWriter() [2/2]

CDataFileWriter::CDataFileWriter ( CDataFileWriter &&  Other)
inline

◆ ~CDataFileWriter()

CDataFileWriter::~CDataFileWriter ( )

Member Function Documentation

◆ AddData()

int CDataFileWriter::AddData ( size_t  Size,
const void *  pData,
ECompressionLevel  CompressionLevel = COMPRESSION_DEFAULT 
)

◆ AddDataString()

int CDataFileWriter::AddDataString ( const char *  pStr)

◆ AddDataSwapped()

int CDataFileWriter::AddDataSwapped ( size_t  Size,
const void *  pData 
)

◆ AddItem()

int CDataFileWriter::AddItem ( int  Type,
int  Id,
size_t  Size,
const void *  pData,
const CUuid pUuid = nullptr 
)

◆ Finish()

void CDataFileWriter::Finish ( )

◆ GetExtendedItemTypeIndex()

int CDataFileWriter::GetExtendedItemTypeIndex ( int  Type,
const CUuid pUuid 
)
private

◆ GetTypeFromIndex()

int CDataFileWriter::GetTypeFromIndex ( int  Index) const
private

◆ Open()

bool CDataFileWriter::Open ( class IStorage pStorage,
const char *  pFilename,
int  StorageType = IStorage::TYPE_SAVE 
)

Member Data Documentation

◆ m_File

IOHANDLE CDataFileWriter::m_File
private

◆ m_ItemTypes

std::map<uint16_t, CItemTypeInfo, std::less<> > CDataFileWriter::m_ItemTypes
private

◆ m_vDatas

std::vector<CDataInfo> CDataFileWriter::m_vDatas
private

◆ m_vExtendedItemTypes

std::vector<CExtendedItemType> CDataFileWriter::m_vExtendedItemTypes
private

◆ m_vItems

std::vector<CItemInfo> CDataFileWriter::m_vItems
private

The documentation for this class was generated from the following files: