From 06dc23bd590d003eca6109890974ca96ed6fd1a4 Mon Sep 17 00:00:00 2001 From: Boris Kolpackov Date: Fri, 4 Sep 2015 14:13:25 +0200 Subject: Print dir_path with trailing slash --- bpkg/types | 17 ++++++++++++++++- 1 file changed, 16 insertions(+), 1 deletion(-) (limited to 'bpkg/types') diff --git a/bpkg/types b/bpkg/types index 0394d56..2ab7aea 100644 --- a/bpkg/types +++ b/bpkg/types @@ -7,9 +7,9 @@ #include #include +#include #include -#include namespace bpkg { @@ -29,6 +29,21 @@ namespace bpkg using paths = std::vector; using dir_paths = std::vector; + + inline std::ostream& + operator<< (std::ostream& os, const path& p) {return os << p.string ();} + + inline std::ostream& + operator<< (std::ostream& os, const dir_path& p) + { + const string& s (p.string ()); + os << s; + + if (!s.empty () && !dir_path::traits::is_separator (s.back ())) + os << dir_path::traits::directory_separator; + + return os; + } } #endif // BPKG_TYPES -- cgit v1.1