From f763a99a501650eff2c60288aa6f10ef916d769e Mon Sep 17 00:00:00 2001 From: DongHun Kwak Date: Thu, 6 Oct 2016 10:41:18 +0900 Subject: Imported Upstream version 1.62.0 Change-Id: I9d4c1ddb7b7d8f0069217ecc582700f9fda6dd4c Signed-off-by: DongHun Kwak --- libs/program_options/doc/autodoc.xml | 60 +- .../doc/html/BOOST_PROGRAM_OPTIONS_DECL.html | 49 -- .../doc/html/BOOST_PROGRAM_OPTIONS_VERSION.html | 52 -- .../doc/html/boost/environment_iterator.html | 77 --- .../doc/html/boost/eof_iterator.html | 111 ---- .../program_options/abstract_variables_map.html | 125 ----- .../boost/program_options/ambiguous_option.html | 90 --- .../program_options/basic_command_line_parser.html | 120 ---- .../html/boost/program_options/basic_option.html | 110 ---- .../basic_parsed_op_idp8181920.html | 96 ---- .../program_options/basic_parsed_options.html | 95 ---- .../html/boost/program_options/bool_switch.html | 55 -- .../program_options/collect_unrecognized.html | 57 -- .../program_options/collect_unrecognized_mode.html | 55 -- .../command_line_style/style_t.html | 111 ---- .../program_options/duplicate_option_error.html | 65 --- .../doc/html/boost/program_options/error.html | 65 --- .../program_options/error_with_no_option_name.html | 85 --- .../program_options/error_with_option_name.html | 159 ------ .../doc/html/boost/program_options/ext_parser.html | 54 -- .../boost/program_options/invalid_bool_value.html | 65 --- .../invalid_command_idp6969504.html | 74 --- .../invalid_command_line_style.html | 65 --- .../invalid_config_file_syntax.html | 81 --- .../program_options/invalid_option_value.html | 69 --- .../html/boost/program_options/invalid_syntax.html | 101 ---- .../program_options/multiple_occurrences.html | 71 --- .../boost/program_options/multiple_values.html | 69 --- .../doc/html/boost/program_options/notify.html | 54 -- .../boost/program_options/option_description.html | 145 ----- .../options_descrip_idp8075600.html | 85 --- .../boost/program_options/options_description.html | 146 ----- .../boost/program_options/parse_command_line.html | 58 -- .../parse_config_fi_idp5606176.html | 58 -- .../parse_config_fi_idp8590400.html | 59 -- .../parse_environme_idp6765216.html | 55 -- .../parse_environme_idp6997248.html | 58 -- .../parse_environme_idp7001408.html | 56 -- .../positional_opti_idp5922480.html | 91 --- .../html/boost/program_options/reading_file.html | 65 --- .../boost/program_options/required_option.html | 69 --- .../doc/html/boost/program_options/split_unix.html | 62 --- .../boost/program_options/store_idp6705280.html | 56 -- .../boost/program_options/store_idp6709808.html | 55 -- .../too_many_positi_idp7389984.html | 67 --- .../html/boost/program_options/typed_value.html | 158 ------ .../boost/program_options/typed_value_base.html | 73 --- .../html/boost/program_options/unknown_option.html | 71 --- .../html/boost/program_options/untyped_value.html | 122 ---- .../boost/program_options/validation_error.html | 89 --- .../doc/html/boost/program_options/value.html | 55 -- .../html/boost/program_options/value_semantic.html | 121 ---- .../value_semantic__idp8632624.html | 62 --- .../value_semantic__idp8634400.html | 83 --- .../value_semantic__idp9236160.html | 83 --- .../html/boost/program_options/variable_value.html | 118 ---- .../html/boost/program_options/variables_map.html | 137 ----- .../doc/html/boost/program_options/wvalue.html | 55 -- libs/program_options/doc/html/index.html | 123 ---- libs/program_options/doc/html/index/s06.html | 96 ---- .../doc/html/program_option_HTML.manifest | 64 --- .../doc/html/program_options/design.html | 202 ------- .../doc/html/program_options/howto.html | 453 --------------- .../doc/html/program_options/overview.html | 617 --------------------- .../doc/html/program_options/reference.html | 244 -------- .../doc/html/program_options/tutorial.html | 370 ------------ 66 files changed, 23 insertions(+), 6898 deletions(-) delete mode 100644 libs/program_options/doc/html/BOOST_PROGRAM_OPTIONS_DECL.html delete mode 100644 libs/program_options/doc/html/BOOST_PROGRAM_OPTIONS_VERSION.html delete mode 100644 libs/program_options/doc/html/boost/environment_iterator.html delete mode 100644 libs/program_options/doc/html/boost/eof_iterator.html delete mode 100644 libs/program_options/doc/html/boost/program_options/abstract_variables_map.html delete mode 100644 libs/program_options/doc/html/boost/program_options/ambiguous_option.html delete mode 100644 libs/program_options/doc/html/boost/program_options/basic_command_line_parser.html delete mode 100644 libs/program_options/doc/html/boost/program_options/basic_option.html delete mode 100644 libs/program_options/doc/html/boost/program_options/basic_parsed_op_idp8181920.html delete mode 100644 libs/program_options/doc/html/boost/program_options/basic_parsed_options.html delete mode 100644 libs/program_options/doc/html/boost/program_options/bool_switch.html delete mode 100644 libs/program_options/doc/html/boost/program_options/collect_unrecognized.html delete mode 100644 libs/program_options/doc/html/boost/program_options/collect_unrecognized_mode.html delete mode 100644 libs/program_options/doc/html/boost/program_options/command_line_style/style_t.html delete mode 100644 libs/program_options/doc/html/boost/program_options/duplicate_option_error.html delete mode 100644 libs/program_options/doc/html/boost/program_options/error.html delete mode 100644 libs/program_options/doc/html/boost/program_options/error_with_no_option_name.html delete mode 100644 libs/program_options/doc/html/boost/program_options/error_with_option_name.html delete mode 100644 libs/program_options/doc/html/boost/program_options/ext_parser.html delete mode 100644 libs/program_options/doc/html/boost/program_options/invalid_bool_value.html delete mode 100644 libs/program_options/doc/html/boost/program_options/invalid_command_idp6969504.html delete mode 100644 libs/program_options/doc/html/boost/program_options/invalid_command_line_style.html delete mode 100644 libs/program_options/doc/html/boost/program_options/invalid_config_file_syntax.html delete mode 100644 libs/program_options/doc/html/boost/program_options/invalid_option_value.html delete mode 100644 libs/program_options/doc/html/boost/program_options/invalid_syntax.html delete mode 100644 libs/program_options/doc/html/boost/program_options/multiple_occurrences.html delete mode 100644 libs/program_options/doc/html/boost/program_options/multiple_values.html delete mode 100644 libs/program_options/doc/html/boost/program_options/notify.html delete mode 100644 libs/program_options/doc/html/boost/program_options/option_description.html delete mode 100644 libs/program_options/doc/html/boost/program_options/options_descrip_idp8075600.html delete mode 100644 libs/program_options/doc/html/boost/program_options/options_description.html delete mode 100644 libs/program_options/doc/html/boost/program_options/parse_command_line.html delete mode 100644 libs/program_options/doc/html/boost/program_options/parse_config_fi_idp5606176.html delete mode 100644 libs/program_options/doc/html/boost/program_options/parse_config_fi_idp8590400.html delete mode 100644 libs/program_options/doc/html/boost/program_options/parse_environme_idp6765216.html delete mode 100644 libs/program_options/doc/html/boost/program_options/parse_environme_idp6997248.html delete mode 100644 libs/program_options/doc/html/boost/program_options/parse_environme_idp7001408.html delete mode 100644 libs/program_options/doc/html/boost/program_options/positional_opti_idp5922480.html delete mode 100644 libs/program_options/doc/html/boost/program_options/reading_file.html delete mode 100644 libs/program_options/doc/html/boost/program_options/required_option.html delete mode 100644 libs/program_options/doc/html/boost/program_options/split_unix.html delete mode 100644 libs/program_options/doc/html/boost/program_options/store_idp6705280.html delete mode 100644 libs/program_options/doc/html/boost/program_options/store_idp6709808.html delete mode 100644 libs/program_options/doc/html/boost/program_options/too_many_positi_idp7389984.html delete mode 100644 libs/program_options/doc/html/boost/program_options/typed_value.html delete mode 100644 libs/program_options/doc/html/boost/program_options/typed_value_base.html delete mode 100644 libs/program_options/doc/html/boost/program_options/unknown_option.html delete mode 100644 libs/program_options/doc/html/boost/program_options/untyped_value.html delete mode 100644 libs/program_options/doc/html/boost/program_options/validation_error.html delete mode 100644 libs/program_options/doc/html/boost/program_options/value.html delete mode 100644 libs/program_options/doc/html/boost/program_options/value_semantic.html delete mode 100644 libs/program_options/doc/html/boost/program_options/value_semantic__idp8632624.html delete mode 100644 libs/program_options/doc/html/boost/program_options/value_semantic__idp8634400.html delete mode 100644 libs/program_options/doc/html/boost/program_options/value_semantic__idp9236160.html delete mode 100644 libs/program_options/doc/html/boost/program_options/variable_value.html delete mode 100644 libs/program_options/doc/html/boost/program_options/variables_map.html delete mode 100644 libs/program_options/doc/html/boost/program_options/wvalue.html delete mode 100644 libs/program_options/doc/html/index.html delete mode 100644 libs/program_options/doc/html/index/s06.html delete mode 100644 libs/program_options/doc/html/program_option_HTML.manifest delete mode 100644 libs/program_options/doc/html/program_options/design.html delete mode 100644 libs/program_options/doc/html/program_options/howto.html delete mode 100644 libs/program_options/doc/html/program_options/overview.html delete mode 100644 libs/program_options/doc/html/program_options/reference.html delete mode 100644 libs/program_options/doc/html/program_options/tutorial.html (limited to 'libs/program_options') diff --git a/libs/program_options/doc/autodoc.xml b/libs/program_options/doc/autodoc.xml index 729e4d1a0b..d7fc6a3a0b 100644 --- a/libs/program_options/doc/autodoc.xml +++ b/libs/program_options/doc/autodoc.xml @@ -3,12 +3,10 @@ - 1Allow "--long_name" style. allow_long << 1Allow "-<single character" style. allow_short << 1Allow "-" in short options. allow_dash_for_short << 1Allow "/" in short options. allow_slash_for_short << 1Allow option parameter in the same token for long option, like in - --foo=10 - long_allow_adjacent << 1Allow option parameter in the next token for long options. long_allow_next << 1Allow option parameter in the same token for short options. short_allow_adjacent << 1Allow option parameter in the next token for short options. short_allow_next << 1Allow to merge several short options together, so that "-s -k" become "-sk". All of the options but last should accept no parameter. For example, if "-s" accept a parameter, then "k" will be taken as parameter, not another short option. Dos-style short options cannot be sticky. allow_sticky << 1Allow abbreviated spellings for long options, if they unambiguously identify long option. No long option name should be prefix of other long option name if guessing is in effect. allow_guessing << 1Ignore the difference in case for long options. long_case_insensitive << 1Ignore the difference in case for short options. (long_case_insensitive | short_case_insensitive)Ignore the difference in case for all options. short_case_insensitive << 1Allow long options with single option starting character, e.g -foo=10 (allow_short | short_allow_adjacent | short_allow_next += 1Allow "--long_name" style. = allow_long << 1Allow "-<single character" style. = allow_short << 1Allow "-" in short options. = allow_dash_for_short << 1Allow "/" in short options. = allow_slash_for_short << 1Allow option parameter in the same token for long option, like in --foo=10 = long_allow_adjacent << 1Allow option parameter in the next token for long options. = long_allow_next << 1Allow option parameter in the same token for short options. = short_allow_adjacent << 1Allow option parameter in the next token for short options. = short_allow_next << 1Allow to merge several short options together, so that "-s -k" become "-sk". All of the options but last should accept no parameter. For example, if "-s" accept a parameter, then "k" will be taken as parameter, not another short option. Dos-style short options cannot be sticky. = allow_sticky << 1Allow abbreviated spellings for long options, if they unambiguously identify long option. No long option name should be prefix of other long option name if guessing is in effect. = allow_guessing << 1Ignore the difference in case for long options. = long_case_insensitive << 1Ignore the difference in case for short options. = (long_case_insensitive | short_case_insensitive)Ignore the difference in case for all options. = short_case_insensitive << 1Allow long options with single option starting character, e.g -foo=10 = (allow_short | short_allow_adjacent | short_allow_next | allow_long | long_allow_adjacent | long_allow_next | allow_sticky | allow_guessing - | allow_dash_for_short)The more-or-less traditional unix style. unix_styleThe default style. Various possible styles of options.There are "long" options, which start with "--" and "short", which start with either "-" or "/". Both kinds can be allowed or disallowed, see allow_long and allow_short. The allowed character for short options is also configurable.Option's value can be specified in the same token as name ("--foo=bar"), or in the next token.It's possible to introduce long options by the same character as short options, see allow_long_disguise.Finally, guessing (specifying only prefix of option) and case insensitive processing are supported. + | allow_dash_for_short)The more-or-less traditional unix style. = unix_styleThe default style. Various possible styles of options.There are "long" options, which start with "--" and "short", which start with either "-" or "/". Both kinds can be allowed or disallowed, see allow_long and allow_short. The allowed character for short options is also configurable.Option's value can be specified in the same token as name ("--foo=bar"), or in the next token.It's possible to introduce long options by the same character as short options, see allow_long_disguise.Finally, guessing (specifying only prefix of option) and case insensitive processing are supported. @@ -49,8 +47,10 @@ iterator_facade< Derived, const ValueType, forward_traversal_tag >The 'eof_iterator' class is useful for constructing forward iterators in cases where iterator extract data from some source and it's easy to detect 'eof' \-- i.e. the situation where there's no data. One apparent example is reading lines from a file.Implementing such iterators using 'iterator_facade' directly would require to create class with three core operation, a couple of constructors. When using 'eof_iterator', the derived class should define only one method to get new value, plus a couple of constructors.The basic idea is that iterator has 'eof' bit. Two iterators are equal only if both have their 'eof' bits set. The 'get' method either obtains the new value or sets the 'eof' bit.Specifically, derived class should define:1. A default constructor, which creates iterator with 'eof' bit set. The constructor body should call 'found_eof' method defined here. 2. Some other constructor. It should initialize some 'data pointer' used in iterator operation and then call 'get'. 3. The 'get' method. It should operate this way: + iterator_facade< Derived, const ValueType, forward_traversal_tag >The 'eof_iterator' class is useful for constructing forward iterators in cases where iterator extract data from some source and it's easy to detect 'eof' -- i.e. the situation where there's no data. One apparent example is reading lines from a file.Implementing such iterators using 'iterator_facade' directly would require to create class with three core operation, a couple of constructors. When using 'eof_iterator', the derived class should define only one method to get new value, plus a couple of constructors.The basic idea is that iterator has 'eof' bit. Two iterators are equal only if both have their 'eof' bits set. The 'get' method either obtains the new value or sets the 'eof' bit.Specifically, derived class should define: +A default constructor, which creates iterator with 'eof' bit set. The constructor body should call 'found_eof' method defined here.Some other constructor. It should initialize some 'data pointer' used in iterator operation and then call 'get'.The 'get' method. It should operate this way: look at some 'data pointer' to see if new element is available; if not, it should call 'found_eof'.extract new element and store it at location returned by the 'value' method.advance the data pointer. + Essentially, the 'get' method has the functionality of both 'increment' and 'dereference'. It's very good for the cases where data extraction implicitly moves data pointer, like for stream operation. @@ -68,7 +68,7 @@
-Base class for all errors in the library. +logic_errorBase class for all errors in the library. const std::string & boost::program_options::errorClass thrown when there are too many positional options. This is a programming error. @@ -80,7 +80,7 @@ boost::program_options::errorClass thrown if config file can not be read const char * -boost::program_options::errorBase class for most exceptions in the library.Substitutes the values for the parameter name placeholders in the template to create the human readable error messagePlaceholders are surrounded by % signs: example% Poor man's version of boost::formatIf a parameter name is absent, perform default substitutions instead so ugly placeholders are never left in-place.Options are displayed in "canonical" form This is the most unambiguous form of the *parsed* option name and would correspond to option_description::format_name() i.e. what is shown by print_usage()The "canonical" form depends on whether the option is specified in short or long form, using dashes or slashes or without a prefix (from a configuration file) std::stringtemplate with placeholders +boost::program_options::errorBase class for most exceptions in the library.Substitutes the values for the parameter name placeholders in the template to create the human readable error messagePlaceholders are surrounded by % signs: example% Poor man's version of boost::formatIf a parameter name is absent, perform default substitutions instead so ugly placeholders are never left in-place.Options are displayed in "canonical" form This is the most unambiguous form of the parsed option name and would correspond to option_description::format_name() i.e. what is shown by print_usage()The "canonical" form depends on whether the option is specified in short or long form, using dashes or slashes or without a prefix (from a configuration file) std::stringtemplate with placeholders voidconst std::string &const std::string &Substitute parameter_name->value to create the error message from the error template voidconst std::string &const std::string &const std::string &If the parameter is missing, then make the from->to substitution instead @@ -128,7 +128,7 @@ voidconst std::string &Makes all substitutions using the template -boost::program_options::error_with_option_nameClass thrown when there's syntax error either for command line or config file options. See derived children for concrete classes. 30 +boost::program_options::error_with_option_nameClass thrown when there's syntax error either for command line or config file options. See derived children for concrete classes. = 30 kind_t std::stringConvenience functions for backwards compatibility @@ -147,7 +147,7 @@ kind_tconst std::string &""const std::string &""int0 -boost::program_options::error_with_option_nameClass thrown when value of option is incorrect. 30 +boost::program_options::error_with_option_nameClass thrown when value of option is incorrect. = 30 kind_tconst std::string &""const std::string &""int0 @@ -168,7 +168,6 @@ -std::stringconst std::string & @@ -178,6 +177,7 @@ +std::stringconst std::string & @@ -189,7 +189,7 @@ Option found in input source. Contains a key and a value. The key, in turn, can be a string (name of an option), or an integer (position in input source) \-- in case no name is specified. The latter is only possible for command line. The template parameter specifies the type of char used for storing the option's value. std::stringString key of this option. Intentionally independent of the template parameter. + Option found in input source. Contains a key and a value. The key, in turn, can be a string (name of an option), or an integer (position in input source) -- in case no name is specified. The latter is only possible for command line. The template parameter specifies the type of char used for storing the option's value. std::stringString key of this option. Intentionally independent of the template parameter. intPosition key of this option. All options without an explicit name are sequentially numbered starting from 0. If an option has explicit name, 'position_key' is equal to -1. It is possible that both position_key and string_key is specified, in case name is implicitly added. std::vector< std::basic_string< charT > >Option's value std::vector< std::basic_string< charT > >The original unchanged tokens this option was created from. @@ -226,12 +226,12 @@
-Describes one possible command line/config file option. There are two kinds of properties of an option. First describe it syntactically and are used only to validate input. Second affect interpretation of the option, for example default value for it or function that should be called when the value is finally known. Routines which perform parsing never use second kind of properties \-- they are side effect free. See Also:options_description +Describes one possible command line/config file option. There are two kinds of properties of an option. First describe it syntactically and are used only to validate input. Second affect interpretation of the option, for example default value for it or function that should be called when the value is finally known. Routines which perform parsing never use second kind of properties -- they are side effect free. See Also:options_description match_resultconst std::string &boolboolboolGiven 'option', specified in the input source, returns 'true' if 'option' specifies *this. const std::string &const std::string &Returns the key that should identify the option, in particular in the variables_map class. The 'option' parameter is the option spelling from the input source. If option name contains '*', returns 'option'. If long name was specified, it's the long name, otherwise it's a short name with prepended '-'. -std::stringint0Returns the canonical name for the option description to enable the user to recognised a matching option. 1) For short options ('-', '/'), returns the short name prefixed. 2) For long options ('--' / '-') returns the long name prefixed 3) All other cases, returns the long name (if present) or the short name, unprefixed. +std::stringint0Returns the canonical name for the option description to enable the user to recognised a matching option. 1) For short options ('-', '/'), returns the short name prefixed. 2) For long options ('–' / '-') returns the long name prefixed 3) All other cases, returns the long name (if present) or the short name, unprefixed. const std::string & const std::string &Explanation of this option. shared_ptr< const value_semantic >Semantic of option's value. @@ -240,7 +240,7 @@ const char *const value_semantic *Initializes the object with the passed data.Note: it would be nice to make the second parameter auto_ptr, to explicitly pass ownership. Unfortunately, it's often needed to create objects of types derived from 'value_semantic': options_description d; d.add_options()("a", parameter<int>("n")->default_value(1)); Here, the static type returned by 'parameter' should be derived from value_semantic.Alas, derived->base conversion for auto_ptr does not really work, see http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2000/n1232.pdf http://www.open-std.org/jtc1/sc22/wg21/docs/cwg_defects.html#84So, we have to use plain old pointers. Besides, users are not expected to use the constructor directly.The 'name' parameter is interpreted by the following rules: -if there's no "," character in 'name', it specifies long nameotherwise, the part before "," specifies long name and the part after \-- short name. +if there's no "," character in 'name', it specifies long nameotherwise, the part before "," specifies long name and the part after -- short name. const char *const value_semantic *const char *Initializes the class with the passed data. @@ -318,7 +318,7 @@ const basic_parsed_options< char > &Constructs wrapped options from options in UTF8 encoding. Command line parser.The class allows one to specify all the information needed for parsing and to parse the command line. It is primarily needed to emulate named function parameters \-- a regular function with 5 parameters will be hard to use and creating overloads with a smaller number of parameters will be confusing.For the most common case, the function parse_command_line is a better alternative.There are two typedefs \-- command_line_parser and wcommand_line_parser, for charT == char and charT == wchar_t cases. + cmdlineCommand line parser.The class allows one to specify all the information needed for parsing and to parse the command line. It is primarily needed to emulate named function parameters -- a regular function with 5 parameters will be hard to use and creating overloads with a smaller number of parameters will be confusing.For the most common case, the function parse_command_line is a better alternative.There are two typedefs -- command_line_parser and wcommand_line_parser, for charT == char and charT == wchar_t cases. basic_command_line_parser &const options_description &Sets options descriptions to use. basic_command_line_parser &const positional_options_description &Sets positional options description to use. basic_command_line_parser &intSets the command line style. @@ -341,7 +341,6 @@ - basic_parsed_options< charT >intconst charT *constconst options_description &int0function1< std::pair< std::string, std::string >, const std::string & >ext_parser()Creates instance of 'command_line_parser', passes parameters to it, and returns the result of calling the 'run' method. @@ -362,6 +361,7 @@ +
@@ -449,9 +449,9 @@ boost::program_options::value_semantic_codecvt_helper< charT >boost::program_options::typed_value_baseClass which handles value of a specific type. typed_value *const T &Specifies default value, which will be used if none is explicitly specified. The type 'T' should provide operator<< for ostream. typed_value *const T &const std::string &Specifies default value, which will be used if none is explicitly specified. Unlike the above overload, the type 'T' need not provide operator<< for ostream, but textual representation of default value must be provided by the user. -typed_value *const T &Specifies an implicit value, which will be used if the option is given, but without an adjacent value. Using this implies that an explicit value is optional, but if given, must be strictly adjacent to the option, i.e.: '-ovalue' or '--option=value'. Giving '-o' or '--option' will cause the implicit value to be applied. +typed_value *const T &Specifies an implicit value, which will be used if the option is given, but without an adjacent value. Using this implies that an explicit value is optional, but if given, must be strictly adjacent to the option, i.e.: '-ovalue' or '–option=value'. Giving '-o' or '–option' will cause the implicit value to be applied. typed_value *const std::string &Specifies the name used to to the value in help message. -typed_value *const T &const std::string &Specifies an implicit value, which will be used if the option is given, but without an adjacent value. Using this implies that an explicit value is optional, but if given, must be strictly adjacent to the option, i.e.: '-ovalue' or '--option=value'. Giving '-o' or '--option' will cause the implicit value to be applied. Unlike the above overload, the type 'T' need not provide operator<< for ostream, but textual representation of default value must be provided by the user. +typed_value *const T &const std::string &Specifies an implicit value, which will be used if the option is given, but without an adjacent value. Using this implies that an explicit value is optional, but if given, must be strictly adjacent to the option, i.e.: '-ovalue' or '–option=value'. Giving '-o' or '–option' will cause the implicit value to be applied. Unlike the above overload, the type 'T' need not provide operator<< for ostream, but textual representation of default value must be provided by the user. typed_value *function1< void, const T & >Specifies a function to be called when the final value is determined. typed_value *Specifies that the value is composing. See the 'is_composing' method for explanation. typed_value *Specifies that the value can span multiple tokens. @@ -523,13 +523,9 @@ const variable_value &const std::string &Obtains the value of variable 'name', from *this and possibly from the chain of variable maps. if there's no value in *this. if there's next variable map, returns value from itotherwise, returns empty value - - -if there's defaulted value +if there's defaulted value if there's next variable map, which has a non-defaulted value, return thatotherwise, return value from *this - - -if there's a non-defaulted value, returns it. +if there's a non-defaulted value, returns it. voidabstract_variables_map *Sets next variable map, which will be used to find variables not found in *this. @@ -539,18 +535,8 @@ const variable_value &const std::string &Returns value of variable 'name' stored in *this, or empty value otherwise. -
boost::program_options::abstract_variables_mapConcrete variables map which store variables in real map.This class is derived from std::map<std::string, variable_value>, so you can use all map operators to examine its content. -const variable_value &const std::string &Obtains the value of variable 'name', from *this and possibly from the chain of variable maps. -if there's no value in *this. -if there's next variable map, returns value from itotherwise, returns empty value - - -if there's defaulted value -if there's next variable map, which has a non-defaulted value, return thatotherwise, return value from *this - - -if there's a non-defaulted value, returns it. - +boost::program_options::abstract_variables_mapstd::map< std::string, variable_value >Concrete variables map which store variables in real map.This class is derived from std::map<std::string, variable_value>, so you can use all map operators to examine its content. +const variable_value &const std::string & void void @@ -587,4 +573,4 @@
The version of the source interface. The value will be incremented whenever a change is made which might cause compilation errors for existing code.
- + \ No newline at end of file diff --git a/libs/program_options/doc/html/BOOST_PROGRAM_OPTIONS_DECL.html b/libs/program_options/doc/html/BOOST_PROGRAM_OPTIONS_DECL.html deleted file mode 100644 index 8ce7fa1a11..0000000000 --- a/libs/program_options/doc/html/BOOST_PROGRAM_OPTIONS_DECL.html +++ /dev/null @@ -1,49 +0,0 @@ - - - -Macro BOOST_PROGRAM_OPTIONS_DECL - - - - - - - - - - - - - - - -
Boost C++ LibrariesHomeLibrariesPeopleFAQMore
-
-
-PrevUpHomeNext -
-
-
-
-

