diff options
Diffstat (limited to 'build2/utility.cxx')
-rw-r--r-- | build2/utility.cxx | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/build2/utility.cxx b/build2/utility.cxx index 971c1fb..3eda7e1 100644 --- a/build2/utility.cxx +++ b/build2/utility.cxx @@ -287,6 +287,21 @@ namespace build2 return false; } + string + apply_pattern (const char* s, const string* p) + { + if (p == nullptr) + return s; + + size_t i (p->find ('*')); + assert (i != string::npos); + + string r (*p, 0, i++); + r.append (s); + r.append (*p, i, p->size () - i); + return r; + } + unsigned int to_version (const string& s) { |