diff options
author | Boris Kolpackov <boris@codesynthesis.com> | 2018-05-26 15:59:02 +0200 |
---|---|---|
committer | Boris Kolpackov <boris@codesynthesis.com> | 2018-05-26 15:59:02 +0200 |
commit | 2cb29a3cdff844baab3f2725f4c4ed07173ddefe (patch) | |
tree | 12c79f1c384e1e3232583f254d303753880c7906 /bpkg/diagnostics.hxx | |
parent | 50223ed214cd89de6c28bc63965438703cddfe4d (diff) |
Don't print empty location, zero line/column
Diffstat (limited to 'bpkg/diagnostics.hxx')
-rw-r--r-- | bpkg/diagnostics.hxx | 9 |
1 files changed, 8 insertions, 1 deletions
diff --git a/bpkg/diagnostics.hxx b/bpkg/diagnostics.hxx index 2816f3c..21bc157 100644 --- a/bpkg/diagnostics.hxx +++ b/bpkg/diagnostics.hxx @@ -95,10 +95,17 @@ namespace bpkg class location { public: - location () {} + // 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 () = default; + + bool + empty () const {return file.empty ();} + string file; uint64_t line; uint64_t column; |