aboutsummaryrefslogtreecommitdiff
path: root/build/diagnostics
diff options
context:
space:
mode:
authorBoris Kolpackov <boris@codesynthesis.com>2015-04-13 15:50:17 +0200
committerBoris Kolpackov <boris@codesynthesis.com>2015-04-13 15:50:17 +0200
commitace1743f7f78bb13f99553d6e97ad1beecf1ba99 (patch)
tree595bc9dad989e44f4be9a67e351219f3248dc5f0 /build/diagnostics
parent534f9d8db025d58c9ce23f3b81a37e8c34386a27 (diff)
Add separate type to represent directory paths
Diffstat (limited to 'build/diagnostics')
-rw-r--r--build/diagnostics14
1 files changed, 9 insertions, 5 deletions
diff --git a/build/diagnostics b/build/diagnostics
index 3ec80a3..09adaca 100644
--- a/build/diagnostics
+++ b/build/diagnostics
@@ -14,7 +14,8 @@
#include <exception>
#include <type_traits>
-#include <build/path> // <build/path-io> included at the end.
+#include <build/path>
+#include <build/path-io>
namespace build
{
@@ -24,12 +25,17 @@ namespace build
class failed: public std::exception {};
// In addition to calling relative(), this function also uses shorter
- // notations such as '~/'. If the path is the same as base, it returns
- // '.'.
+ // notations such as '~/'.
//
std::string
diag_relative (const path&);
+ // As above but also adds trailing '/'. If the path is the same as
+ // base, returns "./" if current is true and empty string otherwise.
+ //
+ std::string
+ diag_relative (const dir_path&, bool current = true);
+
// Action phrases, e.g., "configure update exe{foo}", "updating exe{foo}",
// and "updating exe{foo} already configured".
//
@@ -357,6 +363,4 @@ namespace build
extern const fail_mark<failed> fail;
}
-#include <build/path-io>
-
#endif // BUILD_DIAGNOSTICS