PSCF v1.1
Public Member Functions | List of all members
Util::XmlBase Class Reference

Base class for classes that parse XML markup tags. More...

#include <XmlBase.h>

Inheritance diagram for Util::XmlBase:
Util::XmlAttribute Util::XmlEndTag Util::XmlStartTag Util::XmlXmlTag

Public Member Functions

 XmlBase ()
 Constructor. More...
 
 ~XmlBase ()
 Destructor. More...
 
void setString (const std::string &string, int cursor=0)
 Initialize string and cursor. More...
 
void setCursor (int cursor)
 Set cursor. More...
 
void skip ()
 Skip leading white space, if any. More...
 
void next ()
 Advance to the next character. More...
 
const std::string & string () const
 Return the associated string. More...
 
int cursor () const
 Return the index of the current character. More...
 
int c () const
 Return the current character. More...
 
bool isEnd () const
 Has the cursor reached the end of the string? More...
 

Detailed Description

Base class for classes that parse XML markup tags.

Definition at line 22 of file XmlBase.h.

Constructor & Destructor Documentation

◆ XmlBase()

Util::XmlBase::XmlBase ( )

Constructor.

Definition at line 16 of file XmlBase.cpp.

◆ ~XmlBase()

Util::XmlBase::~XmlBase ( )

Destructor.

Definition at line 26 of file XmlBase.cpp.

Member Function Documentation

◆ setString()

void Util::XmlBase::setString ( const std::string &  string,
int  cursor = 0 
)

Initialize string and cursor.

Definition at line 32 of file XmlBase.cpp.

References cursor(), setCursor(), and string().

Referenced by Util::XmlAttribute::match(), Util::XmlEndTag::match(), and Util::XmlStartTag::matchLabel().

◆ setCursor()

void Util::XmlBase::setCursor ( int  cursor)

Set cursor.

String must already be set.

Definition at line 42 of file XmlBase.cpp.

References cursor(), and UTIL_THROW.

Referenced by Util::XmlAttribute::match(), and setString().

◆ skip()

void Util::XmlBase::skip ( )
inline

Skip leading white space, if any.

Definition at line 88 of file XmlBase.h.

Referenced by Util::XmlAttribute::match(), Util::XmlEndTag::match(), Util::XmlStartTag::matchAttribute(), and Util::XmlStartTag::matchLabel().

◆ next()

void Util::XmlBase::next ( )
inline

Advance to the next character.

Definition at line 104 of file XmlBase.h.

Referenced by Util::XmlAttribute::match(), Util::XmlEndTag::match(), Util::XmlStartTag::matchAttribute(), and Util::XmlStartTag::matchLabel().

◆ string()

const std::string & Util::XmlBase::string ( ) const
inline

Return the associated string.

Definition at line 118 of file XmlBase.h.

Referenced by Util::XmlStartTag::finish(), Util::XmlAttribute::match(), Util::XmlEndTag::match(), Util::XmlStartTag::matchLabel(), and setString().

◆ cursor()

int Util::XmlBase::cursor ( ) const
inline

Return the index of the current character.

Definition at line 124 of file XmlBase.h.

Referenced by Util::XmlAttribute::match(), Util::XmlEndTag::match(), Util::XmlStartTag::matchLabel(), setCursor(), and setString().

◆ c()

int Util::XmlBase::c ( ) const
inline

Return the current character.

Definition at line 130 of file XmlBase.h.

Referenced by Util::XmlAttribute::match(), Util::XmlEndTag::match(), Util::XmlStartTag::matchAttribute(), and Util::XmlStartTag::matchLabel().

◆ isEnd()

bool Util::XmlBase::isEnd ( ) const
inline

Has the cursor reached the end of the string?

Definition at line 136 of file XmlBase.h.

Referenced by Util::XmlAttribute::match(), Util::XmlEndTag::match(), Util::XmlStartTag::matchAttribute(), and Util::XmlStartTag::matchLabel().


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