17 : blame_printer(std::move(blame)) {
18 if (filename.empty()) {
19 throw std::runtime_error(
"Empty filename for CodePrinter");
22 ofs.open(filename.c_str());
25 auto msg =
"Error while opening file '" + filename +
"' for CodePrinter";
26 throw std::runtime_error(msg);
63 while (start_line < lines.size()) {
64 const auto& line = lines[start_line];
72 for (
auto line_it = line.begin(); line_it != line.end() && *line_it ==
' '; ++line_it) {
78 for (
const auto& line: lines) {
79 if (line.size() < prefix_length) {
81 if (std::find_if_not(line.begin(), line.end(), [](
char c) { return c ==
' '; }) !=
83 throw std::invalid_argument(
"Indentation mismatch");
86 add_line(line.substr(prefix_length));
92 for (std::size_t i = 0; i < n; ++i) {