From ed437dbd3483baa3d15d1d86d8f057d9112653b1 Mon Sep 17 00:00:00 2001 From: Karen Arutyunov Date: Wed, 14 Aug 2019 14:36:44 +0300 Subject: Add support for default options files --- bpkg/diagnostics.hxx | 19 ++++++++++++++++--- 1 file changed, 16 insertions(+), 3 deletions(-) (limited to 'bpkg/diagnostics.hxx') 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 // forward() +#include // move(), forward() #include @@ -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 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_)); } -- cgit v1.1