Main Page | Namespace List | Class Hierarchy | Alphabetical List | Class List | File List | Namespace Members | Class Members | File Members | Related Pages

switches.hpp

Go to the documentation of this file.
00001 // libdoomwad: manipulates Doom wad files.
00002 // Copyright (C) 2005  John Gaughan
00003 //
00004 // This library is free software; you can redistribute it and/or
00005 // modify it under the terms of the GNU Lesser General Public
00006 // License as published by the Free Software Foundation; either
00007 // version 2.1 of the License, or (at your option) any later version.
00008 //
00009 // This library is distributed in the hope that it will be useful,
00010 // but WITHOUT ANY WARRANTY; without even the implied warranty of
00011 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
00012 // Lesser General Public License for more details.
00013 //
00014 // You should have received a copy of the GNU Lesser General Public
00015 // License along with this library; if not, write to the Free Software
00016 // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
00017 //
00018 // This library is distributed with the full text of the LGPL. Please see
00019 // the accompanying file named COPYING.
00020 // 
00021 // You may contact the author at john@johngaughan.net
00022 
00043 // C++ required.
00044 #if !defined __cplusplus
00045 #error C++ compiler required
00046 #endif
00047 
00048 // Include guard
00049 #if !defined SWITCHES_H
00050 #define SWITCHES_H
00051 
00052 // C++ headers
00053 #include <list>
00054 #include <sstream>
00055 #include <string>
00056 
00057 // Doom headers
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

Generated on Fri Jun 10 19:38:51 2005 for libdoomwad by  doxygen 1.4.0