diff options
author | Boris Kolpackov <boris@codesynthesis.com> | 2018-01-05 15:06:24 +0200 |
---|---|---|
committer | Boris Kolpackov <boris@codesynthesis.com> | 2018-01-05 15:10:01 +0200 |
commit | d6427addaf7de41d401dd2a871b4789022e5f7cf (patch) | |
tree | 49d98807682116c04fc11842f2fb53745434820a /build2/utility.hxx | |
parent | 1eff61b00307b9f0081dbf062f6f55e5d4771e52 (diff) |
Extend find_option_prefix() to return option
Diffstat (limited to 'build2/utility.hxx')
-rw-r--r-- | build2/utility.hxx | 25 |
1 files changed, 14 insertions, 11 deletions
diff --git a/build2/utility.hxx b/build2/utility.hxx index db6460c..cfdaee0 100644 --- a/build2/utility.hxx +++ b/build2/utility.hxx @@ -511,51 +511,54 @@ namespace build2 bool find_options (initializer_list<const char*>, const cstrings&, bool = false); - // As above but look for an option that has the specified prefix. + // As above but look for an option that has the specified prefix. Return the + // pointer to option or NULL if not found (thus can be used as bool). + // Search backward (which is normall consistent with how options override + // each other). // template <typename T> - bool + const string* find_option_prefix (const char* prefix, T&, const variable&, bool = false); template <typename T> - bool + const string* find_option_prefix (const char* prefix, T&, const char*, bool = false); - bool + const string* find_option_prefix (const char* prefix, const lookup&, bool = false); - bool + const string* find_option_prefix (const char* prefix, const strings&, bool = false); - bool + const char* find_option_prefix (const char* prefix, const cstrings&, bool = false); // As above but look for several option prefixes. // template <typename T> - bool + const string* find_option_prefixes (initializer_list<const char*>, T&, const variable&, bool = false); template <typename T> - bool + const string* find_option_prefixes (initializer_list<const char*>, T&, const char*, bool = false); - bool + const string* find_option_prefixes (initializer_list<const char*>, const lookup&, bool = false); - bool + const string* find_option_prefixes (initializer_list<const char*>, const strings&, bool = false); - bool + const char* find_option_prefixes (initializer_list<const char*>, const cstrings&, bool = false); |