Macro BOOST_PROGRAM_OPTIONS_DECL

-

BOOST_PROGRAM_OPTIONS_DECL

-
-

Synopsis

-
// In header: <boost/program_options/config.hpp>
-
-BOOST_PROGRAM_OPTIONS_DECL
-
- - - -
-
-
-PrevUpHomeNext -
- - diff --git a/libs/program_options/doc/html/BOOST_PROGRAM_OPTIONS_VERSION.html b/libs/program_options/doc/html/BOOST_PROGRAM_OPTIONS_VERSION.html deleted file mode 100644 index eff98c9f3a..0000000000 --- a/libs/program_options/doc/html/BOOST_PROGRAM_OPTIONS_VERSION.html +++ /dev/null @@ -1,52 +0,0 @@ - - - -Macro BOOST_PROGRAM_OPTIONS_VERSION - - - - - - - - - - - - - - -
Boost C++ LibrariesHomeLibrariesPeopleFAQMore
-
-
-PrevUpHome -
-
-
-
-

Macro BOOST_PROGRAM_OPTIONS_VERSION

-

BOOST_PROGRAM_OPTIONS_VERSION

-
-

Synopsis

-
// In header: <boost/program_options/version.hpp>
-
-BOOST_PROGRAM_OPTIONS_VERSION
-
-

Description

-

The version of the source interface. The value will be incremented whenever a change is made which might cause compilation errors for existing code.

-
-
- - - -
-
-
-PrevUpHome -
- - diff --git a/libs/program_options/doc/html/boost/environment_iterator.html b/libs/program_options/doc/html/boost/environment_iterator.html deleted file mode 100644 index 37ebd722ac..0000000000 --- a/libs/program_options/doc/html/boost/environment_iterator.html +++ /dev/null @@ -1,77 +0,0 @@ - - - -Class environment_iterator - - - - - - - - - - - - - - - -
Boost C++ LibrariesHomeLibrariesPeopleFAQMore
-
-
-PrevUpHomeNext -
-
-
-
-

Class environment_iterator

-

boost::environment_iterator

-
-

Synopsis

-
// In header: <boost/program_options/environment_iterator.hpp>
-
-
-class environment_iterator : public boost::eof_iterator< environment_iterator, std::pair< std::string, std::string > >
-{
-public:
-  // construct/copy/destruct
-  environment_iterator(char **);
-  environment_iterator();
-
-  // public member functions
-  void get();
-};
-
-

Description

-
-

-environment_iterator - public - construct/copy/destruct

-
    -
  1. environment_iterator(char ** environment);
  2. -
  3. environment_iterator();
  4. -
-
-
-

-environment_iterator public member functions

-
  1. void get();
-
-
-
- - - -
-
-
-PrevUpHomeNext -
- - diff --git a/libs/program_options/doc/html/boost/eof_iterator.html b/libs/program_options/doc/html/boost/eof_iterator.html deleted file mode 100644 index 0e863da307..0000000000 --- a/libs/program_options/doc/html/boost/eof_iterator.html +++ /dev/null @@ -1,111 +0,0 @@ - - - -Class template eof_iterator - - - - - - - - - - - - - - - -
Boost C++ LibrariesHomeLibrariesPeopleFAQMore
-
-
-PrevUpHomeNext -
-
-
-
-

Class template eof_iterator

-

boost::eof_iterator

-
-

Synopsis

-
// In header: <boost/program_options/eof_iterator.hpp>
-
-template<typename Derived, typename ValueType> 
-class eof_iterator :
-  public iterator_facade< Derived, const ValueType, forward_traversal_tag >
-{
-public:
-  // construct/copy/destruct
-  eof_iterator();
-
-  // protected member functions
-  ValueType & value();
-  void found_eof();
-
-  // private member functions
-  void increment();
-  bool equal(const eof_iterator &) const;
-  const ValueType & dereference() const;
-};
-
-

Description

-

The 'eof_iterator' class is useful for constructing forward iterators in cases where iterator extract data from some source and it's easy to detect 'eof' \-- i.e. the situation where there's no data. One apparent example is reading lines from a file.

-

Implementing such iterators using 'iterator_facade' directly would require to create class with three core operation, a couple of constructors. When using 'eof_iterator', the derived class should define only one method to get new value, plus a couple of constructors.

-

The basic idea is that iterator has 'eof' bit. Two iterators are equal only if both have their 'eof' bits set. The 'get' method either obtains the new value or sets the 'eof' bit.

-

Specifically, derived class should define:

-

1. A default constructor, which creates iterator with 'eof' bit set. The constructor body should call 'found_eof' method defined here. 2. Some other constructor. It should initialize some 'data pointer' used in iterator operation and then call 'get'. 3. The 'get' method. It should operate this way:

-
    -
  • look at some 'data pointer' to see if new element is available; if not, it should call 'found_eof'.

  • -
  • extract new element and store it at location returned by the 'value' method.

  • -
  • advance the data pointer.

  • -
-

-

-

Essentially, the 'get' method has the functionality of both 'increment' and 'dereference'. It's very good for the cases where data extraction implicitly moves data pointer, like for stream operation.

-
-

-eof_iterator - public - construct/copy/destruct

-
  1. eof_iterator();
-
-
-

-eof_iterator protected member functions

-
    -
  1. -
    ValueType & value();
    -

    Returns the reference which should be used by derived class to store the next value.

    -
  2. -
  3. -
    void found_eof();
    -

    Should be called by derived class to indicate that it can't produce next element.

    -
  4. -
-
-
-

-eof_iterator private member functions

-
    -
  1. void increment();
  2. -
  3. bool equal(const eof_iterator & other) const;
  4. -
  5. const ValueType & dereference() const;
  6. -
-
-
-
- - - -
-
-
-PrevUpHomeNext -
- - diff --git a/libs/program_options/doc/html/boost/program_options/abstract_variables_map.html b/libs/program_options/doc/html/boost/program_options/abstract_variables_map.html deleted file mode 100644 index 723a54cc5c..0000000000 --- a/libs/program_options/doc/html/boost/program_options/abstract_variables_map.html +++ /dev/null @@ -1,125 +0,0 @@ - - - -Class abstract_variables_map - - - - - - - - - - - - - - - -
Boost C++ LibrariesHomeLibrariesPeopleFAQMore
-
-
-PrevUpHomeNext -
-
-
-
-

Class abstract_variables_map

-

boost::program_options::abstract_variables_map

-
-

Synopsis

-
// In header: <boost/program_options/variables_map.hpp>
-
-
-class abstract_variables_map {
-public:
-  // construct/copy/destruct
-  abstract_variables_map();
-  abstract_variables_map(const abstract_variables_map *);
-  ~abstract_variables_map();
-
-  // public member functions
-  const variable_value & operator[](const std::string &) const;
-  void next(abstract_variables_map *);
-
-  // private member functions
-  virtual const variable_value & get(const std::string &) const = 0;
-};
-
-

Description

-

Implements string->string mapping with convenient value casting facilities.

-
-

-abstract_variables_map - public - construct/copy/destruct

-
    -
  1. abstract_variables_map();
  2. -
  3. abstract_variables_map(const abstract_variables_map * next);
  4. -
  5. ~abstract_variables_map();
  6. -
-
-
-

-abstract_variables_map public member functions

-
    -
  1. -
    const variable_value & operator[](const std::string & name) const;
    -

    Obtains the value of variable 'name', from *this and possibly from the chain of variable maps.

    -
    • -

      if there's no value in *this.

      -
        -
      • if there's next variable map, returns value from it

      • -
      • otherwise, returns empty value

      • -
      -

      -

      -
    -

    -

    -
    • -

      if there's defaulted value

      -
        -
      • if there's next variable map, which has a non-defaulted value, return that

      • -
      • otherwise, return value from *this

      • -
      -

      -

      -
    -

    -

    -
    • if there's a non-defaulted value, returns it.

    -

    -

    -
  2. -
  3. -
    void next(abstract_variables_map * next);
    -

    Sets next variable map, which will be used to find variables not found in *this.

    -
  4. -
-
-
-

-abstract_variables_map private member functions

-
  1. -
    virtual const variable_value & get(const std::string & name) const = 0;
    -

    Returns value of variable 'name' stored in *this, or empty value otherwise.

    -
-
-
-
- - - -
-
-
-PrevUpHomeNext -
- - diff --git a/libs/program_options/doc/html/boost/program_options/ambiguous_option.html b/libs/program_options/doc/html/boost/program_options/ambiguous_option.html deleted file mode 100644 index 42d9a7c78d..0000000000 --- a/libs/program_options/doc/html/boost/program_options/ambiguous_option.html +++ /dev/null @@ -1,90 +0,0 @@ - - - -Class ambiguous_option - - - - - - - - - - - - - - - -
Boost C++ LibrariesHomeLibrariesPeopleFAQMore
-
-
-PrevUpHomeNext -
-
-
-
-

Class ambiguous_option

-

boost::program_options::ambiguous_option

-
-

Synopsis

-
// In header: <boost/program_options/errors.hpp>
-
-
-class ambiguous_option :
-  public boost::program_options::error_with_no_option_name
-{
-public:
-  // construct/copy/destruct
-  ambiguous_option(const std::vector< std::string > &);
-  ~ambiguous_option();
-
-  // public member functions
-  const std::vector< std::string > & alternatives() const;
-
-  // protected member functions
-  virtual void substitute_placeholders(const std::string &) const;
-};
-
-

Description

-

Class thrown when there's ambiguity amoung several possible options.

-
-

-ambiguous_option - public - construct/copy/destruct

-
    -
  1. ambiguous_option(const std::vector< std::string > & xalternatives);
  2. -
  3. ~ambiguous_option();
  4. -
-
-
-

-ambiguous_option public member functions

-
  1. const std::vector< std::string > & alternatives() const;
-
-
-

-ambiguous_option protected member functions

-
  1. -
    virtual void substitute_placeholders(const std::string & error_template) const;
    -

    Makes all substitutions using the template

    -
-
-
-
- - - -
-
-
-PrevUpHomeNext -
- - diff --git a/libs/program_options/doc/html/boost/program_options/basic_command_line_parser.html b/libs/program_options/doc/html/boost/program_options/basic_command_line_parser.html deleted file mode 100644 index 04dab0097d..0000000000 --- a/libs/program_options/doc/html/boost/program_options/basic_command_line_parser.html +++ /dev/null @@ -1,120 +0,0 @@ - - - -Class template basic_command_line_parser - - - - - - - - - - - - - - - -
Boost C++ LibrariesHomeLibrariesPeopleFAQMore
-
-
-PrevUpHomeNext -
-
-
-
-

Class template basic_command_line_parser

-

boost::program_options::basic_command_line_parser

-
-

Synopsis

- -
-

Description

-

Command line parser.

-

The class allows one to specify all the information needed for parsing and to parse the command line. It is primarily needed to emulate named function parameters \-- a regular function with 5 parameters will be hard to use and creating overloads with a smaller number of parameters will be confusing.

-

For the most common case, the function parse_command_line is a better alternative.

-

There are two typedefs \-- command_line_parser and wcommand_line_parser, for charT == char and charT == wchar_t cases.

-
-

-basic_command_line_parser - public - construct/copy/destruct

-
    -
  1. -
    basic_command_line_parser(const std::vector< std::basic_string< charT > > & args);
    -

    Creates a command line parser for the specified arguments list. The 'args' parameter should not include program name.

    -
  2. -
  3. -
    basic_command_line_parser(int argc, const charT *const argv);
    -

    Creates a command line parser for the specified arguments list. The parameters should be the same as passed to 'main'.

    -
  4. -
-
-
-

-basic_command_line_parser public member functions

-
    -
  1. -
    basic_command_line_parser & options(const options_description & desc);
    -

    Sets options descriptions to use.

    -
  2. -
  3. -
    basic_command_line_parser & 
    -positional(const positional_options_description & desc);
    -

    Sets positional options description to use.

    -
  4. -
  5. -
    basic_command_line_parser & style(int);
    -

    Sets the command line style.

    -
  6. -
  7. -
    basic_command_line_parser & extra_parser(ext_parser);
    -

    Sets the extra parsers.

    -
  8. -
  9. -
    basic_parsed_options< charT > run();
    -

    Parses the options and returns the result of parsing. Throws on error.

    -
  10. -
  11. -
    basic_command_line_parser & allow_unregistered();
    -

    Specifies that unregistered options are allowed and should be passed though. For each command like token that looks like an option but does not contain a recognized name, an instance of basic_option<charT> will be added to result, with 'unrecognized' field set to 'true'. It's possible to collect all unrecognized options with the 'collect_unrecognized' funciton.

    -
  12. -
  13. basic_command_line_parser & extra_style_parser(style_parser s);
  14. -
-
-
-
- - - -
-
-
-PrevUpHomeNext -
- - diff --git a/libs/program_options/doc/html/boost/program_options/basic_option.html b/libs/program_options/doc/html/boost/program_options/basic_option.html deleted file mode 100644 index 0afe33fad8..0000000000 --- a/libs/program_options/doc/html/boost/program_options/basic_option.html +++ /dev/null @@ -1,110 +0,0 @@ - - - -Class template basic_option - - - - - - - - - - - - - - - -
Boost C++ LibrariesHomeLibrariesPeopleFAQMore
-
-
-PrevUpHomeNext -
-
-
-
-

Class template basic_option

-

boost::program_options::basic_option

-
-

Synopsis

-
// In header: <boost/program_options/option.hpp>
-
-template<typename charT> 
-class basic_option {
-public:
-  // construct/copy/destruct
-  basic_option();
-  basic_option(const std::string &, const std::vector< std::string > &);
-
-  // public data members
-  std::string string_key;
-  int position_key;
-  std::vector< std::basic_string< charT > > value;
-  std::vector< std::basic_string< charT > > original_tokens;
-  bool unregistered;
-  bool case_insensitive;
-};
-
-

Description

-

Option found in input source. Contains a key and a value. The key, in turn, can be a string (name of an option), or an integer (position in input source) \-- in case no name is specified. The latter is only possible for command line. The template parameter specifies the type of char used for storing the option's value.

-
-

-basic_option - public - construct/copy/destruct

-
    -
  1. basic_option();
  2. -
  3. basic_option(const std::string & xstring_key, 
    -             const std::vector< std::string > & xvalue);
  4. -
-
-
-

-basic_option - public - public data members

-
    -
  1. -
    std::string string_key;
    -

    String key of this option. Intentionally independent of the template parameter.

    -
  2. -
  3. -
    int position_key;
    -

    Position key of this option. All options without an explicit name are sequentially numbered starting from 0. If an option has explicit name, 'position_key' is equal to -1. It is possible that both position_key and string_key is specified, in case name is implicitly added.

    -
  4. -
  5. -
    std::vector< std::basic_string< charT > > value;
    -

    Option's value

    -
  6. -
  7. -
    std::vector< std::basic_string< charT > > original_tokens;
    -

    The original unchanged tokens this option was created from.

    -
  8. -
  9. -
    bool unregistered;
    -

    True if option was not recognized. In that case, 'string_key' and 'value' are results of purely syntactic parsing of source. The original tokens can be recovered from the "original_tokens" member.

    -
  10. -
  11. -
    bool case_insensitive;
    -

    True if string_key has to be handled case insensitive.

    -
  12. -
-
-
-
- - - -
-
-
-PrevUpHomeNext -
- - diff --git a/libs/program_options/doc/html/boost/program_options/basic_parsed_op_idp8181920.html b/libs/program_options/doc/html/boost/program_options/basic_parsed_op_idp8181920.html deleted file mode 100644 index 6ca5fb0822..0000000000 --- a/libs/program_options/doc/html/boost/program_options/basic_parsed_op_idp8181920.html +++ /dev/null @@ -1,96 +0,0 @@ - - - -Class basic_parsed_options<wchar_t> - - - - - - - - - - - - - - - -
Boost C++ LibrariesHomeLibrariesPeopleFAQMore
-
-
-PrevUpHomeNext -
-
-
-
-

Class basic_parsed_options<wchar_t>

-

boost::program_options::basic_parsed_options<wchar_t>

-
-

Synopsis

-
// In header: <boost/program_options/parsers.hpp>
-
-
-class basic_parsed_options<wchar_t> {
-public:
-  // construct/copy/destruct
-  explicit basic_parsed_options(const basic_parsed_options< char > &);
-
-  // public data members
-  std::vector< basic_option< wchar_t > > options;
-  const options_description * description;
-  basic_parsed_options< char > utf8_encoded_options;
-  int m_options_prefix;
-};
-
-

Description

-

Specialization of basic_parsed_options which:

-
-

-

-
-

-basic_parsed_options - public - construct/copy/destruct

-
  1. -
    explicit basic_parsed_options(const basic_parsed_options< char > & po);
    -

    Constructs wrapped options from options in UTF8 encoding.

    -
-
-
-

-basic_parsed_options - public - public data members

-
    -
  1. -
    basic_parsed_options< char > utf8_encoded_options;
    -

    Stores UTF8 encoded options that were passed to constructor, to avoid reverse conversion in some cases.

    -
  2. -
  3. -
    int m_options_prefix;
    -

    Mainly used for the diagnostic messages in exceptions. The canonical option prefix for the parser which generated these results, depending on the settings for basic_command_line_parser::style() or cmdline::style(). In order of precedence of command_line_style enums: allow_long allow_long_disguise allow_dash_for_short allow_slash_for_short

    -
  4. -
-
-
-
- - - -
-
-
-PrevUpHomeNext -
- - diff --git a/libs/program_options/doc/html/boost/program_options/basic_parsed_options.html b/libs/program_options/doc/html/boost/program_options/basic_parsed_options.html deleted file mode 100644 index 52aab4c6ea..0000000000 --- a/libs/program_options/doc/html/boost/program_options/basic_parsed_options.html +++ /dev/null @@ -1,95 +0,0 @@ - - - -Class template basic_parsed_options - - - - - - - - - - - - - - - -
Boost C++ LibrariesHomeLibrariesPeopleFAQMore
-
-
-PrevUpHomeNext -
-
-
-
-

Class template basic_parsed_options

-

boost::program_options::basic_parsed_options

-
-

Synopsis

-
// In header: <boost/program_options/parsers.hpp>
-
-template<typename charT> 
-class basic_parsed_options {
-public:
-  // construct/copy/destruct
-  explicit basic_parsed_options(const options_description *, int = 0);
-
-  // public data members
-  std::vector< basic_option< charT > > options;
-  const options_description * description;
-  int m_options_prefix;
-};
-
-

