Boost C++ Libraries Home Libraries People FAQ More

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
  ( = ,  = );
  (,  = ,  = );

  // public member functions
   (option_description >);
  options_description & (options_description &);
   () ;
  options_description_easy_init ();
  option_description & 
  (, ,  = ,  = ) ;
  option_description * 
  (, ,  = ,  = ) ;
  option_description > > & () ;
   (,  = ) ;

  // friend functions
   
  (, options_description &);

  // public data members
  static  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. ( line_length = , 
                         min_description_length = );

    Creates the instance.

  2. ( caption,  line_length = , 
                         min_description_length = );

    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.

options_description public member functions

  1.  (option_description > desc);

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

  2. options_description & (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.

  3.  () ;

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

  4. options_description_easy_init ();

    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.

  5. option_description & 
    ( name,  approx,  long_ignore_case = , 
          short_ignore_case = ) ;
  6. option_description * 
    ( name,  approx,  long_ignore_case = , 
                  short_ignore_case = ) ;
  7. option_description > > & () ;
  8.  ( os,  width = ) ;

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

options_description friend functions

  1.  
    ( os, 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