tjysdsg/tan

check file attributes before reading

todo opened this issue · 1 comments

todo commented

// TODO: check file attributes before reading
_filename = filename;
std::ifstream ifs(filename);
// read the whole file at once
std::string content((std::istreambuf_iterator<char>(ifs)), (std::istreambuf_iterator<char>()));
// count the number of lines


This issue was generated by todo based on a TODO comment in 12ad011 when #6 was merged. cc @tjysdsg.

Since ifstream will throw if it cannot open a file, there is no need to check beforehand.