8 #include "XmlStartTag.h" 9 #include <util/misc/ioUtil.h> 28 if (
isEnd())
return false;
30 if (
isEnd())
return false;
39 int beginLabel, endLabel;
41 if (
isEnd())
return false;
42 if (
c() ==
'/')
return false;
44 if (
isEnd())
return false;
46 while (
c() !=
' ' &&
c() !=
'>') {
48 if (
isEnd())
return false;
51 label_ =
string().substr(beginLabel, endLabel - beginLabel);
59 const std::string& line,
int begin)
64 if (
label() != expected) {
66 Log::file() <<
"expected = " << expected << std::endl;
74 if (
isEnd())
return false;
78 }
else if (
c() ==
'/') {
80 if (
isEnd())
return false;
86 return attribute.
match(*
this);
bool matchLabel(const std::string &string, int begin)
Match opening bracket and any label.
bool matchAttribute(XmlAttribute &attribute)
Attempt to match an attribute.
XmlStartTag()
Constructor.
void setString(const std::string &string, int cursor=0)
Initialize string and cursor.
Parser for an XML attribute.
int cursor() const
Return the index of the current character.
#define UTIL_THROW(msg)
Macro for throwing an Exception, reporting function, file and line number.
void next()
Advance to the next character.
Utility classes for scientific computation.
const std::string label()
Label string.
bool isEnd() const
Has the cursor reached the end of the string?
static std::ostream & file()
Get log ostream by reference.
bool endBracket()
True if a closing bracket was found.
~XmlStartTag()
Destructor.
const std::string & string() const
Return the associated string.
int c() const
Return the current character.
void finish()
Check if end bracket was found.
bool match(const std::string &string, int begin)
Return true if an attribute is found, false otherwise.
void skip()
Skip leading white space, if any.