36 if (is.peek() != comment_char)
40 is.ignore(std::numeric_limits<std::streamsize>::max(),
'\n');
47 if (!line.empty() && *line.rbegin() ==
'\r')
49 line.resize(line.size()-1);
56 std::ostringstream oss;
57 oss << std::setw(digits) << std::setfill(
'0') << i;
62inline int to_int(
const std::string& str)
65 std::stringstream(str) >> i;
std::string to_padded_string(int i, int digits)
Convert an integer to a 0-padded string with the given number of digits.
void filter_dos(std::string &line)
Check for, and remove, a trailing '\r' from and std::string.
int to_int(const std::string &str)
Convert a string to an int.
void skip_comment_lines(std::istream &is, const char comment_char)
Check if the stream starts with comment_char. If so skip it.