From 6a68b1fd2161357a5905b875e9d59609a2b829b1 Mon Sep 17 00:00:00 2001 From: Karen Arutyunov Date: Wed, 8 Dec 2021 22:46:50 +0300 Subject: Add support for package dependency and requirement alternatives representation new syntax --- libbpkg/buildfile-scanner.cxx | 38 ++++++++++++++++++++++++++++++++++++++ 1 file changed, 38 insertions(+) create mode 100644 libbpkg/buildfile-scanner.cxx (limited to 'libbpkg/buildfile-scanner.cxx') 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 + +#include + +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) + { + } +} -- cgit v1.1