From ed437dbd3483baa3d15d1d86d8f057d9112653b1 Mon Sep 17 00:00:00 2001 From: Karen Arutyunov Date: Wed, 14 Aug 2019 14:36:44 +0300 Subject: Add support for default options files --- bpkg/utility.hxx | 25 +++++++++++++++++++++++++ 1 file changed, 25 insertions(+) (limited to 'bpkg/utility.hxx') 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. -- cgit v1.1