diff options
Diffstat (limited to 'libbpkg/buildfile-scanner.cxx')
-rw-r--r-- | libbpkg/buildfile-scanner.cxx | 38 |
1 files changed, 38 insertions, 0 deletions
diff --git a/libbpkg/buildfile-scanner.cxx b/libbpkg/buildfile-scanner.cxx new file mode 100644 index 0000000..ec73d83 --- /dev/null +++ b/libbpkg/buildfile-scanner.cxx @@ -0,0 +1,38 @@ +// file : libbpkg/buildfile-scanner.cxx -*- C++ -*- +// license : MIT; see accompanying LICENSE file + +#include <libbpkg/buildfile-scanner.hxx> + +#include <string> + +using namespace std; + +namespace bpkg +{ + // buildfile_scanning + // + static inline string + format (const string& n, uint64_t l, uint64_t c, const string& d) + { + string r; + if (!n.empty ()) + { + r += n; + r += ':'; + } + + r += to_string (l); + r += ':'; + r += to_string (c); + r += ": error: "; + r += d; + return r; + } + + buildfile_scanning:: + buildfile_scanning (const string& n, uint64_t l, uint64_t c, const string& d) + : runtime_error (format (n, l, c, d)), + name (n), line (l), column (c), description (d) + { + } +} |