26 #include <metaproxy/util.hpp>
28 #define PLAINFILE_MAX_LINE 256
42 mp::PlainFile::Rep::Rep() : lineno(1)
47 mp::PlainFile::PlainFile() : m_p(new
Rep)
51 void mp::PlainFile::Rep::close()
58 mp::PlainFile::~PlainFile()
63 bool mp::PlainFile::open(
const std::string &fname)
67 std::ifstream *new_file =
new std::ifstream(fname.c_str());
77 bool mp::PlainFile::getline(std::vector<std::string> &args)
95 char first = line_cstr[0];
96 if (first && !strchr(
"# \t", first))
100 const char *cp = line_cstr;
104 while (*cp && strchr(
" \t", *cp))
108 const char *cp0 = cp;
109 while (*cp && !strchr(
" \t", *cp))
111 std::string arg(cp0, cp - cp0);
#define PLAINFILE_MAX_LINE