aboutsummaryrefslogtreecommitdiff
path: root/libbuild2/utility.hxx
diff options
context:
space:
mode:
authorBoris Kolpackov <boris@codesynthesis.com>2019-10-08 09:33:45 +0200
committerBoris Kolpackov <boris@codesynthesis.com>2019-10-08 09:33:45 +0200
commitd730f40440e213bc08cce4587439960c80ad9aa5 (patch)
treeec0d488f7dd83238accaab33db8660ae32b60870 /libbuild2/utility.hxx
parent2c8b400010ffedec596969f64e79144f99d73f62 (diff)
Redo bin pattern as PATH-like search paths rather than fallback directory
Also, unlike the fallback directory, the search paths are searched first rather than last.
Diffstat (limited to 'libbuild2/utility.hxx')
-rw-r--r--libbuild2/utility.hxx17
1 files changed, 15 insertions, 2 deletions
diff --git a/libbuild2/utility.hxx b/libbuild2/utility.hxx
index 8256fa4..c362b34 100644
--- a/libbuild2/utility.hxx
+++ b/libbuild2/utility.hxx
@@ -225,7 +225,8 @@ namespace build2
try_run_search (const path&,
bool init = false,
const dir_path& fallback = dir_path (),
- bool path_only = false);
+ bool path_only = false,
+ const char* paths = nullptr);
// Wait for process termination. Issue diagnostics and throw failed in case
// of abnormal termination. If the process has terminated normally but with
@@ -674,7 +675,19 @@ namespace build2
// i.e., contains a single '*' character.
//
LIBBUILD2_SYMEXPORT string
- apply_pattern (const char* stem, const string* pattern);
+ apply_pattern (const char* stem, const char* pattern);
+
+ inline string
+ apply_pattern (const char* s, const string* p)
+ {
+ return apply_pattern (s, p != nullptr ? p->c_str () : nullptr);
+ }
+
+ inline string
+ apply_pattern (const char* s, const string& p)
+ {
+ return apply_pattern (s, p.c_str ());
+ }
}
#include <libbuild2/utility.ixx>