Description

-

Results of parsing an input source. The primary use of this class is passing information from parsers component to value storage component. This class does not makes much sense itself.

-
-

-basic_parsed_options - public - construct/copy/destruct

-
  1. explicit basic_parsed_options(const options_description * xdescription, 
    -                              int options_prefix = 0);
-
-
-

-basic_parsed_options - public - public data members

-
    -
  1. -
    std::vector< basic_option< charT > > options;
    -

    Options found in the source.

    -
  2. -
  3. -
    const options_description * description;
    -

    Options description that was used for parsing. Parsers should return pointer to the instance of option_description passed to them, and issues of lifetime are up to the caller. Can be NULL.

    -
  4. -
  5. -
    int m_options_prefix;
    -

    Mainly used for the diagnostic messages in exceptions. The canonical option prefix for the parser which generated these results, depending on the settings for basic_command_line_parser::style() or cmdline::style(). In order of precedence of command_line_style enums: allow_long allow_long_disguise allow_dash_for_short allow_slash_for_short

    -
  6. -
-
- -
-
- - - -
-
-
-PrevUpHomeNext -
- - diff --git a/libs/program_options/doc/html/boost/program_options/bool_switch.html b/libs/program_options/doc/html/boost/program_options/bool_switch.html deleted file mode 100644 index f90d744021..0000000000 --- a/libs/program_options/doc/html/boost/program_options/bool_switch.html +++ /dev/null @@ -1,55 +0,0 @@ - - - -Function bool_switch - - - - - - - - - - - - - - - -
Boost C++ LibrariesHomeLibrariesPeopleFAQMore
-
-
-PrevUpHomeNext -
-
-
-
-

Function bool_switch

-

boost::program_options::bool_switch

-
-

Synopsis

-
// In header: <boost/program_options/value_semantic.hpp>
-
-
-BOOST_PROGRAM_OPTIONS_DECL typed_value< bool > * bool_switch();
-BOOST_PROGRAM_OPTIONS_DECL typed_value< bool > * bool_switch(bool * v);
-
-

Description

-

Works the same way as the 'value<bool>' function, but the created value_semantic won't accept any explicit value. So, if the option is present on the command line, the value will be 'true'.

-
-
- - - -
-
-
-PrevUpHomeNext -
- - diff --git a/libs/program_options/doc/html/boost/program_options/collect_unrecognized.html b/libs/program_options/doc/html/boost/program_options/collect_unrecognized.html deleted file mode 100644 index b03c5acdd7..0000000000 --- a/libs/program_options/doc/html/boost/program_options/collect_unrecognized.html +++ /dev/null @@ -1,57 +0,0 @@ - - - -Function template collect_unrecognized - - - - - - - - - - - - - - - -
Boost C++ LibrariesHomeLibrariesPeopleFAQMore
-
-
-PrevUpHomeNext -
-
-
-
-

Function template collect_unrecognized

-

boost::program_options::collect_unrecognized

-
-

Synopsis

-
// In header: <boost/program_options/parsers.hpp>
-
-
-template<typename charT> 
-  std::vector< std::basic_string< charT > > 
-  collect_unrecognized(const std::vector< basic_option< charT > > & options, 
-                       enum collect_unrecognized_mode mode);
-
-

Description

-

Collects the original tokens for all named options with 'unregistered' flag set. If 'mode' is 'include_positional' also collects all positional options. Returns the vector of origianl tokens for all collected options.

-
-
- - - -
-
-
-PrevUpHomeNext -
- - diff --git a/libs/program_options/doc/html/boost/program_options/collect_unrecognized_mode.html b/libs/program_options/doc/html/boost/program_options/collect_unrecognized_mode.html deleted file mode 100644 index a97e40f398..0000000000 --- a/libs/program_options/doc/html/boost/program_options/collect_unrecognized_mode.html +++ /dev/null @@ -1,55 +0,0 @@ - - - -Type collect_unrecognized_mode - - - - - - - - - - - - - - - -
Boost C++ LibrariesHomeLibrariesPeopleFAQMore
-
-
-PrevUpHomeNext -
-
-
-
-

Type collect_unrecognized_mode

-

boost::program_options::collect_unrecognized_mode

-
-

Synopsis

-
// In header: <boost/program_options/parsers.hpp>
-
-
-
-enum collect_unrecognized_mode { include_positional, exclude_positional };
-
-

Description

-

Controls if the 'collect_unregistered' function should include positional options, or not.

-
-
- - - -
-
-
-PrevUpHomeNext -
- - diff --git a/libs/program_options/doc/html/boost/program_options/command_line_style/style_t.html b/libs/program_options/doc/html/boost/program_options/command_line_style/style_t.html deleted file mode 100644 index cad972b646..0000000000 --- a/libs/program_options/doc/html/boost/program_options/command_line_style/style_t.html +++ /dev/null @@ -1,111 +0,0 @@ - - - -Type style_t - - - - - - - - - - - - - - - -
Boost C++ LibrariesHomeLibrariesPeopleFAQMore
-
-
-PrevUpHomeNext -
-
-
-
-

Type style_t

-

boost::program_options::command_line_style::style_t

-
-

Synopsis

-
// In header: <boost/program_options/cmdline.hpp>
-
-
-enum style_t { allow_long =  1, allow_short =  allow_long << 1, 
-               allow_dash_for_short =  allow_short << 1, 
-               allow_slash_for_short =  allow_dash_for_short << 1, 
-               long_allow_adjacent =  allow_slash_for_short << 1, 
-               long_allow_next =  long_allow_adjacent << 1, 
-               short_allow_adjacent =  long_allow_next << 1, 
-               short_allow_next =  short_allow_adjacent << 1, 
-               allow_sticky =  short_allow_next << 1, 
-               allow_guessing =  allow_sticky << 1, 
-               long_case_insensitive =  allow_guessing << 1, 
-               short_case_insensitive =  long_case_insensitive << 1, 
-               case_insensitive =  (long_case_insensitive | short_case_insensitive), 
-               allow_long_disguise =  short_case_insensitive << 1, 
-               unix_style =  (allow_short | short_allow_adjacent | short_allow_next
-                      | allow_long | long_allow_adjacent | long_allow_next
-                      | allow_sticky | allow_guessing 
-                      | allow_dash_for_short), 
-               default_style =  unix_style };
-
-

Description

-

Various possible styles of options.

-

There are "long" options, which start with "--" and "short", which start with either "-" or "/". Both kinds can be allowed or disallowed, see allow_long and allow_short. The allowed character for short options is also configurable.

-

Option's value can be specified in the same token as name ("--foo=bar"), or in the next token.

-

It's possible to introduce long options by the same character as short options, see allow_long_disguise.

-

Finally, guessing (specifying only prefix of option) and case insensitive processing are supported.

-
-
allow_long
-
Allow "--long_name" style.
-
allow_short
-
Allow "-<single character" style.
-
allow_dash_for_short
-
Allow "-" in short options.
-
allow_slash_for_short
-
Allow "/" in short options.
-
long_allow_adjacent
-

Allow option parameter in the same token for long option, like in - --foo=10 -

-
long_allow_next
-

Allow option parameter in the next token for long options.

-
short_allow_adjacent
-

Allow option parameter in the same token for short options.

-
short_allow_next
-

Allow option parameter in the next token for short options.

-
allow_sticky
-

Allow to merge several short options together, so that "-s -k" become "-sk". All of the options but last should accept no parameter. For example, if "-s" accept a parameter, then "k" will be taken as parameter, not another short option. Dos-style short options cannot be sticky.

-
allow_guessing
-

Allow abbreviated spellings for long options, if they unambiguously identify long option. No long option name should be prefix of other long option name if guessing is in effect.

-
long_case_insensitive
-

Ignore the difference in case for long options.

-
short_case_insensitive
-

Ignore the difference in case for short options.

-
case_insensitive
-

Ignore the difference in case for all options.

-
allow_long_disguise
-

Allow long options with single option starting character, e.g -foo=10

-
unix_style
-

The more-or-less traditional unix style.

-
default_style
-

The default style.

-
-
-
- - - -
-
-
-PrevUpHomeNext -
- - diff --git a/libs/program_options/doc/html/boost/program_options/duplicate_option_error.html b/libs/program_options/doc/html/boost/program_options/duplicate_option_error.html deleted file mode 100644 index 90b444b7ce..0000000000 --- a/libs/program_options/doc/html/boost/program_options/duplicate_option_error.html +++ /dev/null @@ -1,65 +0,0 @@ - - - -Class duplicate_option_error - - - - - - - - - - - - - - - -
Boost C++ LibrariesHomeLibrariesPeopleFAQMore
-
-
-PrevUpHomeNext -
-
-
-
-

Class duplicate_option_error

-

boost::program_options::duplicate_option_error

-
-

Synopsis

-
// In header: <boost/program_options/options_description.hpp>
-
-
-class duplicate_option_error : public boost::program_options::error {
-public:
-  // construct/copy/destruct
-  duplicate_option_error(const std::string &);
-};
-
-

Description

-

Class thrown when duplicate option description is found.

-
-

-duplicate_option_error - public - construct/copy/destruct

-
  1. duplicate_option_error(const std::string & xwhat);
-
-
-
- - - -
-
-
-PrevUpHomeNext -
- - diff --git a/libs/program_options/doc/html/boost/program_options/error.html b/libs/program_options/doc/html/boost/program_options/error.html deleted file mode 100644 index 02cfb8991d..0000000000 --- a/libs/program_options/doc/html/boost/program_options/error.html +++ /dev/null @@ -1,65 +0,0 @@ - - - -Class error - - - - - - - - - - - - - - - -
Boost C++ LibrariesHomeLibrariesPeopleFAQMore
-
-
-PrevUpHomeNext -
-
-
-
-

Class error

-

boost::program_options::error

-
-

Synopsis

-
// In header: <boost/program_options/errors.hpp>
-
-
-class error {
-public:
-  // construct/copy/destruct
-  error(const std::string &);
-};
-
-

Description

-

Base class for all errors in the library.

-
-

-error - public - construct/copy/destruct

-
  1. error(const std::string & xwhat);
-
-
-
- - - -
-
-
-PrevUpHomeNext -
- - diff --git a/libs/program_options/doc/html/boost/program_options/error_with_no_option_name.html b/libs/program_options/doc/html/boost/program_options/error_with_no_option_name.html deleted file mode 100644 index f8c44fb049..0000000000 --- a/libs/program_options/doc/html/boost/program_options/error_with_no_option_name.html +++ /dev/null @@ -1,85 +0,0 @@ - - - -Class error_with_no_option_name - - - - - - - - - - - - - - - -
Boost C++ LibrariesHomeLibrariesPeopleFAQMore
-
-
-PrevUpHomeNext -
-
-
-
-

Class error_with_no_option_name

-

boost::program_options::error_with_no_option_name

-
-

Synopsis

-
// In header: <boost/program_options/errors.hpp>
-
-
-class error_with_no_option_name :
-  public boost::program_options::error_with_option_name
-{
-public:
-  // construct/copy/destruct
-  error_with_no_option_name(const std::string &, const std::string & = "");
-  ~error_with_no_option_name();
-
-  // public member functions
-  virtual void set_option_name(const std::string &);
-};
-
-

Description

-

Base class of unparsable options, when the desired option cannot be identified.

-

It makes no sense to have an option name, when we can't match an option to the parameter

-

Having this a part of the error_with_option_name hierachy makes error handling a lot easier, even if the name indicates some sort of conceptual dissonance!

-
-

-error_with_no_option_name - public - construct/copy/destruct

-
    -
  1. error_with_no_option_name(const std::string & template_, 
    -                          const std::string & original_token = "");
  2. -
  3. ~error_with_no_option_name();
  4. -
-
-
-

-error_with_no_option_name public member functions

-
  1. -
    virtual void set_option_name(const std::string &);
    -

    Does NOT set option name, because no option name makes sense

    -
-
-
-
- - - -
-
-
-PrevUpHomeNext -
- - diff --git a/libs/program_options/doc/html/boost/program_options/error_with_option_name.html b/libs/program_options/doc/html/boost/program_options/error_with_option_name.html deleted file mode 100644 index a824b10be7..0000000000 --- a/libs/program_options/doc/html/boost/program_options/error_with_option_name.html +++ /dev/null @@ -1,159 +0,0 @@ - - - -Class error_with_option_name - - - - - - - - - - - - - - - -
Boost C++ LibrariesHomeLibrariesPeopleFAQMore
-
-
-PrevUpHomeNext -
-
-
-
-

Class error_with_option_name

-

boost::program_options::error_with_option_name

-
-

Synopsis

-
// In header: <boost/program_options/errors.hpp>
-
-
-class error_with_option_name : public boost::program_options::error {
-public:
-  // construct/copy/destruct
-  error_with_option_name(const std::string &, const std::string & = "", 
-                         const std::string & = "", int = 0);
-  ~error_with_option_name();
-
-  // public member functions
-  void set_substitute(const std::string &, const std::string &);
-  void set_substitute_default(const std::string &, const std::string &, 
-                              const std::string &);
-  void add_context(const std::string &, const std::string &, int);
-  void set_prefix(int);
-  virtual void set_option_name(const std::string &);
-  std::string get_option_name() const;
-  void set_original_token(const std::string &);
-  virtual const char * what() const;
-
-  // protected member functions
-  virtual void substitute_placeholders(const std::string &) const;
-  void replace_token(const std::string &, const std::string &) const;
-  std::string get_canonical_option_name() const;
-  std::string get_canonical_option_prefix() const;
-
-  // public data members
-  std::string m_error_template;
-};
-
-

Description

-

Base class for most exceptions in the library.

-

Substitutes the values for the parameter name placeholders in the template to create the human readable error message

-

Placeholders are surrounded by % signs: example% Poor man's version of boost::format

-

If a parameter name is absent, perform default substitutions instead so ugly placeholders are never left in-place.

-

Options are displayed in "canonical" form This is the most unambiguous form of the *parsed* option name and would correspond to option_description::format_name() i.e. what is shown by print_usage()

-

The "canonical" form depends on whether the option is specified in short or long form, using dashes or slashes or without a prefix (from a configuration file)

-
-

-error_with_option_name - public - construct/copy/destruct

-
    -
  1. error_with_option_name(const std::string & template_, 
    -                       const std::string & option_name = "", 
    -                       const std::string & original_token = "", 
    -                       int option_style = 0);
  2. -
  3. -
    ~error_with_option_name();
    -

    gcc says that throw specification on dtor is loosened without this line

    -
  4. -
-
-
-

-error_with_option_name public member functions

-
    -
  1. -
    void set_substitute(const std::string & parameter_name, 
    -                    const std::string & value);
    -

    Substitute parameter_name->value to create the error message from the error template

    -
  2. -
  3. -
    void set_substitute_default(const std::string & parameter_name, 
    -                            const std::string & from, const std::string & to);
    -

    If the parameter is missing, then make the from->to substitution instead

    -
  4. -
  5. -
    void add_context(const std::string & option_name, 
    -                 const std::string & original_token, int option_style);
    -

    Add context to an exception

    -
  6. -
  7. void set_prefix(int option_style);
  8. -
  9. -
    virtual void set_option_name(const std::string & option_name);
    -

    Overridden in error_with_no_option_name

    -
  10. -
  11. std::string get_option_name() const;
  12. -
  13. void set_original_token(const std::string & original_token);
  14. -
  15. -
    virtual const char * what() const;
    -

    Creates the error_message on the fly Currently a thin wrapper for substitute_placeholders()

    -
  16. -
-
-
-

-error_with_option_name protected member functions

-
    -
  1. -
    virtual void substitute_placeholders(const std::string & error_template) const;
    -

    Makes all substitutions using the template

    -
  2. -
  3. void replace_token(const std::string & from, const std::string & to) const;
  4. -
  5. -
    std::string get_canonical_option_name() const;
    -

    Construct option name in accordance with the appropriate prefix style: i.e. long dash or short slash etc

    -
  6. -
  7. std::string get_canonical_option_prefix() const;
  8. -
-
-
-

-error_with_option_name - public - public data members

-
  1. -
    std::string m_error_template;
    -

    template with placeholders

    -
-
-
-
- - - -
-
-
-PrevUpHomeNext -
- - diff --git a/libs/program_options/doc/html/boost/program_options/ext_parser.html b/libs/program_options/doc/html/boost/program_options/ext_parser.html deleted file mode 100644 index 1d78a13a73..0000000000 --- a/libs/program_options/doc/html/boost/program_options/ext_parser.html +++ /dev/null @@ -1,54 +0,0 @@ - - - -Type definition ext_parser - - - - - - - - - - - - - - - -
Boost C++ LibrariesHomeLibrariesPeopleFAQMore
-
-
-PrevUpHomeNext -
-
-
-
-

Type definition ext_parser

-

ext_parser

-
-

Synopsis

-
// In header: <boost/program_options/parsers.hpp>
-
-
-typedef function1< std::pair< std::string, std::string >, const std::string & > ext_parser;
-
-

Description

-

Augments basic_parsed_options<wchar_t> with conversion from 'parsed_options'

-
-
- - - -
-
-
-PrevUpHomeNext -
- - diff --git a/libs/program_options/doc/html/boost/program_options/invalid_bool_value.html b/libs/program_options/doc/html/boost/program_options/invalid_bool_value.html deleted file mode 100644 index 59ca02df86..0000000000 --- a/libs/program_options/doc/html/boost/program_options/invalid_bool_value.html +++ /dev/null @@ -1,65 +0,0 @@ - - - -Class invalid_bool_value - - - - - - - - - - - - - - - -
Boost C++ LibrariesHomeLibrariesPeopleFAQMore
-
-
-PrevUpHomeNext -
-
-
-
-

Class invalid_bool_value

-

boost::program_options::invalid_bool_value

-
-

Synopsis

-
// In header: <boost/program_options/errors.hpp>
-
-
-class invalid_bool_value : public boost::program_options::validation_error {
-public:
-  // construct/copy/destruct
-  invalid_bool_value(const std::string &);
-};
-
-

Description

-

Class thrown if there is an invalid bool value given

-
-

-invalid_bool_value - public - construct/copy/destruct

-
  1. invalid_bool_value(const std::string & value);
-
-
-
- - - -
-
-
-PrevUpHomeNext -
- - diff --git a/libs/program_options/doc/html/boost/program_options/invalid_command_idp6969504.html b/libs/program_options/doc/html/boost/program_options/invalid_command_idp6969504.html deleted file mode 100644 index 44a88123f8..0000000000 --- a/libs/program_options/doc/html/boost/program_options/invalid_command_idp6969504.html +++ /dev/null @@ -1,74 +0,0 @@ - - - -Class invalid_command_line_syntax - - - - - - - - - - - - - - - -
Boost C++ LibrariesHomeLibrariesPeopleFAQMore
-
-
-PrevUpHomeNext -
-
-
-
-

Class invalid_command_line_syntax

-

boost::program_options::invalid_command_line_syntax

-
-

Synopsis

-
// In header: <boost/program_options/errors.hpp>
-
-
-class invalid_command_line_syntax :
-  public boost::program_options::invalid_syntax
-{
-public:
-  // construct/copy/destruct
-  invalid_command_line_syntax(kind_t, const std::string & = "", 
-                              const std::string & = "", int = 0);
-  ~invalid_command_line_syntax();
-};
-
-

Description

-

Class thrown when there are syntax errors in given command line

-
-

-invalid_command_line_syntax - public - construct/copy/destruct

-
    -
  1. invalid_command_line_syntax(kind_t kind, const std::string & option_name = "", 
    -                            const std::string & original_token = "", 
    -                            int option_style = 0);
  2. -
  3. ~invalid_command_line_syntax();
  4. -
-
-
-
- - - -
-
-
-PrevUpHomeNext -
- - diff --git a/libs/program_options/doc/html/boost/program_options/invalid_command_line_style.html b/libs/program_options/doc/html/boost/program_options/invalid_command_line_style.html deleted file mode 100644 index 58c5080fc2..0000000000 --- a/libs/program_options/doc/html/boost/program_options/invalid_command_line_style.html +++ /dev/null @@ -1,65 +0,0 @@ - - - -Class invalid_command_line_style - - - - - - - - - - - - - - - -
Boost C++ LibrariesHomeLibrariesPeopleFAQMore
-
-
-PrevUpHomeNext -
-
-
-
-

Class invalid_command_line_style

-

boost::program_options::invalid_command_line_style

-
-

Synopsis

-
// In header: <boost/program_options/errors.hpp>
-
-
-class invalid_command_line_style : public boost::program_options::error {
-public:
-  // construct/copy/destruct
-  invalid_command_line_style(const std::string &);
-};
-
-

Description

-

Class thrown when there are programming error related to style

-
-

-invalid_command_line_style - public - construct/copy/destruct

-
  1. invalid_command_line_style(const std::string & msg);
-
-
-
- - - -
-
-
-PrevUpHomeNext -
- - diff --git a/libs/program_options/doc/html/boost/program_options/invalid_config_file_syntax.html b/libs/program_options/doc/html/boost/program_options/invalid_config_file_syntax.html deleted file mode 100644 index 6f147c6aa2..0000000000 --- a/libs/program_options/doc/html/boost/program_options/invalid_config_file_syntax.html +++ /dev/null @@ -1,81 +0,0 @@ - - - -Class invalid_config_file_syntax - - - - - - - - - - - - - - - -
Boost C++ LibrariesHomeLibrariesPeopleFAQMore
-
-
-PrevUpHomeNext -
-
-
-
-

Class invalid_config_file_syntax

-

boost::program_options::invalid_config_file_syntax

-
-

Synopsis

-
// In header: <boost/program_options/errors.hpp>
-
-
-class invalid_config_file_syntax :
-  public boost::program_options::invalid_syntax
-{
-public:
-  // construct/copy/destruct
-  invalid_config_file_syntax(const std::string &, kind_t);
-  ~invalid_config_file_syntax();
-
-  // public member functions
-  virtual std::string tokens() const;
-};
-
-

Description

-
-

-invalid_config_file_syntax - public - construct/copy/destruct

-
    -
  1. invalid_config_file_syntax(const std::string & invalid_line, kind_t kind);
  2. -
  3. ~invalid_config_file_syntax();
  4. -
-
-
-

-invalid_config_file_syntax public member functions

-
  1. -
    virtual std::string tokens() const;
    -

    Convenience functions for backwards compatibility

    -
-
-
-
- - - -
-
-
-PrevUpHomeNext -
- - diff --git a/libs/program_options/doc/html/boost/program_options/invalid_option_value.html b/libs/program_options/doc/html/boost/program_options/invalid_option_value.html deleted file mode 100644 index de3eae96ac..0000000000 --- a/libs/program_options/doc/html/boost/program_options/invalid_option_value.html +++ /dev/null @@ -1,69 +0,0 @@ - - - -Class invalid_option_value - - - - - - - - - - - - - - - -
Boost C++ LibrariesHomeLibrariesPeopleFAQMore
-
-
-PrevUpHomeNext -
-
-
-
-

