diff options
author | Boris Kolpackov <boris@codesynthesis.com> | 2012-05-10 17:54:18 +0200 |
---|---|---|
committer | Boris Kolpackov <boris@codesynthesis.com> | 2012-05-10 17:54:18 +0200 |
commit | 443293aaf09eca7c3b88d621d056c4effee2c248 (patch) | |
tree | a35c7b2354295b5b73462c0806e04e2deef58171 /cli/options.ixx | |
parent | 4f9022f24c4591391637121c7274d9855b37bd93 (diff) |
Implement option class inheritance
For now multiple, non-virtual inheritance is supported. An option class
can now also be declared abstract using the class c = 0 {...}; syntax.
New option, --exclude-base, controls whether base class information is
present in usage and documentation.
Diffstat (limited to 'cli/options.ixx')
-rw-r--r-- | cli/options.ixx | 41 |
1 files changed, 41 insertions, 0 deletions
diff --git a/cli/options.ixx b/cli/options.ixx index f2072fe..05c9f9a 100644 --- a/cli/options.ixx +++ b/cli/options.ixx @@ -141,8 +141,12 @@ namespace cli bool erase) : argv_scanner (argc, argv, erase), option_ (option), + options_ (&option_info_), + options_count_ (1), skip_ (false) { + option_info_.option = option_.c_str (); + option_info_.search_func = 0; } inline argv_file_scanner:: @@ -153,6 +157,37 @@ namespace cli bool erase) : argv_scanner (start, argc, argv, erase), option_ (option), + options_ (&option_info_), + options_count_ (1), + skip_ (false) + { + option_info_.option = option_.c_str (); + option_info_.search_func = 0; + } + + inline argv_file_scanner:: + argv_file_scanner (int& argc, + char** argv, + const option_info* options, + std::size_t options_count, + bool erase) + : argv_scanner (argc, argv, erase), + options_ (options), + options_count_ (options_count), + skip_ (false) + { + } + + inline argv_file_scanner:: + argv_file_scanner (int start, + int& argc, + char** argv, + const option_info* options, + std::size_t options_count, + bool erase) + : argv_scanner (start, argc, argv, erase), + options_ (options), + options_count_ (options_count), skip_ (false) { } @@ -233,6 +268,12 @@ option_length () const return this->option_length_; } +inline const bool& options:: +exclude_base () const +{ + return this->exclude_base_; +} + inline const std::string& options:: cli_namespace () const { |