Boost C++ Libraries Home Libraries People FAQ More

PrevUpHomeNext

Class template typed_value

boost::program_options::typed_value

Synopsis

// In header: <boost/program_options/value_semantic.hpp>

template<typename T, typename charT> 
class typed_value : public , public  {
public:
  // construct/copy/destruct
  ();

  // public member functions
  typed_value * ();
  typed_value * (, );
  typed_value * ();
  typed_value * ();
  typed_value * (, );
  typed_value * ();
  typed_value * ();
  typed_value * ();
  typed_value * ();
  typed_value * ();
   () ;
   () ;
   () ;
   () ;
   () ;
   (, ) ;
   () ;
   () ;
   () ;
};

Description

Class which handles value of a specific type.

typed_value public construct/copy/destruct

  1. ( 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 * ( v);

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

  2. typed_value * ( v,  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.

  3. typed_value * ( 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,

  4. typed_value * ( name);

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

  5. typed_value * ( v,  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.

  6. typed_value * ( f);

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

  7. typed_value * ();

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

  8. typed_value * ();

    Specifies that the value can span multiple tokens.

  9. typed_value * ();

    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.

  10. typed_value * ();

    Specifies that the value must occur.

  11.  () ;

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

  12.  () ;

    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.

  13.  () ;

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

  14.  () ;

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

  15.  () ;

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

  16.  ( value_store, 
                 new_tokens) ;

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

  17.  ( value_store) ;

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

  18.  ( value_store) ;

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

  19.  () ;

PrevUpHomeNext