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

cppdom::XMLToken Class Reference

an XMLToken is a representation for a literal character or a generic string (not recognized as a literal). More...

#include <xmltokenizer.h>

List of all members.

Public Methods

 XMLToken ()
 XMLToken (char ch)
 XMLToken (const std::string &str)
bool isLiteral () const
 returns if token is a literal. More...

bool isEndOfStream () const
 returns if it is and end of xml stream token. More...

char getLiteral () const
 returns literal char. More...

const std::string & getGeneric () const
 returns generic string. More...

bool operator== (char ch) const
 compare operator for literals. More...

bool operator!= (char ch) const
 compare operator for literals. More...

bool operator== (const std::string &str) const
 compare operator for a generic string. More...

bool operator!= (const std::string &str) const
 compare operator for a generic string. More...

XMLToken & operator= (const std::string &str)
 set generic string. More...

XMLToken & operator= (char ch)
 set literal char. More...


Protected Attributes

bool mIsLiteral
 indicates if token is a literal char. More...

char mLiteral
 literal. More...

std::string mGeneric
 pointer to string. More...


Friends

class xmlstream_iterator


Detailed Description

an XMLToken is a representation for a literal character or a generic string (not recognized as a literal).

Definition at line 61 of file xmltokenizer.h.


Constructor & Destructor Documentation

cppdom::XMLToken::XMLToken  
 

Definition at line 54 of file xmltokenizer.cpp.

00055       : mIsLiteral(true)
00056       , mLiteral(0)
00057    {}

cppdom::XMLToken::XMLToken char    ch
 

Definition at line 59 of file xmltokenizer.cpp.

00060       : mIsLiteral(true)
00061       , mLiteral(ch)
00062    {}

cppdom::XMLToken::XMLToken const std::string &    str
 

Definition at line 64 of file xmltokenizer.cpp.

00065       : mIsLiteral(false)
00066       , mLiteral(0)
00067       , mGeneric(str)
00068    {}


Member Function Documentation

const std::string & cppdom::XMLToken::getGeneric   const
 

returns generic string.

Definition at line 85 of file xmltokenizer.cpp.

References mGeneric.

Referenced by cppdom::XMLParser::parseAttributes(), cppdom::XMLParser::parseHeader(), and cppdom::XMLParser::parseNode().

00086    {
00087       return mGeneric;
00088    }

char cppdom::XMLToken::getLiteral   const
 

returns literal char.

Definition at line 80 of file xmltokenizer.cpp.

References mLiteral.

Referenced by cppdom::XMLParser::parseHeader(), and cppdom::XMLParser::parseNode().

00081    {
00082       return mLiteral;
00083    }

bool cppdom::XMLToken::isEndOfStream   const
 

returns if it is and end of xml stream token.

Definition at line 75 of file xmltokenizer.cpp.

References mIsLiteral, and mLiteral.

Referenced by cppdom::XMLParser::parseNode().

00076    {
00077       return mIsLiteral && mLiteral == char(EOF);
00078    }

bool cppdom::XMLToken::isLiteral   const
 

returns if token is a literal.

Definition at line 70 of file xmltokenizer.cpp.

References mIsLiteral.

Referenced by operator==(), cppdom::XMLParser::parseAttributes(), cppdom::XMLParser::parseHeader(), and cppdom::XMLParser::parseNode().

00071    {
00072       return mIsLiteral;
00073    }

bool cppdom::XMLToken::operator!= const std::string &    str const
 

compare operator for a generic string.

Definition at line 105 of file xmltokenizer.cpp.

References operator==().

00106    {
00107       return ! operator==(str);
00108    }

bool cppdom::XMLToken::operator!= char    ch const
 

compare operator for literals.

Definition at line 95 of file xmltokenizer.cpp.

References operator==().

00096    {
00097       return ! operator==(ch);
00098    }

XMLToken & cppdom::XMLToken::operator= char    ch
 

set literal char.

Definition at line 117 of file xmltokenizer.cpp.

References mIsLiteral, and mLiteral.

00118    {
00119       mLiteral = ch;
00120       mIsLiteral = true;
00121       return *this;
00122    }

XMLToken & cppdom::XMLToken::operator= const std::string &    str
 

set generic string.

Definition at line 110 of file xmltokenizer.cpp.

References mGeneric, and mIsLiteral.

00111    {
00112       mGeneric = str;
00113       mIsLiteral = false;
00114       return *this;
00115    }

bool cppdom::XMLToken::operator== const std::string &    str const
 

compare operator for a generic string.

Definition at line 100 of file xmltokenizer.cpp.

References isLiteral(), and mGeneric.

00101    {
00102       return !isLiteral() ? str == mGeneric : false;
00103    }

bool cppdom::XMLToken::operator== char    ch const
 

compare operator for literals.

Definition at line 90 of file xmltokenizer.cpp.

References isLiteral(), and mLiteral.

Referenced by operator!=().

00091    {
00092       return !isLiteral() ? false : ch == mLiteral;
00093    }


Friends And Related Function Documentation

friend class xmlstream_iterator [friend]
 

Definition at line 63 of file xmltokenizer.h.


Member Data Documentation

std::string cppdom::XMLToken::mGeneric [protected]
 

pointer to string.

Definition at line 109 of file xmltokenizer.h.

Referenced by getGeneric(), operator=(), and operator==().

bool cppdom::XMLToken::mIsLiteral [protected]
 

indicates if token is a literal char.

Definition at line 103 of file xmltokenizer.h.

Referenced by isEndOfStream(), isLiteral(), and operator=().

char cppdom::XMLToken::mLiteral [protected]
 

literal.

Definition at line 106 of file xmltokenizer.h.

Referenced by getLiteral(), isEndOfStream(), operator=(), and operator==().


The documentation for this class was generated from the following files:
Generated on Thu Jan 2 21:29:22 2003 for cppdom by doxygen1.2.15