![]() |
Home | Libraries | People | FAQ | More |
boost::program_options::basic_command_line_parser —
template<typename charT> class basic_command_line_parser { public: // construct/copy/destruct basic_command_line_parser(const std::vector< std::basic_string< charT > > &); basic_command_line_parser(int, charT *); // public member functions basic_command_line_parser & options(const options_description &) ; basic_command_line_parser & positional(const positional_options_description &) ; basic_command_line_parser & style(int) ; basic_command_line_parser & extra_parser(ext_parser) ; basic_parsed_options< charT > run() ; };
Command line parser.
The class allows one to specify all the information needed for parsing and to parser the 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 nuber of parameters will be confusing.
For the most common case, the function parse_command_line is a better alternative.
basic_command_line_parser
construct/copy/destructbasic_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.
basic_command_line_parser(int argc, charT * argv);
Creates a command line parser for the specified arguments list. The parameter should be the same as passes to 'main'.
basic_command_line_parser
public member functionsbasic_command_line_parser & options(const options_description & desc) ;
Sets options descriptions to use.
basic_command_line_parser & positional(const positional_options_description & desc) ;
Sets positional options description to use.
basic_command_line_parser & style(int ) ;
Sets the command line style.
basic_command_line_parser & extra_parser(ext_parser ) ;
Sets the extra parsers.
basic_parsed_options< charT > run() ;
Copyright © 2002-2004 Vladimir Prus |