191 static uint const min_sz = inc_lit.size() + 3u;
194 bool const use_cin = (
filename ==
"-");
197 use_cin ? canonicalizePath(filepath) : filepath;
203 throw inc_exception(recursive)
213 ifs.open(filepath.c_str(), std::ifstream::in);
214 std::istream&
f = use_cin ? std::cin : ifs;
216 throw inc_exception(cant_open)
219 int const starting_linenum = 1;
220 frame new_frame(including_framenum, filepath, starting_linenum,
text_.size());
224 for (
auto&
line : getlines(f)) {
226 if (
line.find(inc_lit) != 0) {
228 new_frame.nl_positions.push_back(
text_.size());
236 new_frame.starting_linenum = linenum;
237 new_frame.starting_textpos =
text_.size();
242 if (
line.size() <= min_sz
244 ||
line[9] !=
'\"' ||
line.end()[-1] !=
'\"' 246 throw inc_exception(malformed)
247 <<
line <<
"\n at line " << linenum <<
" of file " <<
filepath;
254 new_frame.starting_linenum = linenum + 1;
255 new_frame.starting_textpos =
text_.size();
std::string & trim_right(std::string &source, std::string const &t=" ")
void include(int including_framenum, std::string const &filename, cet::filepath_maker &abs_filename)
std::string backtrace(uint from_frame) const
std::vector< std::string > recursionStack_
void line(double t, double *p, double &x, double &y, double &z)
std::vector< frame > frames_