Ult3D
Implementation of "Ultimate 3D Game Engine Design & Architecture" by Allan Sherrod
|
#include <Archive.h>
Public Member Functions | |
Archive () | |
virtual | ~Archive () |
bool | ReadArchiveFile (const char *fileName) |
bool | WriteArchiveFile (const char *fileName, ArchiveFileHeader *headers, const int totalHeaders) |
void | CloseArchive () |
bool | Extract (int index, char *location) |
bool | Extract (const char *fileName, char *location) |
int | GetFileIndex (const char *fileName) |
bool | GetFileData (int index, char *buffer, int bytesToRead) |
bool | GetFileData (const char *fileName, char *buffer, int bytesToRead) |
bool | GetFileHeaderInfoByIndex (int index, ArchiveFileHeader *fh) |
int | GetTotalHeaders () const |
bool | IsArchiveOpen () const |
Represents a custom binary structure containing multiple files and a header.
Ult::Archive::Archive | ( | ) |
Archive constructor.
|
virtual |
Archive destructor.
void Ult::Archive::CloseArchive | ( | ) |
Frees all headers and closes any opened files.
bool Ult::Archive::Extract | ( | const char * | fileName, |
char * | location ) |
Calculate the file index based on fileName and call Extract on it.
bool Ult::Archive::Extract | ( | int | index, |
char * | location ) |
Copy the file data at the given index into a new file.
location | The filename of the new extracted file. |
bool Ult::Archive::GetFileData | ( | const char * | fileName, |
char * | buffer, | ||
int | bytesToRead ) |
Calcaulte the file index based on fileName and call GetFileData on it.
bool Ult::Archive::GetFileData | ( | int | index, |
char * | buffer, | ||
int | bytesToRead ) |
Copy the data of the file given by index into buffer.
bytesToRead | the number of bytes to copy from the file. |
bool Ult::Archive::GetFileHeaderInfoByIndex | ( | int | index, |
ArchiveFileHeader * | fh ) |
Store the archive file header data of the file at the given index into fh.
int Ult::Archive::GetFileIndex | ( | const char * | fileName | ) |
Get the index of the file given by fileName.
|
inline |
Returns the total number of files contained in the archive.
|
inline |
Returns whether the archive file has been opened.
bool Ult::Archive::ReadArchiveFile | ( | const char * | fileName | ) |
Open and parse the archive file with the given file name.
bool Ult::Archive::WriteArchiveFile | ( | const char * | fileName, |
ArchiveFileHeader * | headers, | ||
const int | totalHeaders ) |
Combine the data given by headers into a binary file on disk given by fileName.