Athena IO Library
ZQuestFile.hpp
1 #ifndef ATHENA_NO_ZQUEST
2 // This file is part of libAthena.
3 //
4 // libAthena is free software: you can redistribute it and/or modify
5 // it under the terms of the GNU General Public License as published by
6 // the Free Software Foundation, either version 3 of the License, or
7 // (at your option) any later version.
8 //
9 // libAthena is distributed in the hope that it will be useful,
10 // but WITHOUT ANY WARRANTY; without even the implied warranty of
11 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 // GNU General Public License for more details.
13 //
14 // You should have received a copy of the GNU General Public License
15 // along with libAthena. If not, see <http://www.gnu.org/licenses/>
16 
17 #ifndef ZQUEST_HPP
18 #define ZQUEST_HPP
19 
20 
21 #include "Athena/Global.hpp"
22 #include <string>
23 #include <vector>
24 
25 #define ZQUEST_VERSION_CHECK(major, minor, revision) \
26  (major | (minor << 8) | (revision << 16))
27 
28 namespace Athena
29 {
34 {
35 public:
39  static const atUint32 Major;
43  static const atUint32 Minor;
47  static const atUint32 Revision;
51  static const atUint32 Version;
52 
56  static const atUint32 Magic;
57 
62  enum Game
63  {
65  LoZ,
66  AoL,
68  LA,
69  OoT,
71  MM,
72  OoS,
73  OoA,
74  FS,
75  WW,
76  FSA,
77  MC,
78  TP,
79  PH,
80  ST,
81  SS,
82  ALBW,
83  // Add more games here
84 
85  // This must always be last
87  };
88 
92  ZQuestFile();
93 
101  ZQuestFile(Game game, Endian endian, atUint8* data, atUint32 length, const std::string& gameString = std::string());
102  ~ZQuestFile();
103 
108  void setGame(Game game);
109 
114  Game game() const;
115 
120  void setEndian(Endian endian);
121 
126  Endian endian() const;
127 
133  void setData(atUint8* data, atUint32 length);
134 
139  atUint8* data() const;
140 
145  atUint32 length() const;
146 
147  void setGameString(const std::string& gameString);
152  std::string gameString() const;
153 
154  static const std::vector<std::string> gameStringList();
155 protected:
156  Game m_game;
157  std::string m_gameString;
158  Endian m_endian;
159  atUint8* m_data;
160  atUint32 m_length;
161 
162  // Game strings support
163 };
164 } // zelda
165 
166 #endif // ZQUEST_HPP
167 #endif // ATHENA_NO_ZQUEST
Game game() const
game
void setData(atUint8 *data, atUint32 length)
setData
A Link to the Past.
Definition: ZQuestFile.hpp:67
Spirit Tracks.
Definition: ZQuestFile.hpp:80
void setEndian(Endian endian)
setEndian
ZQuestFile()
ZQuest.
Total number of supported games.
Definition: ZQuestFile.hpp:86
static const atUint32 Minor
The current minor version of the ZQuest format.
Definition: ZQuestFile.hpp:43
None or Unsupported.
Definition: ZQuestFile.hpp:64
Four Swords Adventures.
Definition: ZQuestFile.hpp:76
Majora's Mask.
Definition: ZQuestFile.hpp:71
atUint8 * data() const
data
Oracle of Season.
Definition: ZQuestFile.hpp:72
Adventure of Link.
Definition: ZQuestFile.hpp:66
Oracle of Ages.
Definition: ZQuestFile.hpp:73
Legend of Zelda.
Definition: ZQuestFile.hpp:65
Skyward Sword.
Definition: ZQuestFile.hpp:81
Links Awakening.
Definition: ZQuestFile.hpp:68
Ocarina of Time 3D.
Definition: ZQuestFile.hpp:70
static const atUint32 Major
The current major version of the ZQuest format.
Definition: ZQuestFile.hpp:39
Game
The list of games currently supported by ZQuest.
Definition: ZQuestFile.hpp:62
void setGame(Game game)
setGame
static const atUint32 Version
The current version of the ZQuest format.
Definition: ZQuestFile.hpp:51
Ocarin of Time.
Definition: ZQuestFile.hpp:69
Twilight Princess.
Definition: ZQuestFile.hpp:78
std::string gameString() const
gameString
Endian endian() const
endian
Phantom Hourglass.
Definition: ZQuestFile.hpp:79
static const atUint32 Revision
The current revision of the ZQuest format.
Definition: ZQuestFile.hpp:47
static const atUint32 Magic
The magic number used to identify the file e.g. "ZQS1".
Definition: ZQuestFile.hpp:56
ZQuestFile is an export format for save data.
Definition: ZQuestFile.hpp:33
atUint32 length() const
length
A Link Between Worlds.
Definition: ZQuestFile.hpp:82