58 std::set<size_t> m_blocks;
63 bool next_line(std::string &line);
67 typedef std::string current_type;
80 bool next(std::string &line);
82 const std::string& get_name()
const;
85 void seek(
const std::streampos position);
88 template<
typename Cmp>
89 void seek_to(Cmp cmp,
const std::string& key)
94 if(m_in[0].tellg()==std::streampos(-1))
102 template<
typename Cmp>
108 if(m_in[0].tellg()==std::streampos(-1))
110 +
" is not seekable");
119 void set_blocks(
const size_t blocksize,
const std::set<size_t>& blocks);
132 line_reader(
const std::string& fn,compare_type cmp=compare_type());
134 line_reader(std::istream*
const in,compare_type cmp=compare_type());
142 const std::string& get_name()
const;
145 void seek(
const std::streampos position);
147 void set_blocks(
const size_t blocksize,
const std::set<size_t>& blocks);
150 void seek_to(
const std::string& key);
168 typedef std::string append_type;
174 void append(
const std::string& s);
193 std::string m_header;
196 std::multimap<size_t,std::string*> m_colmap;
200 section():beg(0),
end(0),str(0),indent(0) {}
202 section(
size_t b,
size_t e,std::string* s)
203 :beg(b),
end(e),str(s)
217 std::string m_filename;
218 std::vector<std::string> m_colspec;
219 std::set<std::string> m_optionalcolumns;
221 std::vector<std::string> m_current;
223 std::vector<section> m_sections;
225 std::string m_editbuf;
232 void read_header(
const std::string& qcomm);
236 typedef std::vector<std::string> current_type;
238 row_reader(
const std::string& fn,
const std::vector<std::string>& colspec,
239 line_reader::compare_type cmp=line_reader::compare_type());
242 row_reader(
const std::string& fn,
const size_t ncol,
243 line_reader::compare_type cmp=line_reader::compare_type());
245 template<
typename Iterator>
246 row_reader(
const std::string& fn,Iterator bcolspec,Iterator ecolspec,
247 line_reader::compare_type cmp=line_reader::compare_type())
248 :m_linereader(fn,cmp),
252 m_colspec(bcolspec,ecolspec),
253 m_current(m_colspec.size()),
254 m_sections(m_colspec.size()),
258 row_reader(
const std::string& fn,
const std::vector<std::string>& colspec,
260 line_reader::compare_type cmp=line_reader::compare_type());
262 template<
typename Iterator>
263 row_reader(
const std::string& fn,Iterator bcolspec,Iterator ecolspec,
265 line_reader::compare_type cmp=line_reader::compare_type())
266 :m_linereader(fn,cmp),
270 m_colspec(bcolspec,ecolspec),
271 m_current(m_colspec.size()),
272 m_sections(m_colspec.size()),
278 row_reader(std::istream*
const in,
const std::vector<std::string>& colspec,
279 line_reader::compare_type cmp=line_reader::compare_type());
281 template<
typename Iterator>
282 row_reader(std::istream*
const in,Iterator bcolspec,Iterator ecolspec,
283 line_reader::compare_type cmp=line_reader::compare_type())
284 :m_linereader(in,cmp),
287 m_filename(
"<stream>"),
288 m_colspec(bcolspec,ecolspec),
289 m_current(m_colspec.size()),
290 m_sections(m_colspec.size()),
294 row_reader(std::istream*
const in,
const std::vector<std::string>& colspec,
296 line_reader::compare_type cmp=line_reader::compare_type());
298 template<
typename Iterator>
299 row_reader(std::istream*
const in,Iterator bcolspec,Iterator ecolspec,
301 line_reader::compare_type cmp=line_reader::compare_type())
302 :m_linereader(in,cmp),
305 m_filename(
"<stream>"),
306 m_colspec(bcolspec,ecolspec),
307 m_current(m_colspec.size()),
308 m_sections(m_colspec.size()),
316 row_reader(
const std::string& fn,
const std::string& colspec,
317 line_reader::compare_type cmp=line_reader::compare_type());
319 row_reader(
const std::string& fn,
const std::string& colspec,
321 line_reader::compare_type cmp=line_reader::compare_type());
323 row_reader(std::istream*
const in,
const std::string& colspec,
324 line_reader::compare_type cmp=line_reader::compare_type());
326 row_reader(std::istream*
const in,
const std::string& colspec,
328 line_reader::compare_type cmp=line_reader::compare_type());
335 m_linereader.set_commentchar(c);
347 const std::string& get_header()
const;
351 const std::vector<std::string>& current()
const;
355 const std::string& current_line()
const;
357 void edit(
const size_t col,
const std::string& s);
359 const std::string& current_edit();
361 std::string spec_str();
364 size_t get_filecol(
const size_t readercol);
366 void seek(
const std::streampos position);
374 #endif // IO_TEXT_HPP__