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:

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 ()
 XMLElement (const string &v)
virtual ~XMLElement ()

Detailed Description

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

Definition at line 2445 of file utils.h.


Constructor & Destructor Documentation

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

Default constructor.

Definition at line 2455 of file utils.h.

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

Constructor.

Definition at line 2458 of file utils.h.

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

Destructor.

Definition at line 2461 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 2473 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 643 of file xmlparser.cpp.

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

Return the data field.

Definition at line 2479 of file utils.h.

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

Reimplemented from frepple::utils::DataElement.

Definition at line 2491 of file utils.h.

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

Reimplemented from frepple::utils::DataElement.

Definition at line 2489 of file utils.h.

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

Reimplemented from frepple::utils::DataElement.

Definition at line 2487 of file utils.h.

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

Reimplemented from frepple::utils::DataElement.

Definition at line 2481 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 2495 of file utils.h.

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

Reimplemented from frepple::utils::DataElement.

Definition at line 2485 of file utils.h.

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

Reimplemented from frepple::utils::DataElement.

Definition at line 2483 of file utils.h.

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

Reimplemented from frepple::utils::DataElement.

Definition at line 2452 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 2467 of file utils.h.

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

Set the data value of this element.

Definition at line 2476 of file utils.h.


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

Documentation generated for frePPLe by  doxygen