21 std::string whitespaces(
" \t\n\r");
22 found = str.find_last_not_of(whitespaces);
23 if (found != std::string::npos) {
25 return int(found + 1);
37 void checkString(std::istream& in,
const std::string& expected)
41 if (actual != expected) {
42 Log::file() <<
"Error in checkString" << std::endl;
43 Log::file() <<
"Expected: " << expected << std::endl;
44 Log::file() <<
"Scanned: " << actual << std::endl;
62 bool getLine(std::istream& in, std::stringstream& line)
109 if (!
string.empty()) {
static std::ostream & file()
Get log ostream by reference.
File containing preprocessor macros for error handling.
#define UTIL_THROW(msg)
Macro for throwing an Exception, reporting function, file and line number.
void checkString(std::istream &in, const std::string &expected)
Extract string from stream, and compare to expected value.
bool getNextLine(std::istream &in, std::string &line)
Read the next non-empty line into a string, strip trailing whitespace.
std::string toString(int n)
Return string representation of an integer.
int rStrip(std::string &str)
Strip trailing whitespace from a string.
bool getLine(std::istream &in, std::stringstream &line)
Read the next line into a stringstream.
Utility classes for scientific computation.
void checkRequiredIstream(std::istream &in)
Check status of a std::istream just before reading required variable.