#pragma once #include "types.hh" #include #include // #include using std::string; using std::optional; // using boost::format; namespace nix { enum ErrLevel { elWarning , elError }; class ColumnRange { public: unsigned int start; unsigned int len; }; class ErrLine { public: int lineNumber; optional columnRange; optional prevLineOfCode; string errLineOfCode; optional nextLineOfCode; }; class NixCode { public: optional nixFile; optional errLine; }; class ErrorInfo { public: ErrLevel level; string errName; string description; string toolName; optional nixCode; string hint; }; string showErrLine(ErrLine &errLine); void print_code_lines(string &prefix, NixCode &nix_code); void print_error(ErrorInfo &einfo); }