aboutsummaryrefslogtreecommitdiff
path: root/build/context
diff options
context:
space:
mode:
Diffstat (limited to 'build/context')
-rw-r--r--build/context21
1 files changed, 21 insertions, 0 deletions
diff --git a/build/context b/build/context
index 4c86b14..a369ade 100644
--- a/build/context
+++ b/build/context
@@ -5,6 +5,9 @@
#ifndef BUILD_CONTEXT
#define BUILD_CONTEXT
+#include <string>
+#include <ostream>
+
#include <build/path>
namespace build
@@ -17,6 +20,24 @@ namespace build
extern path src_base;
extern path out_base;
+
+ // If possible, translate an absolute, normalized path into relative to
+ // the work directory.
+ //
+ path
+ translate (const path&);
+
+ // In addition to calling translate() above, this function also uses
+ // shorter notations such as ~/.
+ //
+ std::string
+ diagnostic_string (const path&);
+
+ inline std::ostream&
+ operator<< (std::ostream& os, const path& p)
+ {
+ return os << diagnostic_string (p);
+ }
}
#endif // BUILD_CONTEXT