Game Develop C++ Platform: DatFile.h Source File

| Game Develop C++ Platform Platform for developing native games based on OpenGL and SFML with Game Develop

- Main Page
- Related Pages
- Modules
- Namespaces
- Classes
- Files

- File List
- File Members

All Classes Namespaces Files Functions Variables Typedefs Enumerations Groups Pages
DatFile.h
Go to the documentation of this file.
1
7 #ifndef DATFILE_H
8 #define DATFILE_H
9
10 #include <string>
11 #include <vector>
12
13 using namespace std;
14
20 struct sDATHeader
21 {
22 char uniqueID[5];
23 char version[3];
24 unsigned int nb_files;
25 };
26
32 struct sFileEntry
33 {
34 char name[1024];
35 long size;
36 long offset;
37 };
38
44 class GD_API DatFile
45 {
46 private :
47 std::string m_datfile;
48 sDATHeader m_header;
49 std::vector<sFileEntry> m_entries;
50 char* m_buffer;
51 public :
52 DatFile (void);
53 ~DatFile (void);
54 bool Create (std::vector<std::string> files, std::string directory, std::string destination);
55 bool ContainsFile(const std::string & filename);
56 bool Read (std::string source);
57 char* GetFile (std::string filename);
58 long int GetFileSize (std::string filename);
59 };
60
61 #endif // DATFILE_H
62