aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--bpkg/types17
1 files changed, 16 insertions, 1 deletions
diff --git a/bpkg/types b/bpkg/types
index 0394d56..2ab7aea 100644
--- a/bpkg/types
+++ b/bpkg/types
@@ -7,9 +7,9 @@
#include <vector>
#include <string>
+#include <ostream>
#include <butl/path>
-#include <butl/path-io>
namespace bpkg
{
@@ -29,6 +29,21 @@ namespace bpkg
using paths = std::vector<path>;
using dir_paths = std::vector<dir_path>;
+
+ 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