frepple::utils::XMLElement Class Reference

This class represents an XML element being read in from the input file. More...

#include <utils.h>

Inheritance diagram for frepple::utils::XMLElement:
frepple::utils::DataElement

List of all members.

Public Member Functions

void addData (const char *pData, size_t len)
bool getBool () const
const char * getData () const
virtual Date getDate () const
virtual double getDouble () const
virtual int getInt () const
virtual long getLong () const
virtual string getString () const
virtual TimePeriod getTimeperiod () const
virtual unsigned long getUnsignedLong () const
virtual operator bool () const
void reset ()
void setData (const char *pData)
 XMLElement (const string &v)
 XMLElement ()
virtual ~XMLElement ()

Detailed Description

This class represents an XML element being read in from the input file.

Definition at line 2517 of file utils.h.


Constructor & Destructor Documentation

frepple::utils::XMLElement::XMLElement (  )  [inline]

Default constructor.

Definition at line 2527 of file utils.h.

frepple::utils::XMLElement::XMLElement ( const string &  v  )  [inline]

Constructor.

Definition at line 2530 of file utils.h.

virtual frepple::utils::XMLElement::~XMLElement (  )  [inline, virtual]

Destructor.

Definition at line 2533 of file utils.h.


Member Function Documentation

void frepple::utils::XMLElement::addData ( const char *  pData,
size_t  len 
) [inline]

Add some characters to this data field of this element.
The second argument is the number of bytes, not the number of characters.

Definition at line 2545 of file utils.h.

bool frepple::utils::XMLElement::getBool (  )  const [virtual]

Interprets the element as a boolean value.

Our implementation is a bit more generous and forgiving than the boolean datatype that is part of the XML schema v2 standard. The standard expects the following literals:
{true, false, 1, 0}

Our implementation uses only the first charater of the text, and is case insensitive. It thus matches a wider range of values:
{t.*, T.*, f.*, F.*, 1.*, 0.*}

Reimplemented from frepple::utils::DataElement.

Definition at line 644 of file xmlparser.cpp.

const char* frepple::utils::XMLElement::getData (  )  const [inline]

Return the data field.

Definition at line 2551 of file utils.h.

virtual Date frepple::utils::XMLElement::getDate (  )  const [inline, virtual]

Reimplemented from frepple::utils::DataElement.

Definition at line 2563 of file utils.h.

virtual double frepple::utils::XMLElement::getDouble (  )  const [inline, virtual]

Reimplemented from frepple::utils::DataElement.

Definition at line 2561 of file utils.h.

virtual int frepple::utils::XMLElement::getInt (  )  const [inline, virtual]

Reimplemented from frepple::utils::DataElement.

Definition at line 2559 of file utils.h.

virtual long frepple::utils::XMLElement::getLong (  )  const [inline, virtual]

Reimplemented from frepple::utils::DataElement.

Definition at line 2553 of file utils.h.

virtual string frepple::utils::XMLElement::getString (  )  const [inline, virtual]

Returns the string value of the XML data. The xerces library takes care of appropriately unescaping special character sequences.

Reimplemented from frepple::utils::DataElement.

Definition at line 2567 of file utils.h.

virtual TimePeriod frepple::utils::XMLElement::getTimeperiod (  )  const [inline, virtual]

Reimplemented from frepple::utils::DataElement.

Definition at line 2557 of file utils.h.

virtual unsigned long frepple::utils::XMLElement::getUnsignedLong (  )  const [inline, virtual]

Reimplemented from frepple::utils::DataElement.

Definition at line 2555 of file utils.h.

virtual frepple::utils::XMLElement::operator bool (  )  const [inline, virtual]

Reimplemented from frepple::utils::DataElement.

Definition at line 2524 of file utils.h.

void frepple::utils::XMLElement::reset (  )  [inline]

Re-initializes an existing element. Using this method we can avoid destroying and recreating XMLelement objects too frequently. Instead we can manage them in a array.

Definition at line 2539 of file utils.h.

void frepple::utils::XMLElement::setData ( const char *  pData  )  [inline]

Set the data value of this element.

Definition at line 2548 of file utils.h.


The documentation for this class was generated from the following files:

Generated on 25 Sep 2009 for frePPLe by  doxygen 1.6.1