From 882583f64e517ab232edb6bbb7433631c655c9da Mon Sep 17 00:00:00 2001 From: Boris Kolpackov Date: Thu, 7 Nov 2019 11:12:43 +0200 Subject: Initial work on path_name use for `-` to stdin/stdout translation --- libbuild2/types.hxx | 22 +++++++++++++++------- 1 file changed, 15 insertions(+), 7 deletions(-) (limited to 'libbuild2/types.hxx') diff --git a/libbuild2/types.hxx b/libbuild2/types.hxx index b14a365..192b01f 100644 --- a/libbuild2/types.hxx +++ b/libbuild2/types.hxx @@ -227,6 +227,7 @@ namespace build2 // // using butl::path; + using butl::path_name; using butl::dir_path; using butl::path_cast; using butl::basic_path; @@ -274,13 +275,13 @@ namespace build2 using butl::sha256; // - // - // using butl::process; using butl::process_env; using butl::process_path; using butl::process_error; + // + // using butl::auto_fd; using butl::ifdstream; using butl::ofdstream; @@ -319,12 +320,16 @@ namespace build2 location (const path* f = nullptr, uint64_t l = 0, uint64_t c = 0) : file (f), line (l), column (c) {} + explicit + location (const path_name& f, uint64_t l = 0, uint64_t c = 0) + : file (f), line (l), column (c) {} + bool - empty () const {return file == nullptr;} + empty () const {return file.path == nullptr;} - const path* file; - uint64_t line; - uint64_t column; + path_name file; + uint64_t line; + uint64_t column; }; // See context. @@ -342,11 +347,14 @@ namespace build2 // namespace std { - // Path printing with trailing slash for directories. + // Path printing potentially relative with trailing slash for directories. // LIBBUILD2_SYMEXPORT ostream& operator<< (ostream&, const ::butl::path&); + LIBBUILD2_SYMEXPORT ostream& + operator<< (ostream&, const ::butl::path_name&); + // Print as recall[@effect]. // LIBBUILD2_SYMEXPORT ostream& -- cgit v1.1