aboutsummaryrefslogtreecommitdiff
path: root/bpkg/utility.hxx
diff options
context:
space:
mode:
Diffstat (limited to 'bpkg/utility.hxx')
-rw-r--r--bpkg/utility.hxx25
1 files changed, 25 insertions, 0 deletions
diff --git a/bpkg/utility.hxx b/bpkg/utility.hxx
index 8bb8fd8..1e82f44 100644
--- a/bpkg/utility.hxx
+++ b/bpkg/utility.hxx
@@ -88,6 +88,31 @@ namespace bpkg
void
clean_tmp (bool ignore_errors);
+ // Path.
+ //
+ // Normalize a path. Also make the relative path absolute using the current
+ // directory.
+ //
+ path&
+ normalize (path&, const char* what);
+
+ inline path
+ normalize (const path& f, const char* what)
+ {
+ path r (f);
+ return move (normalize (r, what));
+ }
+
+ dir_path&
+ normalize (dir_path&, const char* what);
+
+ inline dir_path
+ normalize (const dir_path& d, const char* what)
+ {
+ dir_path r (d);
+ return move (normalize (r, what));
+ }
+
// Progress.
//
extern bool stderr_term; // True if stderr is a terminal.