9 #include <util/misc/ioUtil.h> 26 if (
isEnd())
return false;
28 if (
isEnd())
return false;
36 if (
isEnd())
return false;
43 int beginLabel, endLabel;
46 if (
isEnd())
return false;
48 while (
c() !=
'>' &&
c() !=
' ') {
50 if (
isEnd())
return false;
53 label_ =
string().substr(beginLabel, endLabel - beginLabel);
56 if (
isEnd())
return false;
66 const std::string& line,
int begin)
68 if (!
match(line, begin)) {
69 Log::file() <<
"line = " << line << std::endl;
72 if (
label() != expected) {
73 Log::file() <<
"line = " << line << std::endl;
74 Log::file() <<
"expected = " << expected << std::endl;
void setString(const std::string &string, int cursor=0)
Initialize string and cursor.
int cursor() const
Return the index of the current character.
const std::string label()
Label string.
#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.
bool isEnd() const
Has the cursor reached the end of the string?
static std::ostream & file()
Get log ostream by reference.
const std::string & string() const
Return the associated string.
int c() const
Return the current character.
bool match(const std::string &string, int begin)
Attempt to match any end tag.
void skip()
Skip leading white space, if any.