Simpatico  v1.10
List of all members | Public Member Functions
Util::XmlEndTag Class Reference

Detailed Description

Parser for an XML end tag.

Definition at line 24 of file XmlEndTag.h.

#include <XmlEndTag.h>

Inheritance diagram for Util::XmlEndTag:
Util::XmlBase

Public Member Functions

 XmlEndTag ()
 Constructor. More...
 
 ~XmlEndTag ()
 Destructor. More...
 
bool match (const std::string &string, int begin)
 Attempt to match any end tag. More...
 
void match (const std::string expected, const std::string &string, int begin)
 Match a required end tag. More...
 
const std::string label ()
 Label string. More...
 
- Public Member Functions inherited from Util::XmlBase
 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...
 

Constructor & Destructor Documentation

Util::XmlEndTag::XmlEndTag ( )

Constructor.

Definition at line 14 of file XmlEndTag.cpp.

Util::XmlEndTag::~XmlEndTag ( )

Destructor.

Definition at line 17 of file XmlEndTag.cpp.

Member Function Documentation

bool Util::XmlEndTag::match ( const std::string &  string,
int  begin 
)

Attempt to match any end tag.

Return true if end tag found, false otherwise.

Parameters
stringcontaining text of XML tag
beginindex of first character

Definition at line 20 of file XmlEndTag.cpp.

References Util::XmlBase::c(), Util::XmlBase::cursor(), Util::XmlBase::isEnd(), Util::XmlBase::next(), Util::XmlBase::setString(), Util::XmlBase::skip(), and Util::XmlBase::string().

Referenced by match(), and Tools::HoomdConfigReader::readConfig().

void Util::XmlEndTag::match ( const std::string  expected,
const std::string &  string,
int  begin 
)

Match a required end tag.

Throw exception is specified end tag does not match.

Parameters
expectedexpected label string
stringcontaining text of XML tag
beginindex of first character

Definition at line 65 of file XmlEndTag.cpp.

References Util::Log::file(), label(), match(), and UTIL_THROW.

const std::string Util::XmlEndTag::label ( )
inline

Label string.

Definition at line 64 of file XmlEndTag.h.

Referenced by match(), and Tools::HoomdConfigReader::readConfig().


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