Class invalid_option_value

-

boost::program_options::invalid_option_value

-
-

Synopsis

-
// In header: <boost/program_options/errors.hpp>
-
-
-class invalid_option_value : public boost::program_options::validation_error {
-public:
-  // construct/copy/destruct
-  invalid_option_value(const std::string &);
-  invalid_option_value(const std::wstring &);
-};
-
-

Description

-

Class thrown if there is an invalid option value given

-
-

-invalid_option_value - public - construct/copy/destruct

-
    -
  1. invalid_option_value(const std::string & value);
  2. -
  3. invalid_option_value(const std::wstring & value);
  4. -
-
-
-
- - - -
-
-
-PrevUpHomeNext -
- - diff --git a/libs/program_options/doc/html/boost/program_options/invalid_syntax.html b/libs/program_options/doc/html/boost/program_options/invalid_syntax.html deleted file mode 100644 index 84d69bd95e..0000000000 --- a/libs/program_options/doc/html/boost/program_options/invalid_syntax.html +++ /dev/null @@ -1,101 +0,0 @@ - - - -Class invalid_syntax - - - - - - - - - - - - - - - -
Boost C++ LibrariesHomeLibrariesPeopleFAQMore
-
-
-PrevUpHomeNext -
-
-
-
-

Class invalid_syntax

-

boost::program_options::invalid_syntax

-
-

Synopsis

-
// In header: <boost/program_options/errors.hpp>
-
-
-class invalid_syntax : public boost::program_options::error_with_option_name {
-public:
-
-  enum kind_t { long_not_allowed =  30, long_adjacent_not_allowed, 
-                short_adjacent_not_allowed, empty_adjacent_parameter, 
-                missing_parameter, extra_parameter, unrecognized_line };
-  // construct/copy/destruct
-  invalid_syntax(kind_t, const std::string & = "", const std::string & = "", 
-                 int = 0);
-  ~invalid_syntax();
-
-  // public member functions
-  kind_t kind() const;
-  virtual std::string tokens() const;
-
-  // protected member functions
-  std::string get_template(kind_t);
-};
-
-

Description

-

Class thrown when there's syntax error either for command line or config file options. See derived children for concrete classes.

-
-

-invalid_syntax - public - construct/copy/destruct

-
    -
  1. invalid_syntax(kind_t kind, const std::string & option_name = "", 
    -               const std::string & original_token = "", int option_style = 0);
  2. -
  3. ~invalid_syntax();
  4. -
-
-
-

-invalid_syntax public member functions

-
    -
  1. kind_t kind() const;
  2. -
  3. -
    virtual std::string tokens() const;
    -

    Convenience functions for backwards compatibility

    -
  4. -
-
-
-

-invalid_syntax protected member functions

-
  1. -
    std::string get_template(kind_t kind);
    -

    Used to convert kind_t to a related error text

    -
-
-
-
- - - -
-
-
-PrevUpHomeNext -
- - diff --git a/libs/program_options/doc/html/boost/program_options/multiple_occurrences.html b/libs/program_options/doc/html/boost/program_options/multiple_occurrences.html deleted file mode 100644 index db3124bb50..0000000000 --- a/libs/program_options/doc/html/boost/program_options/multiple_occurrences.html +++ /dev/null @@ -1,71 +0,0 @@ - - - -Class multiple_occurrences - - - - - - - - - - - - - - - -
Boost C++ LibrariesHomeLibrariesPeopleFAQMore
-
-
-PrevUpHomeNext -
-
-
-
-

Class multiple_occurrences

-

boost::program_options::multiple_occurrences

-
-

Synopsis

-
// In header: <boost/program_options/errors.hpp>
-
-
-class multiple_occurrences :
-  public boost::program_options::error_with_option_name
-{
-public:
-  // construct/copy/destruct
-  multiple_occurrences();
-  ~multiple_occurrences();
-};
-
-

Description

-

Class thrown when there are several occurrences of an option, but user called a method which cannot return them all.

-
-

-multiple_occurrences - public - construct/copy/destruct

-
    -
  1. multiple_occurrences();
  2. -
  3. ~multiple_occurrences();
  4. -
-
-
-
- - - -
-
-
-PrevUpHomeNext -
- - diff --git a/libs/program_options/doc/html/boost/program_options/multiple_values.html b/libs/program_options/doc/html/boost/program_options/multiple_values.html deleted file mode 100644 index 7f50f655a5..0000000000 --- a/libs/program_options/doc/html/boost/program_options/multiple_values.html +++ /dev/null @@ -1,69 +0,0 @@ - - - -Class multiple_values - - - - - - - - - - - - - - - -
Boost C++ LibrariesHomeLibrariesPeopleFAQMore
-
-
-PrevUpHomeNext -
-
-
-
-

Class multiple_values

-

boost::program_options::multiple_values

-
-

Synopsis

-
// In header: <boost/program_options/errors.hpp>
-
-
-class multiple_values : public boost::program_options::error_with_option_name {
-public:
-  // construct/copy/destruct
-  multiple_values();
-  ~multiple_values();
-};
-
-

Description

-

Class thrown when there are several option values, but user called a method which cannot return them all.

-
-

-multiple_values - public - construct/copy/destruct

-
    -
  1. multiple_values();
  2. -
  3. ~multiple_values();
  4. -
-
-
-
- - - -
-
-
-PrevUpHomeNext -
- - diff --git a/libs/program_options/doc/html/boost/program_options/notify.html b/libs/program_options/doc/html/boost/program_options/notify.html deleted file mode 100644 index 9fa3bf9bc9..0000000000 --- a/libs/program_options/doc/html/boost/program_options/notify.html +++ /dev/null @@ -1,54 +0,0 @@ - - - -Function notify - - - - - - - - - - - - - - - -
Boost C++ LibrariesHomeLibrariesPeopleFAQMore
-
-
-PrevUpHomeNext -
-
-
-
-

Function notify

-

boost::program_options::notify

-
-

Synopsis

-
// In header: <boost/program_options/variables_map.hpp>
-
-
-BOOST_PROGRAM_OPTIONS_DECL void notify(variables_map & m);
-
-

Description

-

Runs all 'notify' function for options in 'm'.

-
-
- - - -
-
-
-PrevUpHomeNext -
- - diff --git a/libs/program_options/doc/html/boost/program_options/option_description.html b/libs/program_options/doc/html/boost/program_options/option_description.html deleted file mode 100644 index 9de58f4381..0000000000 --- a/libs/program_options/doc/html/boost/program_options/option_description.html +++ /dev/null @@ -1,145 +0,0 @@ - - - -Class option_description - - - - - - - - - - - - - - - -
Boost C++ LibrariesHomeLibrariesPeopleFAQMore
-
-
-PrevUpHomeNext -
-
-
-
-

Class option_description

-

boost::program_options::option_description

-
-

Synopsis

-
// In header: <boost/program_options/options_description.hpp>
-
-
-class option_description {
-public:
-
-  enum match_result { no_match, full_match, approximate_match };
-  // construct/copy/destruct
-  option_description();
-  option_description(const char *, const value_semantic *);
-  option_description(const char *, const value_semantic *, const char *);
-  ~option_description();
-
-  // public member functions
-  match_result match(const std::string &, bool, bool, bool) const;
-  const std::string & key(const std::string &) const;
-  std::string canonical_display_name(int = 0) const;
-  const std::string & long_name() const;
-  const std::string & description() const;
-  shared_ptr< const value_semantic > semantic() const;
-  std::string format_name() const;
-  std::string format_parameter() const;
-
-  // private member functions
-  option_description & set_name(const char *);
-};
-
-

Description

-

Describes one possible command line/config file option. There are two kinds of properties of an option. First describe it syntactically and are used only to validate input. Second affect interpretation of the option, for example default value for it or function that should be called when the value is finally known. Routines which perform parsing never use second kind of properties \-- they are side effect free.

-

See Also:

-

options_description

-

-

-
-

-option_description - public - construct/copy/destruct

-
    -
  1. option_description();
  2. -
  3. -
    option_description(const char * name, const value_semantic * s);
    -

    Initializes the object with the passed data.

    -

    Note: it would be nice to make the second parameter auto_ptr, to explicitly pass ownership. Unfortunately, it's often needed to create objects of types derived from 'value_semantic': options_description d; d.add_options()("a", parameter<int>("n")->default_value(1)); Here, the static type returned by 'parameter' should be derived from value_semantic.

    -

    Alas, derived->base conversion for auto_ptr does not really work, see http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2000/n1232.pdf http://www.open-std.org/jtc1/sc22/wg21/docs/cwg_defects.html#84

    -

    So, we have to use plain old pointers. Besides, users are not expected to use the constructor directly.

    -

    The 'name' parameter is interpreted by the following rules:

    -
      -
    • if there's no "," character in 'name', it specifies long name

    • -
    • otherwise, the part before "," specifies long name and the part after \-- short name.

    • -
    -

    -

    -
  4. -
  5. -
    option_description(const char * name, const value_semantic * s, 
    -                   const char * description);
    -

    Initializes the class with the passed data.

    -
  6. -
  7. ~option_description();
  8. -
-
-
-

-option_description public member functions

-
    -
  1. -
    match_result 
    -match(const std::string & option, bool approx, bool long_ignore_case, 
    -      bool short_ignore_case) const;
    -

    Given 'option', specified in the input source, returns 'true' if 'option' specifies *this.

    -
  2. -
  3. -
    const std::string & key(const std::string & option) const;
    -

    Returns the key that should identify the option, in particular in the variables_map class. The 'option' parameter is the option spelling from the input source. If option name contains '*', returns 'option'. If long name was specified, it's the long name, otherwise it's a short name with prepended '-'.

    -
  4. -
  5. -
    std::string canonical_display_name(int canonical_option_style = 0) const;
    -

    Returns the canonical name for the option description to enable the user to recognised a matching option. 1) For short options ('-', '/'), returns the short name prefixed. 2) For long options ('--' / '-') returns the long name prefixed 3) All other cases, returns the long name (if present) or the short name, unprefixed.

    -
  6. -
  7. const std::string & long_name() const;
  8. -
  9. -
    const std::string & description() const;
    Explanation of this option.
  10. -
  11. -
    shared_ptr< const value_semantic > semantic() const;
    Semantic of option's value.
  12. -
  13. -
    std::string format_name() const;
    Returns the option name, formatted suitably for usage message.
  14. -
  15. -
    std::string format_parameter() const;
    -

    Returns the parameter name and properties, formatted suitably for usage message.

    -
  16. -
-
-
-

-option_description private member functions

-
  1. option_description & set_name(const char * name);
-
-
-
- - - -
-
-
-PrevUpHomeNext -
- - diff --git a/libs/program_options/doc/html/boost/program_options/options_descrip_idp8075600.html b/libs/program_options/doc/html/boost/program_options/options_descrip_idp8075600.html deleted file mode 100644 index ffbb2bd48f..0000000000 --- a/libs/program_options/doc/html/boost/program_options/options_descrip_idp8075600.html +++ /dev/null @@ -1,85 +0,0 @@ - - - -Class options_description_easy_init - - - - - - - - - - - - - - - -
Boost C++ LibrariesHomeLibrariesPeopleFAQMore
-
-
-PrevUpHomeNext -
-
-
-
-

Class options_description_easy_init

-

boost::program_options::options_description_easy_init

-
-

Synopsis

- -
-

Description

-

Class which provides convenient creation syntax to option_description.

-
-

-options_description_easy_init - public - construct/copy/destruct

-
  1. options_description_easy_init(options_description * owner);
-
-
-

-options_description_easy_init public member functions

-
    -
  1. options_description_easy_init & 
    -operator()(const char * name, const char * description);
  2. -
  3. options_description_easy_init & 
    -operator()(const char * name, const value_semantic * s);
  4. -
  5. options_description_easy_init & 
    -operator()(const char * name, const value_semantic * s, 
    -           const char * description);
  6. -
-
-
-
- - - -
-
-
-PrevUpHomeNext -
- - diff --git a/libs/program_options/doc/html/boost/program_options/options_description.html b/libs/program_options/doc/html/boost/program_options/options_description.html deleted file mode 100644 index cd62c2638f..0000000000 --- a/libs/program_options/doc/html/boost/program_options/options_description.html +++ /dev/null @@ -1,146 +0,0 @@ - - - -Class options_description - - - - - - - - - - - - - - - -
Boost C++ LibrariesHomeLibrariesPeopleFAQMore
-
-
-PrevUpHomeNext -
-
-
-
-

Class options_description

-

boost::program_options::options_description

-
-

Synopsis

-
// In header: <boost/program_options/options_description.hpp>
-
-
-class options_description {
-public:
-  // construct/copy/destruct
-  options_description(unsigned = m_default_line_length, 
-                      unsigned = m_default_line_length/2);
-  options_description(const std::string &, unsigned = m_default_line_length, 
-                      unsigned = m_default_line_length/2);
-
-  // public member functions
-  void add(shared_ptr< option_description >);
-  options_description & add(const options_description &);
-  unsigned get_option_column_width() const;
-  options_description_easy_init add_options();
-  const option_description & 
-  find(const std::string &, bool, bool = false, bool = false) const;
-  const option_description * 
-  find_nothrow(const std::string &, bool, bool = false, bool = false) const;
-  const std::vector< shared_ptr< option_description > > & options() const;
-  void print(std::ostream &, unsigned = 0) const;
-
-  // friend functions
-  friend BOOST_PROGRAM_OPTIONS_DECL std::ostream & 
-  operator<<(std::ostream &, const options_description &);
-
-  // public data members
-  static const unsigned m_default_line_length;
-};
-
-

Description

-

A set of option descriptions. This provides convenient interface for adding new option (the add_options) method, and facilities to search for options by name.

-

See here for option adding interface discussion.

-

See Also:

-

option_description

-

-

-
-

-options_description - public - construct/copy/destruct

-
    -
  1. -
    options_description(unsigned line_length = m_default_line_length, 
    -                    unsigned min_description_length = m_default_line_length/2);
    -

    Creates the instance.

    -
  2. -
  3. -
    options_description(const std::string & caption, 
    -                    unsigned line_length = m_default_line_length, 
    -                    unsigned min_description_length = m_default_line_length/2);
    -

    Creates the instance. The 'caption' parameter gives the name of this 'options_description' instance. Primarily useful for output. The 'description_length' specifies the number of columns that should be reserved for the description text; if the option text encroaches into this, then the description will start on the next line.

    -
  4. -
-
-
-

-options_description public member functions

-
    -
  1. -
    void add(shared_ptr< option_description > desc);
    -

    Adds new variable description. Throws duplicate_variable_error if either short or long name matches that of already present one.

    -
  2. -
  3. -
    options_description & add(const options_description & desc);
    -

    Adds a group of option description. This has the same effect as adding all option_descriptions in 'desc' individually, except that output operator will show a separate group. Returns *this.

    -
  4. -
  5. -
    unsigned get_option_column_width() const;
    -

    Find the maximum width of the option column, including options in groups.

    -
  6. -
  7. -
    options_description_easy_init add_options();
    -

    Returns an object of implementation-defined type suitable for adding options to options_description. The returned object will have overloaded operator() with parameter type matching 'option_description' constructors. Calling the operator will create new option_description instance and add it.

    -
  8. -
  9. const option_description & 
    -find(const std::string & name, bool approx, bool long_ignore_case = false, 
    -     bool short_ignore_case = false) const;
  10. -
  11. const option_description * 
    -find_nothrow(const std::string & name, bool approx, 
    -             bool long_ignore_case = false, bool short_ignore_case = false) const;
  12. -
  13. const std::vector< shared_ptr< option_description > > & options() const;
  14. -
  15. -
    void print(std::ostream & os, unsigned width = 0) const;
    -

    Outputs 'desc' to the specified stream, calling 'f' to output each option_description element.

    -
  16. -
-
-
-

-options_description friend functions

-
  1. -
    friend BOOST_PROGRAM_OPTIONS_DECL std::ostream & 
    -operator<<(std::ostream & os, const options_description & desc);
    -

    Produces a human readable output of 'desc', listing options, their descriptions and allowed parameters. Other options_description instances previously passed to add will be output separately.

    -
-
-
-
- - - -
-
-
-PrevUpHomeNext -
- - diff --git a/libs/program_options/doc/html/boost/program_options/parse_command_line.html b/libs/program_options/doc/html/boost/program_options/parse_command_line.html deleted file mode 100644 index 57346cc8bd..0000000000 --- a/libs/program_options/doc/html/boost/program_options/parse_command_line.html +++ /dev/null @@ -1,58 +0,0 @@ - - - -Function template parse_command_line - - - - - - - - - - - - - - - -
Boost C++ LibrariesHomeLibrariesPeopleFAQMore
-
-
-PrevUpHomeNext -
-
-
-
-

Function template parse_command_line

-

boost::program_options::parse_command_line

-
-

Synopsis

-
// In header: <boost/program_options/parsers.hpp>
-
-
-template<typename charT> 
-  basic_parsed_options< charT > 
-  parse_command_line(int argc, const charT *const argv, 
-                     const options_description &, int style = 0, 
-                     function1< std::pair< std::string, std::string >, const std::string & > ext = ext_parser());
-
-

Description

-

Creates instance of 'command_line_parser', passes parameters to it, and returns the result of calling the 'run' method.

-
-
- - - -
-
-
-PrevUpHomeNext -
- - diff --git a/libs/program_options/doc/html/boost/program_options/parse_config_fi_idp5606176.html b/libs/program_options/doc/html/boost/program_options/parse_config_fi_idp5606176.html deleted file mode 100644 index 6448444957..0000000000 --- a/libs/program_options/doc/html/boost/program_options/parse_config_fi_idp5606176.html +++ /dev/null @@ -1,58 +0,0 @@ - - - -Function template parse_config_file - - - - - - - - - - - - - - - -
Boost C++ LibrariesHomeLibrariesPeopleFAQMore
-
-
-PrevUpHomeNext -
-
-
-
-

Function template parse_config_file

-

boost::program_options::parse_config_file

-
-

Synopsis

-
// In header: <boost/program_options/parsers.hpp>
-
-
-template<typename charT> 
-  BOOST_PROGRAM_OPTIONS_DECL basic_parsed_options< charT > 
-  parse_config_file(const char * filename, const options_description &, 
-                    bool allow_unregistered = false);
-
-

Description

-

Parse a config file.

-

Read from file with the given name. The character type is passed to the file stream.

-
-
- - - -
-
-
-PrevUpHomeNext -
- - diff --git a/libs/program_options/doc/html/boost/program_options/parse_config_fi_idp8590400.html b/libs/program_options/doc/html/boost/program_options/parse_config_fi_idp8590400.html deleted file mode 100644 index 8869c62e26..0000000000 --- a/libs/program_options/doc/html/boost/program_options/parse_config_fi_idp8590400.html +++ /dev/null @@ -1,59 +0,0 @@ - - - -Function template parse_config_file - - - - - - - - - - - - - - - -
Boost C++ LibrariesHomeLibrariesPeopleFAQMore
-
-
-PrevUpHomeNext -
-
-
-
-

Function template parse_config_file

-

boost::program_options::parse_config_file

-
-

Synopsis

-
// In header: <boost/program_options/parsers.hpp>
-
-
-template<typename charT> 
-  BOOST_PROGRAM_OPTIONS_DECL basic_parsed_options< charT > 
-  parse_config_file(std::basic_istream< charT > &, 
-                    const options_description &, 
-                    bool allow_unregistered = false);
-
-

Description

-

Parse a config file.

-

Read from given stream.

-
-
- - - -
-
-
-PrevUpHomeNext -
- - diff --git a/libs/program_options/doc/html/boost/program_options/parse_environme_idp6765216.html b/libs/program_options/doc/html/boost/program_options/parse_environme_idp6765216.html deleted file mode 100644 index 81de0fdb54..0000000000 --- a/libs/program_options/doc/html/boost/program_options/parse_environme_idp6765216.html +++ /dev/null @@ -1,55 +0,0 @@ - - - -Function parse_environment - - - - - - - - - - - - - - - -
Boost C++ LibrariesHomeLibrariesPeopleFAQMore
-
-
-PrevUpHomeNext -
-
-
-
-

Function parse_environment

-

boost::program_options::parse_environment

-
-

Synopsis

-
// In header: <boost/program_options/parsers.hpp>
-
-
-BOOST_PROGRAM_OPTIONS_DECL parsed_options 
-parse_environment(const options_description &, const char * prefix);
-
-

Description

-

This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts. This function exists to resolve ambiguity between the two above functions when second argument is of 'char*' type. There's implicit conversion to both function1 and string.

-
-
- - - -
-
-
-PrevUpHomeNext -
- - diff --git a/libs/program_options/doc/html/boost/program_options/parse_environme_idp6997248.html b/libs/program_options/doc/html/boost/program_options/parse_environme_idp6997248.html deleted file mode 100644 index 54a4574405..0000000000 --- a/libs/program_options/doc/html/boost/program_options/parse_environme_idp6997248.html +++ /dev/null @@ -1,58 +0,0 @@ - - - -Function parse_environment - - - - - - - - - - - - - - - -
Boost C++ LibrariesHomeLibrariesPeopleFAQMore
-
-
-PrevUpHomeNext -
-
-
-
-

Function parse_environment

-

boost::program_options::parse_environment

-
-

Synopsis

-
// In header: <boost/program_options/parsers.hpp>
-
-
-BOOST_PROGRAM_OPTIONS_DECL parsed_options 
-parse_environment(const options_description &, 
-                  const function1< std::string, std::string > & name_mapper);
-
-

Description

-

Parse environment.

-

For each environment variable, the 'name_mapper' function is called to obtain the option name. If it returns empty string, the variable is ignored.

-

This is done since naming of environment variables is typically different from the naming of command line options.

-
-
- - - -
-
-
-PrevUpHomeNext -
- - diff --git a/libs/program_options/doc/html/boost/program_options/parse_environme_idp7001408.html b/libs/program_options/doc/html/boost/program_options/parse_environme_idp7001408.html deleted file mode 100644 index e3a2f2cd6c..0000000000 --- a/libs/program_options/doc/html/boost/program_options/parse_environme_idp7001408.html +++ /dev/null @@ -1,56 +0,0 @@ - - - -Function parse_environment - - - - - - - - - - - - - - - -
Boost C++ LibrariesHomeLibrariesPeopleFAQMore
-
-
-PrevUpHomeNext -
-
-
-
-

Function parse_environment

-

boost::program_options::parse_environment

-
-

Synopsis

