diff options
author | Karen Arutyunov <karen@codesynthesis.com> | 2019-08-14 14:36:44 +0300 |
---|---|---|
committer | Karen Arutyunov <karen@codesynthesis.com> | 2019-08-16 14:53:54 +0300 |
commit | ed437dbd3483baa3d15d1d86d8f057d9112653b1 (patch) | |
tree | cbf3974e8b1774ccccd818442cf042e501190b09 /bpkg/diagnostics.hxx | |
parent | 80ee886ca0bd3e41434621a056125c92f31b1aea (diff) |
Add support for default options files
Diffstat (limited to 'bpkg/diagnostics.hxx')
-rw-r--r-- | bpkg/diagnostics.hxx | 19 |
1 files changed, 16 insertions, 3 deletions
diff --git a/bpkg/diagnostics.hxx b/bpkg/diagnostics.hxx index 5d0fbd1..2d3ee7f 100644 --- a/bpkg/diagnostics.hxx +++ b/bpkg/diagnostics.hxx @@ -5,7 +5,7 @@ #ifndef BPKG_DIAGNOSTICS_HXX #define BPKG_DIAGNOSTICS_HXX -#include <utility> // forward() +#include <utility> // move(), forward() #include <odb/tracer.hxx> @@ -98,8 +98,8 @@ namespace bpkg // Zero lines or columns are not printed. // explicit - location (string f, uint64_t l, uint64_t c) - : file (move (f)), line (l), column (c) {} + location (string f, uint64_t l = 0, uint64_t c = 0) + : file (std::move (f)), line (l), column (c) {} location () = default; @@ -118,6 +118,11 @@ namespace bpkg const location& l) : type_ (type), name_ (name), loc_ (l) {} + location_prologue_base (const char* type, + const char* name, + const path& f) + : type_ (type), name_ (name), loc_ (f.string ()) {} + void operator() (const diag_record& r) const; @@ -151,10 +156,18 @@ namespace bpkg return location_prologue (epilogue_, type_, name_, l); } + location_prologue + operator() (const path& f) const + { + return location_prologue (epilogue_, type_, name_, f); + } + template <typename L> location_prologue operator() (const L& l) const { + // get_location() is the user-supplied ADL-searched function. + // return location_prologue ( epilogue_, type_, name_, get_location (l, data_)); } |