From ace1743f7f78bb13f99553d6e97ad1beecf1ba99 Mon Sep 17 00:00:00 2001 From: Boris Kolpackov Date: Mon, 13 Apr 2015 15:50:17 +0200 Subject: Add separate type to represent directory paths --- build/context | 35 +++++++++++++++++++---------------- 1 file changed, 19 insertions(+), 16 deletions(-) (limited to 'build/context') diff --git a/build/context b/build/context index 39e00e7..0e28472 100644 --- a/build/context +++ b/build/context @@ -18,8 +18,8 @@ namespace build class scope; class file; - extern path work; - extern path home; + extern dir_path work; + extern dir_path home; // Current action (meta/operation). // @@ -54,7 +54,7 @@ namespace build // important. See the fsdir{} rule for details. // fs_status - mkdir (const path&); + mkdir (const dir_path&); // Remove the file and print the standard diagnostics. The second // argument is only used in diagnostics, to print the target name. @@ -72,39 +72,42 @@ namespace build // template fs_status - rmdir (const path&, const T& target); + rmdir (const dir_path&, const T& target); inline fs_status - rmdir (const path& d) {return rmdir (d, d);} + rmdir (const dir_path& d) {return rmdir (d, d);} // Return the src/out directory corresponding to the given out/src. The // passed directory should be a sub-directory of out/src_root. // - path - src_out (const path& out, scope&); + dir_path + src_out (const dir_path& out, scope&); - path - src_out (const path& out, const path& out_root, const path& src_root); + dir_path + src_out (const dir_path& out, + const dir_path& out_root, const dir_path& src_root); - path - out_src (const path& src, scope&); + dir_path + out_src (const dir_path& src, scope&); - path - out_src (const path& src, const path& out_root, const path& src_root); + dir_path + out_src (const dir_path& src, + const dir_path& out_root, const dir_path& src_root); // If possible and beneficial, translate an absolute, normalized path // into relative to the relative_base directory, which is normally // work. // - path - relative (const path&); + template + basic_path + relative (const basic_path&); // By default this points to work. Setting this to something else // should only be done in tightly controlled, non-parallel // situations (see dump). If base is empty, then relative() // returns the original path. // - extern const path* relative_base; + extern const dir_path* relative_base; } #include -- cgit v1.1