-
// In header: <boost/program_options/parsers.hpp>
-
-
-BOOST_PROGRAM_OPTIONS_DECL parsed_options 
-parse_environment(const options_description &, const std::string & prefix);
-
-

Description

-

Parse environment.

-

Takes all environment variables which start with 'prefix'. The option name is obtained from variable name by removing the prefix and converting the remaining string into lower case.

-
-
- - - -
-
-
-PrevUpHomeNext -
- - diff --git a/libs/program_options/doc/html/boost/program_options/positional_opti_idp5922480.html b/libs/program_options/doc/html/boost/program_options/positional_opti_idp5922480.html deleted file mode 100644 index a420474ef3..0000000000 --- a/libs/program_options/doc/html/boost/program_options/positional_opti_idp5922480.html +++ /dev/null @@ -1,91 +0,0 @@ - - - -Class positional_options_description - - - - - - - - - - - - - - - -
Boost C++ LibrariesHomeLibrariesPeopleFAQMore
-
-
-PrevUpHomeNext -
-
-
-
-

Class positional_options_description

-

boost::program_options::positional_options_description

-
-

Synopsis

-
// In header: <boost/program_options/positional_options.hpp>
-
-
-class positional_options_description {
-public:
-  // construct/copy/destruct
-  positional_options_description();
-
-  // public member functions
-  positional_options_description & add(const char *, int);
-  unsigned max_total_count() const;
-  const std::string & name_for_position(unsigned) const;
-};
-
-

Description

-

Describes positional options.

-

The class allows to guess option names for positional options, which are specified on the command line and are identified by the position. The class uses the information provided by the user to associate a name with every positional option, or tell that no name is known.

-

The primary assumption is that only the relative order of the positional options themselves matters, and that any interleaving ordinary options don't affect interpretation of positional options.

-

The user initializes the class by specifying that first N positional options should be given the name X1, following M options should be given the name X2 and so on.

-
-

-positional_options_description - public - construct/copy/destruct

-
  1. positional_options_description();
-
-
-

-positional_options_description public member functions

-
    -
  1. -
    positional_options_description & add(const char * name, int max_count);
    -

    Species that up to 'max_count' next positional options should be given the 'name'. The value of '-1' means 'unlimited'. No calls to 'add' can be made after call with 'max_value' equal to '-1'.

    -
  2. -
  3. -
    unsigned max_total_count() const;
    -

    Returns the maximum number of positional options that can be present. Can return (numeric_limits<unsigned>::max)() to indicate unlimited number.

    -
  4. -
  5. -
    const std::string & name_for_position(unsigned position) const;
    -

    Returns the name that should be associated with positional options at 'position'. Precondition: position < max_total_count()

    -
  6. -
-
-
-
- - - -
-
-
-PrevUpHomeNext -
- - diff --git a/libs/program_options/doc/html/boost/program_options/reading_file.html b/libs/program_options/doc/html/boost/program_options/reading_file.html deleted file mode 100644 index fbaa04911d..0000000000 --- a/libs/program_options/doc/html/boost/program_options/reading_file.html +++ /dev/null @@ -1,65 +0,0 @@ - - - -Class reading_file - - - - - - - - - - - - - - - -
Boost C++ LibrariesHomeLibrariesPeopleFAQMore
-
-
-PrevUpHomeNext -
-
-
-
-

Class reading_file

-

boost::program_options::reading_file

-
-

Synopsis

-
// In header: <boost/program_options/errors.hpp>
-
-
-class reading_file : public boost::program_options::error {
-public:
-  // construct/copy/destruct
-  reading_file(const char *);
-};
-
-

Description

-

Class thrown if config file can not be read

-
-

-reading_file - public - construct/copy/destruct

-
  1. reading_file(const char * filename);
-
-
-
- - - -
-
-
-PrevUpHomeNext -
- - diff --git a/libs/program_options/doc/html/boost/program_options/required_option.html b/libs/program_options/doc/html/boost/program_options/required_option.html deleted file mode 100644 index 9c23f84e48..0000000000 --- a/libs/program_options/doc/html/boost/program_options/required_option.html +++ /dev/null @@ -1,69 +0,0 @@ - - - -Class required_option - - - - - - - - - - - - - - - -
Boost C++ LibrariesHomeLibrariesPeopleFAQMore
-
-
-PrevUpHomeNext -
-
-
-
-

Class required_option

-

boost::program_options::required_option

-
-

Synopsis

-
// In header: <boost/program_options/errors.hpp>
-
-
-class required_option : public boost::program_options::error_with_option_name {
-public:
-  // construct/copy/destruct
-  required_option(const std::string &);
-  ~required_option();
-};
-
-

Description

-

Class thrown when a required/mandatory option is missing

-
-

-required_option - public - construct/copy/destruct

-
    -
  1. required_option(const std::string & option_name);
  2. -
  3. ~required_option();
  4. -
-
-
-
- - - -
-
-
-PrevUpHomeNext -
- - diff --git a/libs/program_options/doc/html/boost/program_options/split_unix.html b/libs/program_options/doc/html/boost/program_options/split_unix.html deleted file mode 100644 index 234df890fc..0000000000 --- a/libs/program_options/doc/html/boost/program_options/split_unix.html +++ /dev/null @@ -1,62 +0,0 @@ - - - -Function split_unix - - - - - - - - - - - - - - - -
Boost C++ LibrariesHomeLibrariesPeopleFAQMore
-
-
-PrevUpHomeNext -
-
-
-
-

Function split_unix

-

boost::program_options::split_unix

-
-

Synopsis

-
// In header: <boost/program_options/parsers.hpp>
-
-
-BOOST_PROGRAM_OPTIONS_DECL std::vector< std::string > 
-split_unix(const std::string & cmdline, const std::string & seperator = " \t", 
-           const std::string & quote = "'\"", 
-           const std::string & escape = "\\");
-BOOST_PROGRAM_OPTIONS_DECL std::vector< std::wstring > 
-split_unix(const std::wstring & cmdline, 
-           const std::wstring & seperator = L" \t", 
-           const std::wstring & quote = L"'\"", 
-           const std::wstring & escape = L"\\");
-
-

Description

-

Splits a given string to a collection of single strings which can be passed to command_line_parser. The second parameter is used to specify a collection of possible seperator chars used for splitting. The seperator is defaulted to space " ". Splitting is done in a unix style way, with respect to quotes '"' and escape characters '\'

-
-
- - - -
-
-
-PrevUpHomeNext -
- - diff --git a/libs/program_options/doc/html/boost/program_options/store_idp6705280.html b/libs/program_options/doc/html/boost/program_options/store_idp6705280.html deleted file mode 100644 index 22fd647450..0000000000 --- a/libs/program_options/doc/html/boost/program_options/store_idp6705280.html +++ /dev/null @@ -1,56 +0,0 @@ - - - -Function store - - - - - - - - - - - - - - - -
Boost C++ LibrariesHomeLibrariesPeopleFAQMore
-
-
-PrevUpHomeNext -
-
-
-
-

Function store

-

boost::program_options::store

-
-

Synopsis

-
// In header: <boost/program_options/variables_map.hpp>
-
-
-BOOST_PROGRAM_OPTIONS_DECL void 
-store(const basic_parsed_options< char > & options, variables_map & m, 
-      bool utf8 = false);
-
-

Description

-

Stores in 'm' all options that are defined in 'options'. If 'm' already has a non-defaulted value of an option, that value is not changed, even if 'options' specify some value.

-
-
- - - -
-
-
-PrevUpHomeNext -
- - diff --git a/libs/program_options/doc/html/boost/program_options/store_idp6709808.html b/libs/program_options/doc/html/boost/program_options/store_idp6709808.html deleted file mode 100644 index 7e96c79685..0000000000 --- a/libs/program_options/doc/html/boost/program_options/store_idp6709808.html +++ /dev/null @@ -1,55 +0,0 @@ - - - -Function store - - - - - - - - - - - - - - - -
Boost C++ LibrariesHomeLibrariesPeopleFAQMore
-
-
-PrevUpHomeNext -
-
-
-
-

Function store

-

boost::program_options::store

-
-

Synopsis

-
// In header: <boost/program_options/variables_map.hpp>
-
-
-BOOST_PROGRAM_OPTIONS_DECL void 
-store(const basic_parsed_options< wchar_t > & options, variables_map & m);
-
-

Description

-

Stores in 'm' all options that are defined in 'options'. If 'm' already has a non-defaulted value of an option, that value is not changed, even if 'options' specify some value. This is wide character variant.

-
-
- - - -
-
-
-PrevUpHomeNext -
- - diff --git a/libs/program_options/doc/html/boost/program_options/too_many_positi_idp7389984.html b/libs/program_options/doc/html/boost/program_options/too_many_positi_idp7389984.html deleted file mode 100644 index 13b4daf163..0000000000 --- a/libs/program_options/doc/html/boost/program_options/too_many_positi_idp7389984.html +++ /dev/null @@ -1,67 +0,0 @@ - - - -Class too_many_positional_options_error - - - - - - - - - - - - - - - -
Boost C++ LibrariesHomeLibrariesPeopleFAQMore
-
-
-PrevUpHomeNext -
-
-
-
-

Class too_many_positional_options_error

-

boost::program_options::too_many_positional_options_error

-
-

Synopsis

-
// In header: <boost/program_options/errors.hpp>
-
-
-class too_many_positional_options_error :
-  public boost::program_options::error
-{
-public:
-  // construct/copy/destruct
-  too_many_positional_options_error();
-};
-
-

Description

-

Class thrown when there are too many positional options. This is a programming error.

-
-

-too_many_positional_options_error - public - construct/copy/destruct

-
  1. too_many_positional_options_error();
-
-
-
- - - -
-
-
-PrevUpHomeNext -
- - diff --git a/libs/program_options/doc/html/boost/program_options/typed_value.html b/libs/program_options/doc/html/boost/program_options/typed_value.html deleted file mode 100644 index 419b035dfe..0000000000 --- a/libs/program_options/doc/html/boost/program_options/typed_value.html +++ /dev/null @@ -1,158 +0,0 @@ - - - -Class template typed_value - - - - - - - - - - - - - - - -
Boost C++ LibrariesHomeLibrariesPeopleFAQMore
-
-
-PrevUpHomeNext -
-
-
-
-

Class template typed_value

-

boost::program_options::typed_value

-
-

Synopsis

-
// In header: <boost/program_options/value_semantic.hpp>
-
-template<typename T, typename charT = char> 
-class typed_value : public boost::program_options::value_semantic_codecvt_helper< charT >,
-                    public boost::program_options::typed_value_base
-{
-public:
-  // construct/copy/destruct
-  typed_value(T *);
-
-  // public member functions
-  typed_value * default_value(const T &);
-  typed_value * default_value(const T &, const std::string &);
-  typed_value * implicit_value(const T &);
-  typed_value * value_name(const std::string &);
-  typed_value * implicit_value(const T &, const std::string &);
-  typed_value * notifier(function1< void, const T & >);
-  typed_value * composing();
-  typed_value * multitoken();
-  typed_value * zero_tokens();
-  typed_value * required();
-  std::string name() const;
-  bool is_composing() const;
-  unsigned min_tokens() const;
-  unsigned max_tokens() const;
-  bool adjacent_tokens_only() const;
-  bool is_required() const;
-  void xparse(boost::any &, const std::vector< std::basic_string< charT > > &) const;
-  virtual bool apply_default(boost::any &) const;
-  void notify(const boost::any &) const;
-  virtual const std::type_info & value_type() const;
-};
-
-

Description

-

Class which handles value of a specific type.

-
-

-typed_value - public - construct/copy/destruct

-
  1. -
    typed_value(T * store_to);
    -

    Ctor. The 'store_to' parameter tells where to store the value when it's known. The parameter can be NULL.

    -
-
-
-

-typed_value public member functions

-
    -
  1. -
    typed_value * default_value(const T & v);
    -

    Specifies default value, which will be used if none is explicitly specified. The type 'T' should provide operator<< for ostream.

    -
  2. -
  3. -
    typed_value * default_value(const T & v, const std::string & textual);
    -

    Specifies default value, which will be used if none is explicitly specified. Unlike the above overload, the type 'T' need not provide operator<< for ostream, but textual representation of default value must be provided by the user.

    -
  4. -
  5. -
    typed_value * implicit_value(const T & v);
    -

    Specifies an implicit value, which will be used if the option is given, but without an adjacent value. Using this implies that an explicit value is optional, but if given, must be strictly adjacent to the option, i.e.: '-ovalue' or '--option=value'. Giving '-o' or '--option' will cause the implicit value to be applied.

    -
  6. -
  7. -
    typed_value * value_name(const std::string & name);
    -

    Specifies the name used to to the value in help message.

    -
  8. -
  9. -
    typed_value * implicit_value(const T & v, const std::string & textual);
    -

    Specifies an implicit value, which will be used if the option is given, but without an adjacent value. Using this implies that an explicit value is optional, but if given, must be strictly adjacent to the option, i.e.: '-ovalue' or '--option=value'. Giving '-o' or '--option' will cause the implicit value to be applied. Unlike the above overload, the type 'T' need not provide operator<< for ostream, but textual representation of default value must be provided by the user.

    -
  10. -
  11. -
    typed_value * notifier(function1< void, const T & > f);
    -

    Specifies a function to be called when the final value is determined.

    -
  12. -
  13. -
    typed_value * composing();
    -

    Specifies that the value is composing. See the 'is_composing' method for explanation.

    -
  14. -
  15. -
    typed_value * multitoken();
    -

    Specifies that the value can span multiple tokens.

    -
  16. -
  17. -
    typed_value * zero_tokens();
    -

    Specifies that no tokens may be provided as the value of this option, which means that only presense of the option is significant. For such option to be useful, either the 'validate' function should be specialized, or the 'implicit_value' method should be also used. In most cases, you can use the 'bool_switch' function instead of using this method.

    -
  18. -
  19. -
    typed_value * required();
    -

    Specifies that the value must occur.

    -
  20. -
  21. std::string name() const;
  22. -
  23. bool is_composing() const;
  24. -
  25. unsigned min_tokens() const;
  26. -
  27. unsigned max_tokens() const;
  28. -
  29. bool adjacent_tokens_only() const;
  30. -
  31. bool is_required() const;
  32. -
  33. -
    void xparse(boost::any & value_store, 
    -            const std::vector< std::basic_string< charT > > & new_tokens) const;
    -

    Creates an instance of the 'validator' class and calls its operator() to perform the actual conversion.

    -
  34. -
  35. -
    virtual bool apply_default(boost::any & value_store) const;
    -

    If default value was specified via previous call to 'default_value', stores that value into 'value_store'. Returns true if default value was stored.

    -
  36. -
  37. -
    void notify(const boost::any & value_store) const;
    -

    If an address of variable to store value was specified when creating *this, stores the value there. Otherwise, does nothing.

    -
  38. -
  39. virtual const std::type_info & value_type() const;
  40. -
-
-
-
- - - -
-
-
-PrevUpHomeNext -
- - diff --git a/libs/program_options/doc/html/boost/program_options/typed_value_base.html b/libs/program_options/doc/html/boost/program_options/typed_value_base.html deleted file mode 100644 index a65b894d96..0000000000 --- a/libs/program_options/doc/html/boost/program_options/typed_value_base.html +++ /dev/null @@ -1,73 +0,0 @@ - - - -Class typed_value_base - - - - - - - - - - - - - - - -
Boost C++ LibrariesHomeLibrariesPeopleFAQMore
-
-
-PrevUpHomeNext -
-
-
-
-

Class typed_value_base

-

boost::program_options::typed_value_base

-
-

Synopsis

-
// In header: <boost/program_options/value_semantic.hpp>
-
-
-class typed_value_base {
-public:
-  // construct/copy/destruct
-  ~typed_value_base();
-
-  // public member functions
-  virtual const std::type_info & value_type() const = 0;
-};
-
-

Description

-

Base class for all option that have a fixed type, and are willing to announce this type to the outside world. Any 'value_semantics' for which you want to find out the type can be dynamic_cast-ed to typed_value_base. If conversion succeeds, the 'type' method can be called.

-
-

-typed_value_base - public - construct/copy/destruct

-
  1. ~typed_value_base();
-
-
-

-typed_value_base public member functions

-
  1. virtual const std::type_info & value_type() const = 0;
-
-
-
- - - -
-
-
-PrevUpHomeNext -
- - diff --git a/libs/program_options/doc/html/boost/program_options/unknown_option.html b/libs/program_options/doc/html/boost/program_options/unknown_option.html deleted file mode 100644 index a94a706560..0000000000 --- a/libs/program_options/doc/html/boost/program_options/unknown_option.html +++ /dev/null @@ -1,71 +0,0 @@ - - - -Class unknown_option - - - - - - - - - - - - - - - -
Boost C++ LibrariesHomeLibrariesPeopleFAQMore
-
-
-PrevUpHomeNext -
-
-
-
-

Class unknown_option

-

boost::program_options::unknown_option

-
-

Synopsis

-
// In header: <boost/program_options/errors.hpp>
-
-
-class unknown_option :
-  public boost::program_options::error_with_no_option_name
-{
-public:
-  // construct/copy/destruct
-  unknown_option(const std::string & = "");
-  ~unknown_option();
-};
-
-

Description

-

Class thrown when option name is not recognized.

-
-

-unknown_option - public - construct/copy/destruct

-
    -
  1. unknown_option(const std::string & original_token = "");
  2. -
  3. ~unknown_option();
  4. -
-
-
-
- - - -
-
-
-PrevUpHomeNext -
- - diff --git a/libs/program_options/doc/html/boost/program_options/untyped_value.html b/libs/program_options/doc/html/boost/program_options/untyped_value.html deleted file mode 100644 index bdf7408f66..0000000000 --- a/libs/program_options/doc/html/boost/program_options/untyped_value.html +++ /dev/null @@ -1,122 +0,0 @@ - - - -Class untyped_value - - - - - - - - - - - - - - - -
Boost C++ LibrariesHomeLibrariesPeopleFAQMore
-
-
-PrevUpHomeNext -
-
-
-
-

Class untyped_value

-

boost::program_options::untyped_value

-
-

Synopsis

-
// In header: <boost/program_options/value_semantic.hpp>
-
-
-class untyped_value :
-  public boost::program_options::value_semantic_codecvt_helper< char >
-{
-public:
-  // construct/copy/destruct
-  untyped_value(bool = false);
-
-  // public member functions
-  virtual std::string name() const;
-  virtual unsigned min_tokens() const;
-  virtual unsigned max_tokens() const;
-  virtual bool adjacent_tokens_only() const;
-  virtual bool is_composing() const;
-  virtual bool is_required() const;
-  virtual void xparse(boost::any &, const std::vector< std::string > &) const;
-  virtual bool apply_default(boost::any &) const;
-  virtual void notify(const boost::any &) const;
-};
-
-

Description

-

Class which specifies a simple handling of a value: the value will have string type and only one token is allowed.

-
-

-untyped_value - public - construct/copy/destruct

-
  1. untyped_value(bool zero_tokens = false);
-
-
-

-untyped_value public member functions

-
    -
  1. -
    virtual std::string name() const;
    -

    Returns the name of the option. The name is only meaningful for automatic help message.

    -
  2. -
  3. -
    virtual unsigned min_tokens() const;
    -

    The minimum number of tokens for this option that should be present on the command line.

    -
  4. -
  5. -
    virtual unsigned max_tokens() const;
    -

    The maximum number of tokens for this option that should be present on the command line.

    -
  6. -
  7. -
    virtual bool adjacent_tokens_only() const;
    -

    Returns true if the option should only take adjacent token, not one from further command-line arguments.

    -
  8. -
  9. -
    virtual bool is_composing() const;
    -

    Returns true if values from different sources should be composed. Otherwise, value from the first source is used and values from other sources are discarded.

    -
  10. -
  11. -
    virtual bool is_required() const;
    -

    Returns true if value must be given. Non-optional value

    -
  12. -
  13. -
    virtual void 
    -xparse(boost::any & value_store, 
    -       const std::vector< std::string > & new_tokens) const;
    -

    If 'value_store' is already initialized, or new_tokens has more than one elements, throws. Otherwise, assigns the first string from 'new_tokens' to 'value_store', without any modifications.

    -
  14. -
  15. -
    virtual bool apply_default(boost::any &) const;
    -

    Does nothing.

    -
  16. -
  17. -
    virtual void notify(const boost::any &) const;
    -

    Does nothing.

    -
  18. -
-
-
-
- - - -
-
-
-PrevUpHomeNext -
- - diff --git a/libs/program_options/doc/html/boost/program_options/validation_error.html b/libs/program_options/doc/html/boost/program_options/validation_error.html deleted file mode 100644 index 337ac8d84f..0000000000 --- a/libs/program_options/doc/html/boost/program_options/validation_error.html +++ /dev/null @@ -1,89 +0,0 @@ - - - -Class validation_error - - - - - - - - - - - - - - - -
Boost C++ LibrariesHomeLibrariesPeopleFAQMore
-
-
-PrevUpHomeNext -
-
-
-
-

Class validation_error

-

boost::program_options::validation_error

-
-

Synopsis

-
// In header: <boost/program_options/errors.hpp>
-
-
-class validation_error :
-  public boost::program_options::error_with_option_name
-{
-public:
-
-  enum kind_t { multiple_values_not_allowed =  30, 
-                at_least_one_value_required, invalid_bool_value, 
-                invalid_option_value, invalid_option };
-  // construct/copy/destruct
-  validation_error(kind_t, const std::string & = "", const std::string & = "", 
-                   int = 0);
-  ~validation_error();
-
-  // protected member functions
-  std::string get_template(kind_t);
-};
-
-

Description

-

Class thrown when value of option is incorrect.

-
-

-validation_error - public - construct/copy/destruct

-
    -
  1. validation_error(kind_t kind, const std::string & option_name = "", 
    -                 const std::string & original_token = "", 
    -                 int option_style = 0);
  2. -
  3. ~validation_error();
  4. -
-
-
-

-validation_error protected member functions

-
  1. -
    std::string get_template(kind_t kind);
    -

    Used to convert kind_t to a related error text

    -
-
-
-
- - - -
-
-
-PrevUpHomeNext -
- - diff --git a/libs/program_options/doc/html/boost/program_options/value.html b/libs/program_options/doc/html/boost/program_options/value.html deleted file mode 100644 index a8c0517895..0000000000 --- a/libs/program_options/doc/html/boost/program_options/value.html +++ /dev/null @@ -1,55 +0,0 @@ - - - -Function value - - - - - - - - - - - - - - - -
Boost C++ LibrariesHomeLibrariesPeopleFAQMore
-
-
-PrevUpHomeNext -
-
-
-
-

Function value

-

boost::program_options::value

-
-

Synopsis

