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

wadentry.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 
00055 // C++ required.
00056 #if !defined __cplusplus
00057 #error C++ compiler required
00058 #endif
00059 
00060 // Include guard
00061 #if !defined WADENTRY_H
00062 #define WADENTRY_H
00063 
00064 // C++ headers
00065 #include <string>
00066 
00067 // Doom headers
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     // Inherited
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

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