00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00055
00056 #if !defined __cplusplus
00057 #error C++ compiler required
00058 #endif
00059
00060
00061 #if !defined WADENTRY_H
00062 #define WADENTRY_H
00063
00064
00065 #include <string>
00066
00067
00068 #include "global.hpp"
00069 #include "lump.hpp"
00070
00071 namespace Doomwad
00072 {
00073
00086 EXPORT class WadEntry
00087 {
00088 public:
00089
00098 virtual ~WadEntry (void) throw () {}
00099
00116 virtual bool setFromLump (const Lump &lump) throw () = 0;
00117
00126 virtual Lump toLump (void) const throw () = 0;
00127
00142 virtual std::string toString (void) const throw () = 0;
00143 };
00144
00159 EXPORT class TextWadEntry : public WadEntry
00160 {
00161 protected:
00162
00164 std::string str;
00165
00167 std::string name;
00168
00169 public:
00170
00172 static const std::string ANIMDEFS;
00173
00175 static const std::string CREDITS;
00176
00178 static const std::string DECALDEF;
00179
00181 static const std::string DECORATE;
00182
00184 static const std::string DEHACKED;
00185
00187 static const std::string DEHSUPP;
00188
00190 static const std::string KEYCONF;
00191
00193 static const std::string MAPINFO;
00194
00196 static const std::string S_SKIN;
00197
00199 static const std::string SCRIPTS;
00200
00202 static const std::string SNDINFO;
00203
00205 static const std::string SNDSEQ;
00206
00208 static const std::string TERRAIN;
00209
00210 TextWadEntry (const std::string&) throw ();
00211 TextWadEntry (const Lump&) throw ();
00212 virtual ~TextWadEntry (void) throw ();
00213
00214 virtual bool setString (const std::string&) throw ();
00215 virtual std::string getString (void) const throw ();
00216
00217 virtual bool setName (const std::string&) throw ();
00218 virtual std::string getName (void) const throw ();
00219
00220 virtual void makeDosNewline (void) throw ();
00221 virtual void makeMacNewline (void) throw ();
00222 virtual void makeUnixNewline (void) throw ();
00223
00224
00225 virtual bool setFromLump (const Lump&) throw ();
00226 virtual Lump toLump (void) const throw ();
00227 virtual std::string toString (void) const throw ();
00228 };
00229
00238 EXPORT class WadEntryElement
00239 {
00240 public:
00241
00251 virtual size_t getLength (void) const throw () = 0;
00252
00263 virtual bool read (const Lump &lump, Lump::size_type i) throw () = 0;
00264
00275 virtual bool write (Lump &lump, Lump::size_type i) const throw () = 0;
00276
00288 virtual std::string toString (void) const throw () = 0;
00289 };
00290 }
00291 #endif