diff options
Diffstat (limited to 'Source/cmArgumentParser.h')
| -rw-r--r-- | Source/cmArgumentParser.h | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/Source/cmArgumentParser.h b/Source/cmArgumentParser.h index 8fda8b7..ae3a000 100644 --- a/Source/cmArgumentParser.h +++ b/Source/cmArgumentParser.h @@ -64,6 +64,7 @@ AsParseResultPtr(Result&) class Instance; using KeywordAction = std::function<void(Instance&)>; +using KeywordNameAction = std::function<void(Instance&, cm::string_view)>; // using KeywordActionMap = cm::flat_map<cm::string_view, KeywordAction>; class KeywordActionMap @@ -79,6 +80,7 @@ class ActionMap { public: KeywordActionMap Keywords; + KeywordNameAction KeywordMissingValue; }; class Base @@ -100,6 +102,12 @@ public: assert(inserted); static_cast<void>(inserted); } + + void BindKeywordMissingValue(KeywordNameAction action) + { + assert(!this->Bindings.KeywordMissingValue); + this->Bindings.KeywordMissingValue = std::move(action); + } }; class Instance @@ -233,6 +241,9 @@ public: } protected: + using Base::Instance; + using Base::BindKeywordMissingValue; + template <typename T> bool Bind(cm::string_view name, T& ref) { |