-
// In header: <boost/program_options/value_semantic.hpp>
-
-
-template<typename T> typed_value< T > * value();
-template<typename T> typed_value< T > * value(T * v);
-
-

Description

-

Creates a typed_value<T> instance. This function is the primary method to create value_semantic instance for a specific type, which can later be passed to 'option_description' constructor. The second overload is used when it's additionally desired to store the value of option into program variable.

-
-
- - - -
-
-
-PrevUpHomeNext -
- - diff --git a/libs/program_options/doc/html/boost/program_options/value_semantic.html b/libs/program_options/doc/html/boost/program_options/value_semantic.html deleted file mode 100644 index d6153d9fe8..0000000000 --- a/libs/program_options/doc/html/boost/program_options/value_semantic.html +++ /dev/null @@ -1,121 +0,0 @@ - - - -Class value_semantic - - - - - - - - - - - - - - - -
Boost C++ LibrariesHomeLibrariesPeopleFAQMore
-
-
-PrevUpHomeNext -
-
-
-
-

Class value_semantic

-

boost::program_options::value_semantic

-
-

Synopsis

-
// In header: <boost/program_options/value_semantic.hpp>
-
-
-class value_semantic {
-public:
-  // construct/copy/destruct
-  ~value_semantic();
-
-  // public member functions
-  virtual std::string name() const = 0;
-  virtual unsigned min_tokens() const = 0;
-  virtual unsigned max_tokens() const = 0;
-  virtual bool adjacent_tokens_only() const = 0;
-  virtual bool is_composing() const = 0;
-  virtual bool is_required() const = 0;
-  virtual void 
-  parse(boost::any &, const std::vector< std::string > &, bool) const = 0;
-  virtual bool apply_default(boost::any &) const = 0;
-  virtual void notify(const boost::any &) const = 0;
-};
-
-

Description

-

Class which specifies how the option's value is to be parsed and converted into C++ types.

-
-

-value_semantic - public - construct/copy/destruct

-
  1. ~value_semantic();
-
-
-

-value_semantic public member functions

-
    -
  1. -
    virtual std::string name() const = 0;
    -

    Returns the name of the option. The name is only meaningful for automatic help message.

    -
  2. -
  3. -
    virtual unsigned min_tokens() const = 0;
    -

    The minimum number of tokens for this option that should be present on the command line.

    -
  4. -
  5. -
    virtual unsigned max_tokens() const = 0;
    -

    The maximum number of tokens for this option that should be present on the command line.

    -
  6. -
  7. -
    virtual bool adjacent_tokens_only() const = 0;
    -

    Returns true if the option should only take adjacent token, not one from further command-line arguments.

    -
  8. -
  9. -
    virtual bool is_composing() const = 0;
    -

    Returns true if values from different sources should be composed. Otherwise, value from the first source is used and values from other sources are discarded.

    -
  10. -
  11. -
    virtual bool is_required() const = 0;
    -

    Returns true if value must be given. Non-optional value

    -
  12. -
  13. -
    virtual void 
    -parse(boost::any & value_store, const std::vector< std::string > & new_tokens, 
    -      bool utf8) const = 0;
    -

    Parses a group of tokens that specify a value of option. Stores the result in 'value_store', using whatever representation is desired. May be be called several times if value of the same option is specified more than once.

    -
  14. -
  15. -
    virtual bool apply_default(boost::any & value_store) const = 0;
    -

    Called to assign default value to 'value_store'. Returns true if default value is assigned, and false if no default value exists.

    -
  16. -
  17. -
    virtual void notify(const boost::any & value_store) const = 0;
    -

    Called when final value of an option is determined.

    -
  18. -
-
-
-
- - - -
-
-
-PrevUpHomeNext -
- - diff --git a/libs/program_options/doc/html/boost/program_options/value_semantic__idp8632624.html b/libs/program_options/doc/html/boost/program_options/value_semantic__idp8632624.html deleted file mode 100644 index c83bf56aa1..0000000000 --- a/libs/program_options/doc/html/boost/program_options/value_semantic__idp8632624.html +++ /dev/null @@ -1,62 +0,0 @@ - - - -Class template value_semantic_codecvt_helper - - - - - - - - - - - - - - - -
Boost C++ LibrariesHomeLibrariesPeopleFAQMore
-
-
-PrevUpHomeNext -
-
-
-
-

Class template value_semantic_codecvt_helper

-

boost::program_options::value_semantic_codecvt_helper

-
-

Synopsis

-
// In header: <boost/program_options/value_semantic.hpp>
-
-template<typename charT> 
-class value_semantic_codecvt_helper {
-};
-
-

Description

-

Helper class which perform necessary character conversions in the 'parse' method and forwards the data further.

- -
-
- - - -
-
-
-PrevUpHomeNext -
- - diff --git a/libs/program_options/doc/html/boost/program_options/value_semantic__idp8634400.html b/libs/program_options/doc/html/boost/program_options/value_semantic__idp8634400.html deleted file mode 100644 index 1fc2db5dc7..0000000000 --- a/libs/program_options/doc/html/boost/program_options/value_semantic__idp8634400.html +++ /dev/null @@ -1,83 +0,0 @@ - - - -Class value_semantic_codecvt_helper<char> - - - - - - - - - - - - - - - -
Boost C++ LibrariesHomeLibrariesPeopleFAQMore
-
-
-PrevUpHomeNext -
-
-
-
-

Class value_semantic_codecvt_helper<char>

-

boost::program_options::value_semantic_codecvt_helper<char>

-
-

Synopsis

-
// In header: <boost/program_options/value_semantic.hpp>
-
-
-class value_semantic_codecvt_helper<char> :
-  public boost::program_options::value_semantic
-{
-public:
-
-  // private member functions
-  virtual void 
-  parse(boost::any &, const std::vector< std::string > &, bool) const;
-
-  // protected member functions
-  virtual void 
-  xparse(boost::any &, const std::vector< std::string > &) const = 0;
-};
-
-

Description

-

Helper conversion class for values that accept ascii strings as input. Overrides the 'parse' method and defines new 'xparse' method taking std::string. Depending on whether input to parse is ascii or UTF8, will pass it to xparse unmodified, or with UTF8->ascii conversion.

-
-

-value_semantic_codecvt_helper private member functions

-
  1. -
    virtual void 
    -parse(boost::any & value_store, const std::vector< std::string > & new_tokens, 
    -      bool utf8) const;
    -

    Parses a group of tokens that specify a value of option. Stores the result in 'value_store', using whatever representation is desired. May be be called several times if value of the same option is specified more than once.

    -
-
-
-

-value_semantic_codecvt_helper protected member functions

-
  1. virtual void 
    -xparse(boost::any & value_store, 
    -       const std::vector< std::string > & new_tokens) const = 0;
-
-
-
- - - -
-
-
-PrevUpHomeNext -
- - diff --git a/libs/program_options/doc/html/boost/program_options/value_semantic__idp9236160.html b/libs/program_options/doc/html/boost/program_options/value_semantic__idp9236160.html deleted file mode 100644 index c658e1ffbd..0000000000 --- a/libs/program_options/doc/html/boost/program_options/value_semantic__idp9236160.html +++ /dev/null @@ -1,83 +0,0 @@ - - - -Class value_semantic_codecvt_helper<wchar_t> - - - - - - - - - - - - - - - -
Boost C++ LibrariesHomeLibrariesPeopleFAQMore
-
-
-PrevUpHomeNext -
-
-
-
-

Class value_semantic_codecvt_helper<wchar_t>

-

boost::program_options::value_semantic_codecvt_helper<wchar_t>

-
-

Synopsis

-
// In header: <boost/program_options/value_semantic.hpp>
-
-
-class value_semantic_codecvt_helper<wchar_t> :
-  public boost::program_options::value_semantic
-{
-public:
-
-  // private member functions
-  virtual void 
-  parse(boost::any &, const std::vector< std::string > &, bool) const;
-
-  // protected member functions
-  virtual void 
-  xparse(boost::any &, const std::vector< std::wstring > &) const = 0;
-};
-
-

Description

-

Helper conversion class for values that accept ascii strings as input. Overrides the 'parse' method and defines new 'xparse' method taking std::wstring. Depending on whether input to parse is ascii or UTF8, will recode input to Unicode, or pass it unmodified.

-
-

-value_semantic_codecvt_helper private member functions

-
  1. -
    virtual void 
    -parse(boost::any & value_store, const std::vector< std::string > & new_tokens, 
    -      bool utf8) const;
    -

    Parses a group of tokens that specify a value of option. Stores the result in 'value_store', using whatever representation is desired. May be be called several times if value of the same option is specified more than once.

    -
-
-
-

-value_semantic_codecvt_helper protected member functions

-
  1. virtual void 
    -xparse(boost::any & value_store, 
    -       const std::vector< std::wstring > & new_tokens) const = 0;
-
-
-
- - - -
-
-
-PrevUpHomeNext -
- - diff --git a/libs/program_options/doc/html/boost/program_options/variable_value.html b/libs/program_options/doc/html/boost/program_options/variable_value.html deleted file mode 100644 index c02749a885..0000000000 --- a/libs/program_options/doc/html/boost/program_options/variable_value.html +++ /dev/null @@ -1,118 +0,0 @@ - - - -Class variable_value - - - - - - - - - - - - - - - -
Boost C++ LibrariesHomeLibrariesPeopleFAQMore
-
-
-PrevUpHomeNext -
-
-
-
-

Class variable_value

-

boost::program_options::variable_value

-
-

Synopsis

-
// In header: <boost/program_options/variables_map.hpp>
-
-
-class variable_value {
-public:
-  // construct/copy/destruct
-  variable_value();
-  variable_value(const boost::any &, bool);
-
-  // friend functions
-  friend BOOST_PROGRAM_OPTIONS_DECL void 
-  store(const basic_parsed_options< char > &, variables_map &, bool);
-
-  // public member functions
-  template<typename T> const T & as() const;
-  template<typename T> T & as();
-  bool empty() const;
-  bool defaulted() const;
-  const boost::any & value() const;
-  boost::any & value();
-};
-
-

Description

-

Class holding value of option. Contains details about how the value is set and allows to conveniently obtain the value.

-
-

-variable_value - public - construct/copy/destruct

-
    -
  1. variable_value();
  2. -
  3. variable_value(const boost::any & xv, bool xdefaulted);
  4. -
-
-
-

-variable_value friend functions

-
  1. -
    friend BOOST_PROGRAM_OPTIONS_DECL void 
    -store(const basic_parsed_options< char > & options, variables_map & m, bool);
    -

    Stores in 'm' all options that are defined in 'options'. If 'm' already has a non-defaulted value of an option, that value is not changed, even if 'options' specify some value.

    -
-
-
-

-variable_value public member functions

-
    -
  1. -
    template<typename T> const T & as() const;
    -

    If stored value if of type T, returns that value. Otherwise, throws boost::bad_any_cast exception.

    -
  2. -
  3. -
    template<typename T> T & as();
    -

    This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.

    -
  4. -
  5. -
    bool empty() const;
    Returns true if no value is stored.
  6. -
  7. -
    bool defaulted() const;
    -

    Returns true if the value was not explicitly given, but has default value.

    -
  8. -
  9. -
    const boost::any & value() const;
    -

    Returns the contained value.

    -
  10. -
  11. -
    boost::any & value();
    -

    Returns the contained value.

    -
  12. -
-
-
-
- - - -
-
-
-PrevUpHomeNext -
- - diff --git a/libs/program_options/doc/html/boost/program_options/variables_map.html b/libs/program_options/doc/html/boost/program_options/variables_map.html deleted file mode 100644 index 352a41d877..0000000000 --- a/libs/program_options/doc/html/boost/program_options/variables_map.html +++ /dev/null @@ -1,137 +0,0 @@ - - - -Class variables_map - - - - - - - - - - - - - - - -
Boost C++ LibrariesHomeLibrariesPeopleFAQMore
-
-
-PrevUpHomeNext -
-
-
-
-

Class variables_map

-

boost::program_options::variables_map

-
-

Synopsis

-
// In header: <boost/program_options/variables_map.hpp>
-
-
-class variables_map : public boost::program_options::abstract_variables_map {
-public:
-  // construct/copy/destruct
-  variables_map();
-  variables_map(const abstract_variables_map *);
-
-  // public member functions
-  const variable_value & operator[](const std::string &) const;
-  void clear();
-  void notify();
-
-  // private member functions
-  virtual const variable_value & get(const std::string &) const;
-
-  // friend functions
-  friend BOOST_PROGRAM_OPTIONS_DECL void 
-  store(const basic_parsed_options< char > &, variables_map &, bool);
-};
-
-

Description

-

Concrete variables map which store variables in real map.

-

This class is derived from std::map<std::string, variable_value>, so you can use all map operators to examine its content.

-
-

-variables_map - public - construct/copy/destruct

-
    -
  1. variables_map();
  2. -
  3. variables_map(const abstract_variables_map * next);
  4. -
-
-
-

-variables_map public member functions

-
    -
  1. -
    const variable_value & operator[](const std::string & name) const;
    -

    Obtains the value of variable 'name', from *this and possibly from the chain of variable maps.

    -
    • -

      if there's no value in *this.

      -
        -
      • if there's next variable map, returns value from it

      • -
      • otherwise, returns empty value

      • -
      -

      -

      -
    -

    -

    -
    • -

      if there's defaulted value

      -
        -
      • if there's next variable map, which has a non-defaulted value, return that

      • -
      • otherwise, return value from *this

      • -
      -

      -

      -
    -

    -

    -
    • if there's a non-defaulted value, returns it.

    -

    -

    -
  2. -
  3. void clear();
  4. -
  5. void notify();
  6. -
-
-
-

-variables_map private member functions

-
  1. -
    virtual const variable_value & get(const std::string & name) const;
    -

    Implementation of abstract_variables_map::get which does 'find' in *this.

    -
-
-
-

-variables_map friend functions

-
  1. -
    friend BOOST_PROGRAM_OPTIONS_DECL void 
    -store(const basic_parsed_options< char > & options, variables_map & xm, 
    -      bool utf8);
    -

    Stores in 'm' all options that are defined in 'options'. If 'm' already has a non-defaulted value of an option, that value is not changed, even if 'options' specify some value.

    -
-
-
-
- - - -
-
-
-PrevUpHomeNext -
- - diff --git a/libs/program_options/doc/html/boost/program_options/wvalue.html b/libs/program_options/doc/html/boost/program_options/wvalue.html deleted file mode 100644 index fdef07600a..0000000000 --- a/libs/program_options/doc/html/boost/program_options/wvalue.html +++ /dev/null @@ -1,55 +0,0 @@ - - - -Function wvalue - - - - - - - - - - - - - - - -
Boost C++ LibrariesHomeLibrariesPeopleFAQMore
-
-
-PrevUpHomeNext -
-
-
-
-

Function wvalue

-

boost::program_options::wvalue

-
-

Synopsis

-
// In header: <boost/program_options/value_semantic.hpp>
-
-
-template<typename T> typed_value< T, wchar_t > * wvalue();
-template<typename T> typed_value< T, wchar_t > * wvalue(T * v);
-
-

Description

-

Creates a typed_value<T> instance. This function is the primary method to create value_semantic instance for a specific type, which can later be passed to 'option_description' constructor.

-
-
- - - -
-
-
-PrevUpHomeNext -
- - diff --git a/libs/program_options/doc/html/index.html b/libs/program_options/doc/html/index.html deleted file mode 100644 index 6dd22c2111..0000000000 --- a/libs/program_options/doc/html/index.html +++ /dev/null @@ -1,123 +0,0 @@ - - - -Chapter 1. Boost.Program_options - - - - - - - - - - - - - -
Boost C++ LibrariesHomeLibrariesPeopleFAQMore
-
-
Next
-
-
-

-Chapter 1. Boost.Program_options

-

-Vladimir Prus -

-
-
-

