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

Doomwad::TextWadEntry Class Reference

Inheritance diagram for Doomwad::TextWadEntry:

Doomwad::WadEntry List of all members.

Detailed Description

Class for text entries in a Wad.

See also:
Lump WadEntry
This class expands the WadEntry class with functions for entries that are text based. Text based entries are simply Lump objects containing regular old strings.

The distinction is important because different tools might treat these entries differently. For example, some might use LF for newlines, but Windows tools are likely to use CRLF. Some might null-terminate their strings, some might not. This class handles all of these cases.

Definition at line 159 of file wadentry.hpp.

Public Member Functions

virtual std::string getName (void) const throw ()
 Get the name of this object.
virtual std::string getString (void) const throw ()
 Get the contents of this object.
virtual void makeDosNewline (void) throw ()
 Convert to DOS newlines.
virtual void makeMacNewline (void) throw ()
 Convert to Macintosh newlines.
virtual void makeUnixNewline (void) throw ()
 Convert to Unix newlines.
virtual bool setFromLump (const Lump &) throw ()
 Set from a Lump object.
virtual bool setName (const std::string &) throw ()
 Set the name of this object.
virtual bool setString (const std::string &) throw ()
 Set the contents of this object.
 TextWadEntry (const Lump &) throw ()
 Lump constructor.
 TextWadEntry (const std::string &) throw ()
 Default constructor.
virtual Lump toLump (void) const throw ()
 Convert to a Lump.
virtual std::string toString (void) const throw ()
 Convert to a string.
virtual ~TextWadEntry (void) throw ()
 Destructor.

Static Public Attributes

static const std::string ANIMDEFS = "ANIMDEFS"
 Defines animation and switch sequences.
static const std::string CREDITS = "CREDITS"
 Readme/credits for wad.
static const std::string DECALDEF = "DECALDEF"
 Defines wall decorations.
static const std::string DECORATE = "DECORATE"
 Defines sequences of graphics in a map.
static const std::string DEHACKED = "DEHACKED"
 Embeds DEH/BEX patches in a Wad.
static const std::string DEHSUPP = "DEHSUPP"
 Add additional actors to use with Dehacked.
static const std::string KEYCONF = "KEYCONF"
 Adds keybindings in a Wad file.
static const std::string MAPINFO = "MAPINFO"
 Defines characteristics of maps, episodes, and hubs.
static const std::string S_SKIN = "S_SKIN"
 Defines player skins.
static const std::string SCRIPTS = "SCRIPTS"
 Source code for Behavior scripts.
static const std::string SNDINFO = "SNDINFO"
 Provides sound definitions.
static const std::string SNDSEQ = "SNDSEQ"
 Defines sequences of sounds for scripting.
static const std::string TERRAIN = "TERRAIN"
 Defines terrain characteristics.

Protected Attributes

std::string name
 Name in a Wad file.
std::string str
 String representing state.


Constructor & Destructor Documentation

TextWadEntry::TextWadEntry const std::string &  _name  )  throw ()
 

Default constructor.

Parameters:
_name Name of the entry.

Definition at line 62 of file wadentry.cpp.

TextWadEntry::TextWadEntry const Lump lump  )  throw ()
 

Lump constructor.

Parameters:
lump Source lump.

Definition at line 72 of file wadentry.cpp.

References setFromLump().

TextWadEntry::~TextWadEntry void   )  throw () [virtual]
 

Destructor.

Virtual destructor for inheritance.

Definition at line 83 of file wadentry.cpp.


Member Function Documentation

std::string TextWadEntry::getName void   )  const throw () [virtual]
 

Get the name of this object.

Gets the name of this object in a std::string.

Returns:
std::string containing this object's name.

Definition at line 184 of file wadentry.cpp.

References name.

std::string TextWadEntry::getString void   )  const throw () [virtual]
 

Get the contents of this object.

Gets the contents of this object in a std::string.

Returns:
std::string containing this object's contents.

Definition at line 157 of file wadentry.cpp.

References str.

bool TextWadEntry::setFromLump const Lump lump  )  throw () [virtual]
 

Set from a Lump object.

Overwrites current state with a std::string representing what is in the source lump. Will be null-terminated automatically.

Parameters:
lump Source lump.
Returns:
True.

Implements Doomwad::WadEntry.

Definition at line 98 of file wadentry.cpp.

References setName(), and str.

Referenced by TextWadEntry().

bool TextWadEntry::setName const std::string &  newStr  )  throw () [virtual]
 

Set the name of this object.

Takes a string input and sets its name to that string.

Parameters:
newStr Input string.
Returns:
True.

Definition at line 171 of file wadentry.cpp.

References name.

Referenced by setFromLump().

bool TextWadEntry::setString const std::string &  newStr  )  throw () [virtual]
 

Set the contents of this object.

Takes a string input and sets its contents to that string.

Parameters:
newStr Input string.
Returns:
True.

Definition at line 144 of file wadentry.cpp.

References str.

Lump TextWadEntry::toLump void   )  const throw () [virtual]
 

Convert to a Lump.

Copies raw character data from this entry to a Lump. Makes sure the Lump is null-terminated.

Returns:
Lump containing this object's state.

Implements Doomwad::WadEntry.

Definition at line 116 of file wadentry.cpp.

References Doomwad::Lump::assign(), and str.

std::string TextWadEntry::toString void   )  const throw () [virtual]
 

Convert to a string.

Simply returns the object state, since it is already a string.

Returns:
std::string copy of object state.

Implements Doomwad::WadEntry.

Definition at line 130 of file wadentry.cpp.

References str.


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