aboutsummaryrefslogtreecommitdiff
path: root/build/path-io
diff options
context:
space:
mode:
authorBoris Kolpackov <boris@codesynthesis.com>2015-04-20 13:01:46 +0200
committerBoris Kolpackov <boris@codesynthesis.com>2015-04-20 13:01:46 +0200
commita82cdb8fd9ba02034d296769772cdf81244da66a (patch)
tree2cd5fb0211984716780ce5fad18c19d7c4d9a794 /build/path-io
parentc775a7f28a56ef96f097e677434eceec9d8f2cdf (diff)
Automatically decide when to print relative/absolute paths
Diffstat (limited to 'build/path-io')
-rw-r--r--build/path-io23
1 files changed, 5 insertions, 18 deletions
diff --git a/build/path-io b/build/path-io
index accdb94..f5f2d4f 100644
--- a/build/path-io
+++ b/build/path-io
@@ -5,30 +5,17 @@
#ifndef BUILD_PATH_IO
#define BUILD_PATH_IO
-#include <ostream>
+#include <iosfwd>
#include <build/path>
namespace build
{
- inline std::ostream&
- operator<< (std::ostream& os, const path& p)
- {
- return os << p.string ();
- }
+ std::ostream&
+ operator<< (std::ostream&, const path&);
- inline std::ostream&
- operator<< (std::ostream& os, const dir_path& d)
- {
- const std::string& s (d.string ());
-
- // Print the directory with trailing '/'.
- //
- if (!s.empty ())
- os << s << (dir_path::traits::is_separator (s.back ()) ? "" : "/");
-
- return os;
- }
+ std::ostream&
+ operator<< (std::ostream&, const dir_path&);
}
#endif // BUILD_PATH_IO