Distributed under the Boost Software License, Version 1.0. - (See accompanying file LICENSE_1_0.txt or copy at - http://www.boost.org/LICENSE_1_0.txt) -

-
-
- -
-

-Introduction

-

The program_options library allows program developers to obtain - program options, that is (name, value) pairs from the user, - via conventional methods such as command line and config file.

-

Why would you use such a library, and why is it better than parsing - your command line by straightforward hand-written code? -

-
    -
  • It's easier. The syntax for declaring options is simple, and - the library itself is small. Things like conversion of option values to - desired type and storing into program variables are handled - automatically. -

  • -
  • Error reporting is better. All the problems with the command line are - reported, while hand-written code can just misparse the input. In - addition, the usage message can be automatically generated, to - avoid falling out of sync with the real list of options.

  • -
  • Options can be read from anywhere. Sooner or later the command - line will be not enough for your users, and you'll want config files - or maybe even environment variables. These can be added without significant - effort on your part. -

  • -
-

-

-

- Now let's see some examples of the library usage in the the section called “Tutorial”. -

-
-
- - - -
-
-
Next
- - diff --git a/libs/program_options/doc/html/index/s06.html b/libs/program_options/doc/html/index/s06.html deleted file mode 100644 index 6f89496ad2..0000000000 --- a/libs/program_options/doc/html/index/s06.html +++ /dev/null @@ -1,96 +0,0 @@ - - - -Acknowledgements - - - - - - - - - - - - - - - -
Boost C++ LibrariesHomeLibrariesPeopleFAQMore
-
-
-PrevUpHomeNext -
-
-

-Acknowledgements

-

I'm very gratefull to all the people who helped with the development, - by discussion, fixes, and as users. It was pleasant - to see all that involvement, which made the library much better than it - would be otherwise. -

-

In the early stages, the library was affected by discussions with - Gennadiy Rozental, William Kempf and Alexander Okhotin. -

-

Hartmut Kaiser was the first person to try the library on his project - and send a number of suggestions and fixes. -

-

The formal review lead to numerous comments and enhancements. Pavol - Droba helped with the option description semantic. Gennadiy Rozental has - criticised many aspects of the library which caused various simplifications. - Pavel Vozenilek did carefull review of the implementation. A number of - comments were made by: -

-
    -
  • David Abrahams

  • -
  • Neal D. Becker

  • -
  • Misha Bergal

  • -
  • James Curran

  • -
  • Carl Daniel

  • -
  • Beman Dawes

  • -
  • Tanton Gibbs

  • -
  • Holger Grund

  • -
  • Hartmut Kaiser

  • -
  • Petr Kocmid

  • -
  • Baptiste Lepilleur

  • -
  • Marcelo E. Magallon

  • -
  • Chuck Messenger

  • -
  • John Torjo

  • -
  • Matthias Troyer

  • -
-

-

-

Doug Gregor and Reece Dunn helped to resolve the issues with Boostbook - version of the documentation. -

-

Even after review, a number of people have helped with further development: -

-
    -
  • Rob Lievaart

  • -
  • Thorsten Ottosen

  • -
  • Joseph Wu

  • -
  • Ferdinand Prantl

  • -
  • Miro Jurisic

  • -
  • John Maddock

  • -
  • Janusz Piwowarski

  • -
  • Charles Brockman

  • -
  • Jonathan Wakely

  • -
-

-

-
- - - -
-
-
-PrevUpHomeNext -
- - diff --git a/libs/program_options/doc/html/program_option_HTML.manifest b/libs/program_options/doc/html/program_option_HTML.manifest deleted file mode 100644 index 87baa85a5b..0000000000 --- a/libs/program_options/doc/html/program_option_HTML.manifest +++ /dev/null @@ -1,64 +0,0 @@ -index.html -program_options/tutorial.html -program_options/overview.html -program_options/howto.html -program_options/design.html -index/s06.html -program_options/reference.html -boost/program_options/command_line_style/style_t.html -BOOST_PROGRAM_OPTIONS_DECL.html -boost/environment_iterator.html -boost/eof_iterator.html -boost/program_options/error.html -boost/program_options/too_many_positi_idp7389984.html -boost/program_options/invalid_command_line_style.html -boost/program_options/reading_file.html -boost/program_options/error_with_option_name.html -boost/program_options/multiple_values.html -boost/program_options/multiple_occurrences.html -boost/program_options/required_option.html -boost/program_options/error_with_no_option_name.html -boost/program_options/unknown_option.html -boost/program_options/ambiguous_option.html -boost/program_options/invalid_syntax.html -boost/program_options/invalid_config_file_syntax.html -boost/program_options/invalid_command_idp6969504.html -boost/program_options/validation_error.html -boost/program_options/invalid_option_value.html -boost/program_options/invalid_bool_value.html -boost/program_options/basic_option.html -boost/program_options/option_description.html -boost/program_options/options_descrip_idp8075600.html -boost/program_options/options_description.html -boost/program_options/duplicate_option_error.html -boost/program_options/basic_parsed_options.html -boost/program_options/basic_parsed_op_idp8181920.html -boost/program_options/basic_command_line_parser.html -boost/program_options/collect_unrecognized_mode.html -boost/program_options/ext_parser.html -boost/program_options/parse_command_line.html -boost/program_options/parse_config_fi_idp8590400.html -boost/program_options/parse_config_fi_idp5606176.html -boost/program_options/collect_unrecognized.html -boost/program_options/parse_environme_idp6997248.html -boost/program_options/parse_environme_idp7001408.html -boost/program_options/parse_environme_idp6765216.html -boost/program_options/split_unix.html -boost/program_options/positional_opti_idp5922480.html -boost/program_options/value_semantic.html -boost/program_options/value_semantic__idp8632624.html -boost/program_options/value_semantic__idp8634400.html -boost/program_options/value_semantic__idp9236160.html -boost/program_options/untyped_value.html -boost/program_options/typed_value_base.html -boost/program_options/typed_value.html -boost/program_options/value.html -boost/program_options/wvalue.html -boost/program_options/bool_switch.html -boost/program_options/variable_value.html -boost/program_options/abstract_variables_map.html -boost/program_options/variables_map.html -boost/program_options/store_idp6705280.html -boost/program_options/store_idp6709808.html -boost/program_options/notify.html -BOOST_PROGRAM_OPTIONS_VERSION.html diff --git a/libs/program_options/doc/html/program_options/design.html b/libs/program_options/doc/html/program_options/design.html deleted file mode 100644 index 9591f0c721..0000000000 --- a/libs/program_options/doc/html/program_options/design.html +++ /dev/null @@ -1,202 +0,0 @@ - - - -Design Discussion - - - - - - - - - - - - - - - -
Boost C++ LibrariesHomeLibrariesPeopleFAQMore
-
-
-PrevUpHomeNext -
-
-

-Design Discussion

- -

This section focuses on some of the design questions. -

-
-

-Unicode Support

-

Unicode support was one of the features specifically requested - during the formal review. Throughout this document "Unicode support" is - a synonym for "wchar_t" support, assuming that "wchar_t" always uses - Unicode encoding. Also, when talking about "ascii" (in lowercase) we'll - not mean strict 7-bit ASCII encoding, but rather "char" strings in local - 8-bit encoding. -

-

- Generally, "Unicode support" can mean - many things, but for the program_options library it means that: - -

-
    -
  • Each parser should accept either char* - or wchar_t*, correctly split the input into option - names and option values and return the data. -

  • -
  • For each option, it should be possible to specify whether the conversion - from string to value uses ascii or Unicode. -

  • -
  • -

    The library guarantees that: -

    -
      -
    • ascii input is passed to an ascii value without change -

    • -
    • Unicode input is passed to a Unicode value without change

    • -
    • ascii input passed to a Unicode value, and Unicode input - passed to an ascii value will be converted using a codecvt - facet (which may be specified by the user). -

    • -
    -

    -

    -
  • -
-

-

-

The important point is that it's possible to have some "ascii - options" together with "Unicode options". There are two reasons for - this. First, for a given type you might not have the code to extract the - value from Unicode string and it's not good to require that such code be written. - Second, imagine a reusable library which has some options and exposes - options description in its interface. If all - options are either ascii or Unicode, and the library does not use any - Unicode strings, then the author is likely to use ascii options, making - the library unusable inside Unicode - applications. Essentially, it would be necessary to provide two versions - of the library -- ascii and Unicode. -

-

Another important point is that ascii strings are passed though - without modification. In other words, it's not possible to just convert - ascii to Unicode and process the Unicode further. The problem is that the - default conversion mechanism -- the codecvt facet -- might - not work with 8-bit input without additional setup. -

-

The Unicode support outlined above is not complete. For example, we - don't support Unicode option names. Unicode support is hard and - requires a Boost-wide solution. Even comparing two arbitrary Unicode - strings is non-trivial. Finally, using Unicode in option names is - related to internationalization, which has it's own - complexities. E.g. if option names depend on current locale, then all - program parts and other parts which use the name must be - internationalized too. -

-

The primary question in implementing the Unicode support is whether - to use templates and std::basic_string or to use some - internal encoding and convert between internal and external encodings on - the interface boundaries. -

-

The choice, mostly, is between code size and execution - speed. A templated solution would either link library code into every - application that uses the library (thereby making shared library - impossible), or provide explicit instantiations in the shared library - (increasing its size). The solution based on internal encoding would - necessarily make conversions in a number of places and will be somewhat slower. - Since speed is generally not an issue for this library, the second - solution looks more attractive, but we'll take a closer look at - individual components. -

-

For the parsers component, we have three choices: -

-
    -
  • Use a fully templated implementation: given a string of a - certain type, a parser will return a parsed_options instance - with strings of the same type (i.e. the parsed_options class - will be templated).

  • -
  • Use internal encoding: same as above, but strings will be converted to and - from the internal encoding.

  • -
  • Use and partly expose the internal encoding: same as above, - but the strings in the parsed_options instance will be in the - internal encoding. This might avoid a conversion if - parsed_options instance is passed directly to other components, - but can be also dangerous or confusing for a user. -

  • -
-

-

-

The second solution appears to be the best -- it does not increase - the code size much and is cleaner than the third. To avoid extra - conversions, the Unicode version of parsed_options can also store - strings in internal encoding. -

-

For the options descriptions component, we don't have much - choice. Since it's not desirable to have either all options use ascii or all - of them use Unicode, but rather have some ascii and some Unicode options, the - interface of the value_semantic must work with both. The only way is - to pass an additional flag telling if strings use ascii or internal encoding. - The instance of value_semantic can then convert into some - other encoding if needed. -

-

For the storage component, the only affected function is store. - For Unicode input, the store function should convert the value to the - internal encoding. It should also inform the value_semantic class - about the used encoding. -

-

Finally, what internal encoding should we use? The - alternatives are: - std::wstring (using UCS-4 encoding) and - std::string (using UTF-8 encoding). The difference between - alternatives is: -

-
    -
  • Speed: UTF-8 is a bit slower

  • -
  • Space: UTF-8 takes less space when input is ascii

  • -
  • Code size: UTF-8 requires additional conversion code. However, - it allows one to use existing parsers without converting them to - std::wstring and such conversion is likely to create a - number of new instantiations. -

  • -
-

- There's no clear leader, but the last point seems important, so UTF-8 - will be used. -

-

Choosing the UTF-8 encoding allows the use of existing parsers, - because 7-bit ascii characters retain their values in UTF-8, - so searching for 7-bit strings is simple. However, there are - two subtle issues: -

-
    -
  • We need to assume the character literals use ascii encoding - and that inputs use Unicode encoding.

  • -
  • A Unicode character (say '=') can be followed by 'composing - character' and the combination is not the same as just '=', so a - simple search for '=' might find the wrong character. -

  • -
-

- Neither of these issues appear to be critical in practice, since ascii is - almost universal encoding and since composing characters following '=' (and - other characters with special meaning to the library) are not likely to appear. -

-
-
- - - -
-
-
-PrevUpHomeNext -
- - diff --git a/libs/program_options/doc/html/program_options/howto.html b/libs/program_options/doc/html/program_options/howto.html deleted file mode 100644 index 27aa505d15..0000000000 --- a/libs/program_options/doc/html/program_options/howto.html +++ /dev/null @@ -1,453 +0,0 @@ - - - -How To - - - - - - - - - - - - - - - -
Boost C++ LibrariesHomeLibrariesPeopleFAQMore
-
-
-PrevUpHomeNext -
-
-

-How To

- -

This section describes how the library can be used in specific - situations.

-
-

-Non-conventional Syntax

-

Sometimes, standard command line syntaxes are not enough. For - example, the gcc compiler has "-frtti" and -fno-rtti" options, and this - syntax is not directly supported. -

-

For such cases, the library allows the user to provide an - additional parser -- a function which will be called on each - command line element, before any processing by the library. If the - additional parser recognises the syntax, it returns the option name and - value, which are used directly. The above example can be handled by the - following code: -

-

-

-
-pair<string, string> reg_foo(const string& s)
-{
-    if (s.find("-f") == 0) {
-        if (s.substr(2, 3) == "no-")
-            return make_pair(s.substr(5), string("false"));
-        else
-            return make_pair(s.substr(2), string("true"));
-    } else {
-        return make_pair(string(), string());
-    }
-}
-
-

- Here's the definition of the additional parser. When parsing the command - line, we pass the additional parser: -

-
-store(command_line_parser(ac, av).options(desc).extra_parser(reg_foo)
-        .run(), vm);
-
-

- The complete example can be found in the "example/custom_syntax.cpp" - file. -

-
-
-

-Response Files

-

Some operating system have very low limits of the command line - length. The common way to work around those limitations is using - response files. A response file is just a - configuration file which uses the same syntax as the command line. If - the command line specifies a name of response file to use, it's loaded - and parsed in addition to the command line. The library does not - provide direct support for response files, so you'll need to write some - extra code. -

-

- First, you need to define an option for the response file: -

-
-("response-file", value<string>(),
-     "can be specified with '@name', too")
-
-

-

-

Second, you'll need an additional parser to support the standard syntax - for specifying response files: "@file": -

-
-pair<string, string> at_option_parser(string const&s)
-{
-    if ('@' == s[0])
-        return std::make_pair(string("response-file"), s.substr(1));
-    else
-        return pair<string, string>();
-}
-
-
-

-

-

Finally, when the "response-file" option is found, you'll have to - load that file and pass it to the command line parser. This part is the - hardest. We'll use the Boost.Tokenizer library, which works but has some - limitations. You might also consider Boost.StringAlgo. The code is: -

-
-if (vm.count("response-file")) {
-     // Load the file and tokenize it
-     ifstream ifs(vm["response-file"].as<string>().c_str());
-     if (!ifs) {
-         cout << "Could not open the response file\n";
-         return 1;
-     }
-     // Read the whole file into a string
-     stringstream ss;
-     ss << ifs.rdbuf();
-     // Split the file content
-     char_separator<char> sep(" \n\r");
-     std::string ResponsefileContents( ss.str() );
-     tokenizer<char_separator<char> > tok(ResponsefileContents, sep);
-     vector<string> args;
-     copy(tok.begin(), tok.end(), back_inserter(args));
-     // Parse the file and store the options
-     store(command_line_parser(args).options(desc).run(), vm);
-}
-
-
-

- The complete example can be found in the "example/response_file.cpp" - file. -

-
-
-

-Winmain Command Line

-

On the Windows operating system, GUI applications receive the - command line as a single string, not split into elements. For that reason, - the command line parser cannot be used directly. At least on some - compilers, it is possible to obtain - the split command line, but it's not clear if all compilers support the - same mechanism on all versions of the operating system. The - split_winmain function is a portable mechanism provided - by the library.

-

Here's an example of use: -

-
-vector<string> args = split_winmain(lpCmdLine);
-store(command_line_parser(args).options(desc).run(), vm);
-
-

- The split_winmain function is overloaded for wchar_t strings, so can - also be used in Unicode applications. -

-
-
-

-Option Groups and Hidden Options

-

Having a single instance of the options_description class with all - the program's options can be problematic: -

-
    -
  • Some options make sense only for specific source, for example, - configuration files.

  • -
  • The user would prefer some structure in the generated help message.

  • -
  • Some options shouldn't appear in the generated help message at all.

  • -
-

-

-

To solve the above issues, the library allows a programmer to create several - instances of the options_description class, which can be merged in - different combinations. The following example will define three groups of - options: command line specific, and two options group for specific program - modules, only one of which is shown in the generated help message. -

-

Each group is defined using standard syntax. However, you should - use reasonable names for each options_description instance: -

-
-options_description general("General options");
-general.add_options()
-    ("help", "produce a help message")
-    ("help-module", value<string>(),
-        "produce a help for a given module")
-    ("version", "output the version number")
-    ;
-
-options_description gui("GUI options");
-gui.add_options()
-    ("display", value<string>(), "display to use")
-    ;
-
-options_description backend("Backend options");
-backend.add_options()
-    ("num-threads", value<int>(), "the initial number of threads")
-    ;
-
-

-

-

After declaring options groups, we merge them in two - combinations. The first will include all options and be used for parsing. The - second will be used for the "--help" option. -

-
-// Declare an options description instance which will include
-// all the options
-options_description all("Allowed options");
-all.add(general).add(gui).add(backend);
-
-// Declare an options description instance which will be shown
-// to the user
-options_description visible("Allowed options");
-visible.add(general).add(gui);
-
-

-

-

What is left is to parse and handle the options: -

-
-variables_map vm;
-store(parse_command_line(ac, av, all), vm);
-
-if (vm.count("help"))
-{
-    cout << visible;
-    return 0;
-}
-if (vm.count("help-module")) {
-    const string& s = vm["help-module"].as<string>();
-    if (s == "gui") {
-        cout << gui;
-    } else if (s == "backend") {
-        cout << backend;
-    } else {
-        cout << "Unknown module '"
-             << s << "' in the --help-module option\n";
-        return 1;
-    }
-    return 0;
-}
-if (vm.count("num-threads")) {
-    cout << "The 'num-threads' options was set to "
-         << vm["num-threads"].as<int>() << "\n";
-}
-
-

- When parsing the command line, all options are allowed. The "--help" - message, however, does not include the "Backend options" group -- the - options in that group are hidden. The user can explicitly force the - display of that options group by passing "--help-module backend" - option. The complete example can be found in the - "example/option_groups.cpp" file. -

-
-
-

-Custom Validators

-

By default, the conversion of option's value from string into C++ - type is done using iostreams, which sometimes is not convenient. The - library allows the user to customize the conversion for specific - classes. In order to do so, the user should provide suitable overload of - the validate function. -

-

- Let's first define a simple class: -

-
-struct magic_number {
-public:
-    magic_number(int n) : n(n) {}
-    int n;
-};
-
-

and then overload the validate function: -

-
-void validate(boost::any& v,
-              const std::vector<std::string>& values,
-              magic_number* target_type, int)
-{
-    static regex r("\\d\\d\\d-(\\d\\d\\d)");
-
-    using namespace boost::program_options;
-
-    // Make sure no previous assignment to 'a' was made.
-    validators::check_first_occurrence(v);
-    // Extract the first string from 'values'. If there is more than
-    // one string, it's an error, and exception will be thrown.
-    const string& s = validators::get_single_string(values);
-
-    // Do regex match and convert the interesting part to
-    // int.
-    smatch match;
-    if (regex_match(s, match, r)) {
-        v = any(magic_number(lexical_cast<int>(match[1])));
-    } else {
-        throw validation_error(validation_error::invalid_option_value);
-    }
-}
-
-
-

The function takes four parameters. The first is the storage - for the value, and in this case is either empty or contains an instance of - the magic_number class. The second is the list of strings - found in the next occurrence of the option. The remaining two parameters - are needed to workaround the lack of partial template specialization and - partial function template ordering on some compilers. -

-

The function first checks that we don't try to assign to the same - option twice. Then it checks that only a single string was passed - in. Next the string is verified with the help of the Boost.Regex - library. If that test is passed, the parsed value is stored into the - v variable. -

-

The complete example can be found in the "example/regex.cpp" file. -

-
-
-

-Unicode Support

-

To use the library with Unicode, you'd need to: -

-
    -
  • Use Unicode-aware parsers for Unicode input

  • -
  • Require Unicode support for options which need it

  • -
-

-

-

Most of the parsers have Unicode versions. For example, the - parse_command_line function has an overload which takes - wchar_t strings, instead of ordinary char. -

-

Even if some of the parsers are Unicode-aware, it does not mean you - need to change definition of all the options. In fact, for many options, - like integer ones, it makes no sense. To make use of Unicode you'll need - some Unicode-aware options. They are different from - ordinary options in that they accept wstring input, and - process it using wide character streams. Creating an Unicode-aware option - is easy: just use the the wvalue function instead of the - regular value. -

-

When an ascii parser passes data to an ascii option, or a Unicode - parser passes data to a Unicode option, the data are not changed at - all. So, the ascii option will see a string in local 8-bit encoding, and - the Unicode option will see whatever string was passed as the Unicode - input. -

-

What happens when Unicode data is passed to an ascii option, and - vice versa? The library automatically performs the conversion from - Unicode to local 8-bit encoding. For example, if command line is in - ascii, but you use wstring options, then the ascii input - will be converted into Unicode. -

-

To perform the conversion, the library uses the codecvt<wchar_t, - char> locale facet from the global locale. If - you want to work with strings that use local 8-bit encoding (as opposed to - 7-bit ascii subset), your application should start with: -

-
-locale::global(locale(""));
-      
-

- which would set up the conversion facet according to the user's selected - locale. -

-

It's wise to check the status of the C++ locale support on your - implementation, though. The quick test involves three steps: -

-
    -
  1. Go the the "test" directory and build the "test_convert" binary.

  2. -
  3. -

    Set some non-ascii locale in the environment. On Linux, one can - run, for example:

    -
    -$ export LC_CTYPE=ru_RU.KOI8-R
    -
    -

    -

    -
  4. -
  5. Run the "test_convert" binary with any non-ascii string in the - selected encoding as its parameter. If you see a list of Unicode codepoints, - everything's OK. Otherwise, locale support on your system might be - broken.

  6. -
-

-

-
-
-

-Allowing Unknown Options

-

Usually, the library throws an exception on unknown option names. This - behaviour can be changed. For example, only some part of your application uses - Program_options, and you wish to pass unrecognized options to another part of - the program, or even to another application.

-

To allow unregistered options on the command line, you need to use - the basic_command_line_parser class for parsing (not parse_command_line) - and call the allow_unregistered - method of that class: -

-
-parsed_options parsed =
-    command_line_parser(argc, argv).options(desc).allow_unregistered().run();
-      
-

- - For each token that looks like an option, but does not have a known name, - an instance of basic_option will be added to the result. - The string_key and value fields of the instance will contain results - of syntactic parsing of the token, the unregistered field will be set to true, - and the original_tokens field will contain the token as it appeared on the command line. -

-

If you want to pass the unrecognized options further, the - collect_unrecognized function can be used. - The function will collect original tokens for all unrecognized values, and optionally, all found positional options. - Say, if your code handles a few options, but does not handle positional options at all, you can use the function like this: -

-
-vector<string> to_pass_further = collect_unrecognized(parsed.options, include_positional);
-      
-

- -

-
-
- - - -
-
-
-PrevUpHomeNext -
- - diff --git a/libs/program_options/doc/html/program_options/overview.html b/libs/program_options/doc/html/program_options/overview.html deleted file mode 100644 index b338021276..0000000000 --- a/libs/program_options/doc/html/program_options/overview.html +++ /dev/null @@ -1,617 +0,0 @@ - - - -Library Overview - - - - - - - - - - - - - - - -
Boost C++ LibrariesHomeLibrariesPeopleFAQMore
-
-
-PrevUpHomeNext -
-
-

-Library Overview

- -

In the tutorial section, we saw several examples of library usage. - Here we will describe the overall library design including the primary - components and their function. -

-

The library has three main components: -

-
    -
  • The options description component, which describes the allowed options - and what to do with the values of the options. -

  • -
  • The parsers component, which uses this information to find option names - and values in the input sources and return them. -

  • -
  • The storage component, which provides the - interface to access the value of an option. It also converts the string - representation of values that parsers return into desired C++ types. -

  • -
-

-

-

To be a little more concrete, the options_description - class is from the options description component, the - parse_command_line function is from the parsers component, and the - variables_map class is from the storage component.

-

In the tutorial we've learned how those components can be used by the - main function to parse the command line and config - file. Before going into the details of each component, a few notes about - the world outside of main. -

-

- For that outside world, the storage component is the most important. It - provides a class which stores all option values and that class can be - freely passed around your program to modules which need access to the - options. All the other components can be used only in the place where - the actual parsing is the done. However, it might also make sense for the - individual program modules to describe their options and pass them to the - main module, which will merge all options. Of course, this is only - important when the number of options is large and declaring them in one - place becomes troublesome. -

-
-

-Options Description Component

- -

The options description component has three main classes: - option_description, value_semantic and options_description. The - first two together describe a single option. The option_description - class contains the option's name, description and a pointer to value_semantic, - which, in turn, knows the type of the option's value and can parse the value, - apply the default value, and so on. The options_description class is a - container for instances of option_description. -

-

For almost every library, those classes could be created in a - conventional way: that is, you'd create new options using constructors and - then call the add method of options_description. However, - that's overly verbose for declaring 20 or 30 options. This concern led - to creation of the syntax that you've already seen: -

-
-options_description desc;
-desc.add_options()
-    ("help", "produce help")
-    ("optimization", value<int>()->default_value(10), "optimization level")
-    ;
-
-

-

-

The call to the value function creates an instance of - a class derived from the value_semantic class: typed_value. - That class contains the code to parse - values of a specific type, and contains a number of methods which can be - called by the user to specify additional information. (This - essentially emulates named parameters of the constructor.) Calls to - operator() on the object returned by add_options - forward arguments to the constructor of the option_description - class and add the new instance. -

-

- Note that in addition to the - value, library provides the bool_switch - function, and user can write his own function which will return - other subclasses of value_semantic with - different behaviour. For the remainder of this section, we'll talk only - about the value function. -

-

The information about an option is divided into syntactic and - semantic. Syntactic information includes the name of the option and the - number of tokens which can be used to specify the value. This - information is used by parsers to group tokens into (name, value) pairs, - where value is just a vector of strings - (std::vector<std::string>). The semantic layer - is responsible for converting the value of the option into more usable C++ - types. -

-

This separation is an important part of library design. The parsers - use only the syntactic layer, which takes away some of the freedom to - use overly complex structures. For example, it's not easy to parse - syntax like:

-
calc --expression=1 + 2/3
-

because it's not - possible to parse

-
1 + 2/3
-

without knowing that it's a C - expression. With a little help from the user the task becomes trivial, - and the syntax clear:

-
calc --expression="1 + 2/3"
-

-

-
-

-Syntactic Information

- -

The syntactic information is provided by the - boost::program_options::options_description class - and some methods of the - boost::program_options::value_semantic class - and includes: -

-
    -
  • - name of the option, used to identify the option inside the - program, -

  • -
  • - description of the option, which can be presented to the user, -

  • -
  • - the allowed number of source tokens that comprise options's - value, which is used during parsing. -

  • -
-

-

-

Consider the following example: -

-
-options_description desc;
-desc.add_options()
-    ("help", "produce help message")
-    ("compression", value<string>(), "compression level")
-    ("verbose", value<string>()->implicit_value("0"), "verbosity level")
-    ("email", value<string>()->multitoken(), "email to send to")
-    ;
-      
-

- For the first parameter, we specify only the name and the - description. No value can be specified in the parsed source. - For the first option, the user must specify a value, using a single - token. For the third option, the user may either provide a single token - for the value, or no token at all. For the last option, the value can - span several tokens. For example, the following command line is OK: -

-
-          test --help --compression 10 --verbose --email beadle@mars beadle2@mars
-      
-

-

-
-
-Description formatting
-

- Sometimes the description can get rather long, for example, when - several option's values need separate documentation. Below we - describe some simple formatting mechanisms you can use. -

-

The description string has one or more paragraphs, separated by - the newline character ('\n'). When an option is output, the library - will compute the indentation for options's description. Each of the - paragraph is output as a separate line with that intentation. If - a paragraph does not fit on one line it is spanned over multiple - lines (which will have the same indentation). -

-

You may specify additional indent for the first specified by - inserting spaces at the beginning of a paragraph. For example: -

-
-options.add_options()
-    ("help", "   A long help msg a long help msg a long help msg a long help
-msg a long help msg a long help msg a long help msg a long help msg ")
-    ;
-        
-

- will specify a four-space indent for the first line. The output will - look like: -

-
-  --help                    A long help msg a long
-                        help msg a long help msg
-                        a long help msg a long
-                        help msg a long help msg
-                        a long help msg a long
-                        help msg
-
-        
-

-

-

For the case where line is wrapped, you can want an additional - indent for wrapped text. This can be done by - inserting a tabulator character ('\t') at the desired position. For - example: -

-
-options.add_options()
-      ("well_formated", "As you can see this is a very well formatted
-option description.\n"
-                        "You can do this for example:\n\n"
-                        "Values:\n"
-                        "  Value1: \tdoes this and that, bla bla bla bla
-bla bla bla bla bla bla bla bla bla bla bla\n"
-                        "  Value2: \tdoes something else, bla bla bla bla
-bla bla bla bla bla bla bla bla bla bla bla\n\n"
-                        "    This paragraph has a first line indent only,
-bla bla bla bla bla bla bla bla bla bla bla bla bla bla bla");
-        
-

- will produce: -

-
-  --well_formated       As you can see this is a
-                        very well formatted
-                        option description.
-                        You can do this for
-                        example:
-
-                        Values:
-                          Value1: does this and
-                                  that, bla bla
-                                  bla bla bla bla
-                                  bla bla bla bla
-                                  bla bla bla bla
-                                  bla
-                          Value2: does something
-                                  else, bla bla
-                                  bla bla bla bla
-                                  bla bla bla bla
-                                  bla bla bla bla
-                                  bla
-
-                            This paragraph has a
-                        first line indent only,
-                        bla bla bla bla bla bla
-                        bla bla bla bla bla bla
-                        bla bla bla
-        
-

- The tab character is removed before output. Only one tabulator per - paragraph is allowed, otherwise an exception of type - program_options::error is thrown. Finally, the tabulator is ignored if - it is not on the first line of the paragraph or is on the last - possible position of the first line. -

-
-
-
-

-Semantic Information

-

The semantic information is completely provided by the - boost::program_options::value_semantic class. For - example: -

-
-options_description desc;
-desc.add_options()
-    ("compression", value<int>()->default_value(10), "compression level")
-    ("email", value< vector<string> >()
-        ->composing()->notifier(&your_function), "email")
-    ;
-
-

- These declarations specify that default value of the first option is 10, - that the second option can appear several times and all instances should - be merged, and that after parsing is done, the library will call - function &your_function, passing the value of the - "email" option as argument. -

-
-
-

-Positional Options

-

Our definition of option as (name, value) pairs is simple and - useful, but in one special case of the command line, there's a - problem. A command line can include a positional option, - which does not specify any name at all, for example: -

-
-          archiver --compression=9 /etc/passwd
-        
-

- Here, the "/etc/passwd" element does not have any option name. -

-

One solution is to ask the user to extract positional options - himself and process them as he likes. However, there's a nicer approach - -- provide a method to automatically assign the names for positional - options, so that the above command line can be interpreted the same way - as: -

-
-          archiver --compression=9 --input-file=/etc/passwd
-        
-

-

-

The positional_options_description class allows the command line - parser to assign the names. The class specifies how many positional options - are allowed, and for each allowed option, specifies the name. For example: -

-
-positional_options_description pd; pd.add("input-file", 1);
-
-

specifies that for exactly one, first, positional - option the name will be "input-file". -

-

It's possible to specify that a number, or even all positional options, be - given the same name. -

-
-positional_options_description pd;
-pd.add("output-file", 2).add("input-file", -1);
-
-

- In the above example, the first two positional options will be associated - with name "output-file", and any others with the name "input-file". -

-
- - - - - -
[Warning]Warning

The positional_options_description class only specifies translation from - position to name, and the option name should still be registered with - an instance of the options_description class.

-
-
-
-

-Parsers Component

-

The parsers component splits input sources into (name, value) pairs. - Each parser looks for possible options and consults the options - description component to determine if the option is known and how its value - is specified. In the simplest case, the name is explicitly specified, - which allows the library to decide if such option is known. If it is known, the - value_semantic instance determines how the value is specified. (If - it is not known, an exception is thrown.) Common - cases are when the value is explicitly specified by the user, and when - the value cannot be specified by the user, but the presence of the - option implies some value (for example, true). So, the - parser checks that the value is specified when needed and not specified - when not needed, and returns new (name, value) pair. -

-

- To invoke a parser you typically call a function, passing the options - description and command line or config file or something else. - The results of parsing are returned as an instance of the parsed_options - class. Typically, that object is passed directly to the storage - component. However, it also can be used directly, or undergo some additional - processing. -

-

- There are three exceptions to the above model -- all related to - traditional usage of the command line. While they require some support - from the options description component, the additional complexity is - tolerable. -

-
    -
  • The name specified on the command line may be - different from the option name -- it's common to provide a "short option - name" alias to a longer name. It's also common to allow an abbreviated name - to be specified on the command line. -

  • -
  • Sometimes it's desirable to specify value as several - tokens. For example, an option "--email-recipient" may be followed - by several emails, each as a separate command line token. This - behaviour is supported, though it can lead to parsing ambiguities - and is not enabled by default. -

  • -
  • The command line may contain positional options -- elements - which don't have any name. The command line parser provides a - mechanism to guess names for such options, as we've seen in the - tutorial. -

  • -
-

-

-
-
-

-Storage Component

-

The storage component is responsible for: -

-
    -
  • Storing the final values of an option into a special class and in - regular variables

  • -
  • Handling priorities among different sources.

  • -
  • Calling user-specified notify functions with the final - values of options.

  • -
-

-

-

Let's consider an example: -

-
-variables_map vm;
-store(parse_command_line(argc, argv, desc), vm);
-store(parse_config_file("example.cfg", desc), vm);
-notify(vm);
-
-

- The variables_map class is used to store the option - values. The two calls to the store function add values - found on the command line and in the config file. Finally the call to - the notify function runs the user-specified notify - functions and stores the values into regular variables, if needed. -

-

The priority is handled in a simple way: the store - function will not change the value of an option if it's already - assigned. In this case, if the command line specifies the value for an - option, any value in the config file is ignored. -

-
- - - - - -
[Warning]Warning

Don't forget to call the notify function after you've - stored all parsed values.

-
-
-

-Specific parsers

- -
-

-Configuration file parser

-

The parse_config_file function implements parsing - of simple INI-like configuration files. Configuration file - syntax is line based: -

-
    -
  • -

    A line in the form:

    -
    -name=value
    -        
    -

    gives a value to an option.

    -
  • -
  • -

    A line in the form:

    -
    -[section name]
    -        
    -

    introduces a new section in the configuration file.

    -
  • -
  • The # character introduces a - comment that spans until the end of the line.

  • -
-

The option names are relative to the section names, so - the following configuration file part:

-
-[gui.accessibility]
-visual_bell=yes
-      
-

is equivalent to

-
-gui.accessibility.visual_bell=yes
-      
-
-
-

-Environment variables parser

-

Environment variables are string variables - which are available to all programs via the getenv function - of C runtime library. The operating system allows to set initial values - for a given user, and the values can be further changed on the command - line. For example, on Windows one can use the - autoexec.bat file or (on recent versions) the - Control Panel/System/Advanced/Environment Variables - dialog, and on Unix —, the /etc/profile, - ~/.profile and ~/.bash_profile - files. Because environment variables can be set for the entire system, - they are particularly suitable for options which apply to all programs. -

-

The environment variables can be parsed with the - parse_environment function. The function have several overloaded - versions. The first parameter is always an options_description - instance, and the second specifies what variables must be processed, and - what option names must correspond to it. To describe the second - parameter we need to consider naming conventions for environment - variables.

-

If you have an option that should be specified via environment - variable, you need make up the variable's name. To avoid name clashes, - we suggest that you use a sufficiently unique prefix for environment - variables. Also, while option names are most likely in lower case, - environment variables conventionally use upper case. So, for an option - name proxy the environment variable might be called - BOOST_PROXY. During parsing, we need to perform reverse - conversion of the names. This is accomplished by passing the choosen - prefix as the second parameter of the parse_environment function. - Say, if you pass BOOST_ as the prefix, and there are - two variables, CVSROOT and BOOST_PROXY, the - first variable will be ignored, and the second one will be converted to - option proxy. -

-

The above logic is sufficient in many cases, but it is also - possible to pass, as the second parameter of the parse_environment - function, any function taking a std::string and returning - std::string. That function will be called for each - environment variable and should return either the name of the option, or - empty string if the variable should be ignored. -

-
-
-
-

-Annotated List of Symbols

-

The following table describes all the important symbols in the - library, for quick access.

-
---- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
SymbolDescription
Options description component
options_descriptiondescribes a number of options
valuedefines the option's value
Parsers component
parse_command_lineparses command line (simpified interface)
basic_command_line_parserparses command line (extended interface)
parse_config_fileparses config file
parse_environmentparses environment
Storage component
variables_mapstorage for option values
-
-
- - - -
-
-
-PrevUpHomeNext -
- - diff --git a/libs/program_options/doc/html/program_options/reference.html b/libs/program_options/doc/html/program_options/reference.html deleted file mode 100644 index 535afe05ca..0000000000 --- a/libs/program_options/doc/html/program_options/reference.html +++ /dev/null @@ -1,244 +0,0 @@ - - - -Reference - - - - - - - - - - - - - - - -
Boost C++ LibrariesHomeLibrariesPeopleFAQMore
-
-
-PrevUpHomeNext -
-
-

-Reference

- -
- -
namespace boost {
-  namespace program_options {
-    namespace command_line_style {
-      enum style_t;
-    }
-  }
-}
-
- -
- -
namespace boost {
-  class environment_iterator;
-}
-
-
- -
namespace boost {
-  template<typename Derived, typename ValueType> class eof_iterator;
-}
-
-
- -
namespace boost {
-  namespace program_options {
-    class error;
-    class too_many_positional_options_error;
-    class invalid_command_line_style;
-    class reading_file;
-    class error_with_option_name;
-    class multiple_values;
-    class multiple_occurrences;
-    class required_option;
-    class error_with_no_option_name;
-    class unknown_option;
-    class ambiguous_option;
-    class invalid_syntax;
-    class invalid_config_file_syntax;
-    class invalid_command_line_syntax;
-    class validation_error;
-    class invalid_option_value;
-    class invalid_bool_value;
-    std::string strip_prefixes(const std::string & text);
-  }
-}
-
-
- -
namespace boost {
-  namespace program_options {
-    template<typename charT> class basic_option;
-
-    typedef basic_option< char > option;
-    typedef basic_option< wchar_t > woption;
-  }
-}
-
-
- -
namespace boost {
-  namespace program_options {
-    class option_description;
-    class options_description_easy_init;
-    class options_description;
-    class duplicate_option_error;
-  }
-}
-
-
- -
namespace boost {
-  namespace program_options {
-    template<typename charT> class basic_parsed_options;
-
-    template<> class basic_parsed_options<wchar_t>;
-
-    template<typename charT> class basic_command_line_parser;
-
-    enum collect_unrecognized_mode;
-
-    typedef basic_parsed_options< char > parsed_options;
-    typedef basic_parsed_options< wchar_t > wparsed_options;
-    typedef function1< std::pair< std::string, std::string >, const std::string & > ext_parser;
-    typedef basic_command_line_parser< char > command_line_parser;
-    typedef basic_command_line_parser< wchar_t > wcommand_line_parser;
-    template<typename charT> 
-      basic_parsed_options< charT > 
-      parse_command_line(int, const charT *const, const options_description &, 
-                         int = 0, 
-                         function1< std::pair< std::string, std::string >, const std::string & > = ext_parser());
-    template<typename charT> 
-      BOOST_PROGRAM_OPTIONS_DECL basic_parsed_options< charT > 
-      parse_config_file(std::basic_istream< charT > &, 
-                        const options_description &, bool = false);
-    template<typename charT> 
-      BOOST_PROGRAM_OPTIONS_DECL basic_parsed_options< charT > 
-      parse_config_file(const char *, const options_description &, 
-                        bool = false);
-    template<typename charT> 
-      std::vector< std::basic_string< charT > > 
-      collect_unrecognized(const std::vector< basic_option< charT > > &, 
-                           enum collect_unrecognized_mode);
-    BOOST_PROGRAM_OPTIONS_DECL parsed_options 
-    parse_environment(const options_description &, 
-                      const function1< std::string, std::string > &);
-    BOOST_PROGRAM_OPTIONS_DECL parsed_options 
-    parse_environment(const options_description &, const std::string &);
-    BOOST_PROGRAM_OPTIONS_DECL parsed_options 
-    parse_environment(const options_description &, const char *);
-    BOOST_PROGRAM_OPTIONS_DECL std::vector< std::string > 
-    split_unix(const std::string &, const std::string & = " \t", 
-               const std::string & = "'\"", const std::string & = "\\");
-    BOOST_PROGRAM_OPTIONS_DECL std::vector< std::wstring > 
-    split_unix(const std::wstring &, const std::wstring & = L" \t", 
-               const std::wstring & = L"'\"", const std::wstring & = L"\\");
-  }
-}
-
-
- -
namespace boost {
-  namespace program_options {
-    class positional_options_description;
-  }
-}
-
-
- -
namespace boost {
-  namespace program_options {
-    class value_semantic;
-    template<typename charT> class value_semantic_codecvt_helper;
-
-    template<> class value_semantic_codecvt_helper<char>;
-    template<> class value_semantic_codecvt_helper<wchar_t>;
-
-    class untyped_value;
-    class typed_value_base;
-    template<typename T, typename charT = char> class typed_value;
-    template<typename T> typed_value< T > * value();
-    template<typename T> typed_value< T > * value(T *);
-    template<typename T> typed_value< T, wchar_t > * wvalue();
-    template<typename T> typed_value< T, wchar_t > * wvalue(T *);
-    BOOST_PROGRAM_OPTIONS_DECL typed_value< bool > * bool_switch();
-    BOOST_PROGRAM_OPTIONS_DECL typed_value< bool > * bool_switch(bool *);
-  }
-}
-
-
- -
namespace boost {
-  namespace program_options {
-    class variable_value;
-    class abstract_variables_map;
-    class variables_map;
-    BOOST_PROGRAM_OPTIONS_DECL void 
-    store(const basic_parsed_options< char > &, variables_map &, bool = false);
-    BOOST_PROGRAM_OPTIONS_DECL void 
-    store(const basic_parsed_options< wchar_t > &, variables_map &);
-    BOOST_PROGRAM_OPTIONS_DECL void notify(variables_map &);
-  }
-}
-
- -
- - - -
-
-
-PrevUpHomeNext -
- - diff --git a/libs/program_options/doc/html/program_options/tutorial.html b/libs/program_options/doc/html/program_options/tutorial.html deleted file mode 100644 index 13b132b627..0000000000 --- a/libs/program_options/doc/html/program_options/tutorial.html +++ /dev/null @@ -1,370 +0,0 @@ - - - -Tutorial - - - - - - - - - - - - - - - -
Boost C++ LibrariesHomeLibrariesPeopleFAQMore
-
-
-PrevUpHomeNext -
-
-

-Tutorial

- -

In this section, we'll take a look at the most common usage scenarios - of the program_options library, starting with the simplest one. The examples - show only the interesting code parts, but the complete programs can be found - in the "BOOST_ROOT/libs/program_options/example" directory. Through all the - examples, we'll assume that the following namespace alias is in effect: -

-
namespace po = boost::program_options;
-

-

-
-

-Getting Started

-

The first example is the simplest possible: it only handles two - options. Here's the source code (the full program is in - "example/first.cpp"): - -

-
-// Declare the supported options.
-po::options_description desc("Allowed options");
-desc.add_options()
-    ("help", "produce help message")
-    ("compression", po::value<int>(), "set compression level")
-;
-
-po::variables_map vm;
-po::store(po::parse_command_line(ac, av, desc), vm);
-po::notify(vm);    
-
-if (vm.count("help")) {
-    cout << desc << "\n";
-    return 1;
-}
-
-if (vm.count("compression")) {
-    cout << "Compression level was set to " 
- << vm["compression"].as<int>() << ".\n";
-} else {
-    cout << "Compression level was not set.\n";
-}
-
-

-

-

We start by declaring all allowed options using the - options_description class. The add_options method of that - class returns a special proxy object that defines - operator(). Calls to that operator actually declare - options. The parameters are option name, information about value, and option - description. In this example, the first option has no value, and the second - one has a value of type int. -

-

After that, an object of class variables_map is - declared. That class is intended to store values of options, and can store - values of arbitrary types. Next, the calls to store, - parse_command_line and notify functions cause - vm to contain all the options found on the command - line.

-

And now, finally, we can use the options as we like. The - variables_map class can be used just like - std::map, except that values stored there must be retrieved - with the as method shown above. (If the type specified in the - call to the as method is different from the actually stored - type, an exception is thrown.) -

-

It's now a good time to try compiling the code yourself, but if - you're not yet ready, here's an example session: -

-
-$ bin/gcc/debug/first
-Compression level was not set.
-$ bin/gcc/debug/first --help
-Allowed options:
-  --help                 : produce help message
-  --compression arg      : set compression level
-$ bin/gcc/debug/first --compression 10
-Compression level was set to 10.
-    
-

-

-
-
-

-Option Details

-

An option value, surely, can have other types than int, and - can have other interesting properties, which we'll discuss right now. The - complete version of the code snipped below can be found in - example/options_description.cpp.

-

Imagine we're writing a compiler. It should take the optimization - level, a number of include paths, and a number of input files, and perform some - interesting work. Let's describe the options: -

-
-int opt;
-po::options_description desc("Allowed options");
-desc.add_options()
-    ("help", "produce help message")
-    ("optimization", po::value<int>(&opt)->default_value(10), 
-  "optimization level")
-    ("include-path,I", po::value< vector<string> >(), 
-  "include path")
-    ("input-file", po::value< vector<string> >(), "input file")
-;
-
-

-

-

The "help" option should be familiar from - the previous example. It's a good idea to have this option in all cases. -

-

The "optimization" option shows two new features. First, we specify - the address of the variable(&opt). After storing values, that - variable will have the value of the option. Second, we specify a default - value of 10, which will be used if no value is specified by the user. -

-

The "include-path" option is an example of the - only case where the interface of the options_description - class serves only one - source -- the command line. Users typically like to use short option names - for common options, and the "include-path,I" name specifies that short - option name is "I". So, both "--include-path" and "-I" can be used. -

-

Note also that the type of the "include-path" - option is std::vector. The library provides special - support for vectors -- it will be possible to specify the option several - times, and all specified values will be collected in one vector. -

-

The "input-file" option specifies the list of files to - process. That's okay for a start, but, of course, writing something like: -

-
-compiler --input-file=a.cpp
-    
-

- is a little non-standard, compared with -

-
-compiler a.cpp
-    
-

- We'll address this in a moment. -

-

- The command line tokens which have no option name, as above, are - called "positional options" by this library. They can be handled - too. With a little help from the user, the library can decide that "a.cpp" - really means the same as "--input-file=a.cpp". Here's the additional code - we need: -

-
-po::positional_options_description p;
-p.add("input-file", -1);
-
-po::variables_map vm;
-po::store(po::command_line_parser(ac, av).
-          options(desc).positional(p).run(), vm);
-po::notify(vm);
-    
-

-

-

- The first two lines say that all positional options should be translated - into "input-file" options. Also note that we use the - command_line_parser class to parse the command - line, not the parse_command_line - function. The latter is a convenient wrapper for simple cases, but now we - need to pass additional information. -

-

By now, all options are described and parsed. We'll save ourselves the - trouble of implementing the rest of the compiler logic and only print the - options: -

-
-if (vm.count("include-path"))
-{
-    cout << "Include paths are: " 
-         << vm["include-path"].as< vector<string> >() << "\n";
-}
-
-if (vm.count("input-file"))
-{
-    cout << "Input files are: " 
-         << vm["input-file"].as< vector<string> >() << "\n";
-}
-
-cout << "Optimization level is " << opt << "\n";                
-
-

-

-

Here's an example session: -

-
-$ bin/gcc/debug/options_description --help
-Usage: options_description [options]
-Allowed options:
-  --help                 : produce help message
-  --optimization arg     : optimization level
-  -I [ --include-path ] arg : include path
-  --input-file arg       : input file
-$ bin/gcc/debug/options_description
-Optimization level is 10
-$ bin/gcc/debug/options_description --optimization 4 -I foo a.cpp
-Include paths are: foo
-Input files are: a.cpp
-Optimization level is 4
-
-

-

-

- Oops, there's a slight problem. It's still possible to specify the - "--input-file" option, and usage message says so, which can be confusing - for the user. It would be nice to hide this information, but let's wait - for the next example. -

-
-
-

-Multiple Sources

-

It's quite likely that specifying all options to our compiler on the - command line will annoy users. What if a user installs a new library and - wants to always pass an additional command line element? What if he has - made some choices which should be applied on every run? It's desirable to - create a config file with common settings which will be used together with - the command line. -

-

Of course, there will be a need to combine the values from command - line and config file. For example, the optimization level specified on the - command line should override the value from the config file. On the other - hand, include paths should be combined. -

-

Let's see the code now. The complete program is in - "examples/multiple_sources.cpp". The option definition has two interesting - details. First, we declare several instances of the - options_description class. The reason is that, in general, - not all options are alike. Some options, like "input-file" above, should - not be presented in an automatic help message. Some options make sense only - in the config file. Finally, it's nice to have some structure in the help message, - not just a long list of options. Let's declare several option groups: -

-
-// Declare a group of options that will be 
-// allowed only on command line
-po::options_description generic("Generic options");
-generic.add_options()
-    ("version,v", "print version string")
-    ("help", "produce help message")    
-    ;
-    
-// Declare a group of options that will be 
-// allowed both on command line and in
-// config file
-po::options_description config("Configuration");
-config.add_options()
-    ("optimization", po::value<int>(&opt)->default_value(10), 
-          "optimization level")
-    ("include-path,I", 
-         po::value< vector<string> >()->composing(), 
-         "include path")
-    ;
-
-// Hidden options, will be allowed both on command line and
-// in config file, but will not be shown to the user.
-po::options_description hidden("Hidden options");
-hidden.add_options()
-    ("input-file", po::value< vector<string> >(), "input file")
-    ;        
-
-

- Note the call to the composing method in the declaration of the - "include-path" option. It tells the library that values from different sources - should be composed together, as we'll see shortly. -

-

- The add method of the options_description - class can be used to further group the options: -

-
-po::options_description cmdline_options;
-cmdline_options.add(generic).add(config).add(hidden);
-
-po::options_description config_file_options;
-config_file_options.add(config).add(hidden);
-
-po::options_description visible("Allowed options");
-visible.add(generic).add(config);
-      
-

-

-

The parsing and storing of values follows the usual pattern, except that - we additionally call parse_config_file, and - call the store function twice. But what - happens if the same value is specified both on the command line and in - config file? Usually, the value stored first is preferred. This is what - happens for the "--optimization" option. For "composing" options, like - "include-file", the values are merged. -

-

Here's an example session: -

-
-$ bin/gcc/debug/multiple_sources
-Include paths are: /opt
-Optimization level is 1
-$ bin/gcc/debug/multiple_sources --help
-Allows options:
-
-Generic options:
-  -v [ --version ]       : print version string
-  --help                 : produce help message
-
-Configuration:
-  --optimization n       : optimization level
-  -I [ --include-path ] path : include path
-
-$ bin/gcc/debug/multiple_sources --optimization=4 -I foo a.cpp b.cpp
-Include paths are: foo /opt
-Input files are: a.cpp b.cpp
-Optimization level is 4
-
-

- The first invocation uses values from the configuration file. The second - invocation also uses values from command line. As we see, the include - paths on the command line and in the configuration file are merged, - while optimization is taken from the command line. -

-
-
- - - -
-
-
-PrevUpHomeNext -
- - -- cgit v1.2.3