28 std::ostringstream formatted_message;
32 formatted_message <<
file <<
'(' << line <<
"): ";
35 formatted_message <<
"error: ";
37 formatted_message <<
"warning: ";
41 const auto full_path = location.
full_path();
43 if(full_path.has_value() && !line.empty())
46 std::ifstream in(
widen(full_path.value()));
48 std::ifstream in(full_path.value());
52 const auto line_number = std::stoull(line);
53 std::string source_line;
54 for(std::size_t l = 0; l < line_number; l++)
55 std::getline(in, source_line);
59 formatted_message <<
'\n';
60 formatted_message <<
file <<
'(' << line <<
"): " << source_line;
void print(unsigned, const xmlt &) override
void print(unsigned, const xmlt &) override
dstringt has one field, an unsigned integer no which is an index into a static table of strings.
optionalt< std::string > full_path() const
Get a path to the file, including working directory.
const irep_idt & get_line() const
const irep_idt & get_file() const
const std::string & id2string(const irep_idt &d)
static const char * message(const statust &status)
Makes a status message string from a status.
std::wstring widen(const char *s)