00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00043
00044 #if !defined __cplusplus
00045 #error C++ compiler required
00046 #endif
00047
00048
00049 #if !defined SWITCHES_H
00050 #define SWITCHES_H
00051
00052
00053 #include <list>
00054 #include <sstream>
00055 #include <string>
00056
00057
00058 #include "global.hpp"
00059 #include "lump.hpp"
00060 #include "wadentry.hpp"
00061
00062 namespace Doomwad
00063 {
00064
00070 EXPORT class Switch : public WadEntryElement
00071 {
00072 public:
00073
00074 static const int16 SHAREWARE;
00075 static const int16 DOOM;
00076 static const int16 DOOM2;
00077 static const int16 TERMINATE;
00078 static const int16 DEFAULT;
00079 static const size_t LENGTH;
00080
00081 std::string on;
00082 std::string off;
00083 int16 type;
00084
00085 Switch (void) throw ();
00086 Switch (const std::string&, const std::string&, int16 = DEFAULT);
00087 virtual ~Switch (void) throw () {}
00088
00089 virtual size_t getLength (void) const throw ();
00090 virtual bool write (Lump &lump, Lump::size_type i) const throw ();
00091 virtual bool read (const Lump &lump, Lump::size_type i) throw ();
00092 virtual std::string toString (void) const throw ();
00093 };
00094
00110 EXPORT class Switches : public WadEntry, public std::list<Switch>
00111 {
00112 public:
00113
00115 static const std::string NAME;
00116
00117 Switches (void) throw ();
00118 Switches (const Lump&) throw ();
00119 virtual ~Switches (void) throw ();
00120
00121 virtual bool setFromLump (const Lump &lump) throw ();
00122 virtual Lump toLump (void) const throw ();
00123 virtual std::string toString (void) const throw ();
00124 };
00125 }
00126 #endif