TrinityCore
Loading...
Searching...
No Matches
ChunkedFile Class Reference

#include <loadlib.h>

Public Member Functions

uint8 * GetData ()
 
uint32 GetDataSize ()
 
 ChunkedFile ()
 
virtual ~ChunkedFile ()
 
bool prepareLoadedData ()
 
bool loadFile (std::shared_ptr< CASC::Storage const > mpq, std::string const &fileName, bool log=true)
 
bool loadFile (std::shared_ptr< CASC::Storage const > mpq, uint32 fileDataId, std::string const &description, bool log=true)
 
void free ()
 
void parseChunks ()
 
FileChunk const * GetChunk (std::string_view name) const
 

Public Attributes

uint8 * data
 
uint32 data_size
 
std::multimap< std::string_view, FileChunk > chunks
 

Detailed Description

Definition at line 73 of file loadlib.h.

Constructor & Destructor Documentation

◆ ChunkedFile()

ChunkedFile::ChunkedFile ( )

Definition at line 22 of file loadlib.cpp.

References data, and data_size.

◆ ~ChunkedFile()

ChunkedFile::~ChunkedFile ( )
virtual

Definition at line 28 of file loadlib.cpp.

References free().

Member Function Documentation

◆ free()

void ChunkedFile::free ( )

Definition at line 100 of file loadlib.cpp.

References chunks, data, and data_size.

Referenced by loadFile(), loadFile(), and ~ChunkedFile().

◆ GetChunk()

FileChunk const * ChunkedFile::GetChunk ( std::string_view  name) const

Definition at line 158 of file loadlib.cpp.

References chunks.

Referenced by ConvertADT(), ExtractMaps(), and prepareLoadedData().

◆ GetData()

uint8 * ChunkedFile::GetData ( )
inline

Definition at line 79 of file loadlib.h.

References data.

Referenced by parseChunks().

◆ GetDataSize()

uint32 ChunkedFile::GetDataSize ( )
inline

Definition at line 80 of file loadlib.h.

References data_size.

Referenced by parseChunks().

◆ loadFile() [1/2]

bool ChunkedFile::loadFile ( std::shared_ptr< CASC::Storage const >  mpq,
std::string const &  fileName,
bool  log = true 
)

Definition at line 33 of file loadlib.cpp.

References data, data_size, free(), parseChunks(), and prepareLoadedData().

Referenced by ConvertADT(), ConvertADT(), and ExtractMaps().

◆ loadFile() [2/2]

bool ChunkedFile::loadFile ( std::shared_ptr< CASC::Storage const >  mpq,
uint32  fileDataId,
std::string const &  description,
bool  log = true 
)

Definition at line 60 of file loadlib.cpp.

References data, data_size, free(), parseChunks(), and prepareLoadedData().

◆ parseChunks()

void ChunkedFile::parseChunks ( )

◆ prepareLoadedData()

bool ChunkedFile::prepareLoadedData ( )

Definition at line 87 of file loadlib.cpp.

References FileChunk::As(), FILE_FORMAT_VERSION, GetChunk(), and file_MVER::ver.

Referenced by loadFile(), and loadFile().

Member Data Documentation

◆ chunks

std::multimap<std::string_view, FileChunk> ChunkedFile::chunks

Definition at line 90 of file loadlib.h.

Referenced by ConvertADT(), free(), GetChunk(), and parseChunks().

◆ data

uint8* ChunkedFile::data

Definition at line 76 of file loadlib.h.

Referenced by ChunkedFile(), free(), GetData(), loadFile(), and loadFile().

◆ data_size

uint32 ChunkedFile::data_size

Definition at line 77 of file loadlib.h.

Referenced by ChunkedFile(), free(), GetDataSize(), loadFile(), loadFile(), and parseChunks().


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