Simpatico
v1.10
|
Parser for an XML start tag.
Usage:
Definition at line 36 of file XmlStartTag.h.
#include <XmlStartTag.h>
Public Member Functions | |
XmlStartTag () | |
Constructor. More... | |
~XmlStartTag () | |
Destructor. More... | |
bool | matchLabel (const std::string &string, int begin) |
Match opening bracket and any label. More... | |
void | matchLabel (const std::string expected, const std::string &string, int begin) |
Match opening bracket and a specific required label. More... | |
bool | matchAttribute (XmlAttribute &attribute) |
Attempt to match an attribute. More... | |
void | finish () |
Check if end bracket was found. More... | |
const std::string | label () |
Label string. More... | |
bool | endBracket () |
True if a closing bracket was found. More... | |
![]() | |
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... | |
Util::XmlStartTag::XmlStartTag | ( | ) |
Constructor.
Definition at line 14 of file XmlStartTag.cpp.
Util::XmlStartTag::~XmlStartTag | ( | ) |
Destructor.
Definition at line 18 of file XmlStartTag.cpp.
bool Util::XmlStartTag::matchLabel | ( | const std::string & | string, |
int | begin | ||
) |
Match opening bracket and any label.
string | containing text of XML tag |
begin | index of first character |
Definition at line 21 of file XmlStartTag.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 matchLabel(), and Tools::HoomdConfigReader::readConfig().
void Util::XmlStartTag::matchLabel | ( | const std::string | expected, |
const std::string & | string, | ||
int | begin | ||
) |
Match opening bracket and a specific required label.
Throws exception if no match.
expected | expected label string |
string | containing text of XML tag |
begin | index of first character |
Definition at line 58 of file XmlStartTag.cpp.
References Util::Log::file(), label(), matchLabel(), and UTIL_THROW.
bool Util::XmlStartTag::matchAttribute | ( | XmlAttribute & | attribute | ) |
Attempt to match an attribute.
attribute | on return, matched attribute, if any |
Definition at line 71 of file XmlStartTag.cpp.
References Util::XmlBase::c(), Util::XmlBase::isEnd(), Util::XmlAttribute::match(), Util::XmlBase::next(), and Util::XmlBase::skip().
Referenced by Tools::HoomdConfigReader::readConfig().
void Util::XmlStartTag::finish | ( | ) |
Check if end bracket was found.
Throws exception if no end bracket was found.
Definition at line 93 of file XmlStartTag.cpp.
References endBracket(), Util::Log::file(), Util::XmlBase::string(), and UTIL_THROW.
Referenced by Tools::HoomdConfigReader::readConfig().
|
inline |
Label string.
Definition at line 90 of file XmlStartTag.h.
Referenced by matchLabel(), and Tools::HoomdConfigReader::readConfig().
|
inline |
True if a closing bracket was found.
Definition at line 96 of file XmlStartTag.h.
Referenced by finish().