Ult3D
Implementation of "Ultimate 3D Game Engine Design & Architecture" by Allan Sherrod
Loading...
Searching...
No Matches
Archive.h
Go to the documentation of this file.
1#ifndef ULT_ARCHIVE_H_INCLUDED
2#define ULT_ARCHIVE_H_INCLUDED
3
4#include <fstream>
5
6#include "ArchiveFileHeader.h"
7
11
12namespace Ult
13{
14
20{
21public:
25 Archive();
29 virtual ~Archive();
30
35 bool ReadArchiveFile(const char* fileName);
42 const char* fileName,
43 ArchiveFileHeader* headers,
44 const int totalHeaders
45 );
49 void CloseArchive();
50
56 bool Extract(int index, char* location);
60 bool Extract(const char* fileName, char* location);
61
65 int GetFileIndex(const char* fileName);
71 bool GetFileData(int index, char* buffer, int bytesToRead);
75 bool GetFileData(const char* fileName, char* buffer, int bytesToRead);
76
82
84 int GetTotalHeaders() const { return mTotalHeaders; }
85
87 bool IsArchiveOpen() const { return mFileStream.is_open(); }
88
89private:
90 ArchiveFileHeader* mHeaders;
91 int mTotalHeaders;
92
93 std::ifstream mFileStream;
94};
95
96} // namespace Ult
97
98#endif // ULT_ARCHIVE_H_INCLUDED
99
Definition ArchiveFileHeader.h:12
Archive()
Definition Archive.cpp:12
virtual ~Archive()
Definition Archive.cpp:18
bool Extract(int index, char *location)
Definition Archive.cpp:166
bool GetFileData(int index, char *buffer, int bytesToRead)
Definition Archive.cpp:217
bool WriteArchiveFile(const char *fileName, ArchiveFileHeader *headers, const int totalHeaders)
Definition Archive.cpp:74
int GetFileIndex(const char *fileName)
Definition Archive.cpp:208
bool IsArchiveOpen() const
Definition Archive.h:87
int GetTotalHeaders() const
Definition Archive.h:84
void CloseArchive()
Definition Archive.cpp:157
bool ReadArchiveFile(const char *fileName)
Definition Archive.cpp:23
bool GetFileHeaderInfoByIndex(int index, ArchiveFileHeader *fh)
Definition Archive.cpp:235
Definition Archive.h:13