class Option

Template class adding type specific behaviour to BaseOption. More...

Full nameUtilities::BaseOption::Option
Definition#include <options.h>
Template formOption<templateclass T>
InheritsUtilities::BaseOption
List of all Methods
Annotated List
Files
Globals
Hierarchy
Index

Public Methods


Detailed Description

Template class adding type specific behaviour to BaseOption. Define one of these per program supported option.

 Option (const string& k, const T& v, const string& ht, bool c, ArgFlag f = no_argument): BaseOption(k, ht, c, f), default_(v), value_(v)

Parameters:
kComma seperated list of key aliases
vDefault value for this option
htHelp text to be printed when outputting usage
cIf true then this option is compulsory
fThis options argument requirements

bool  set_value (const string& vs)

Parameters:
vsThe value string which needs to be parsed to set this options value. The overloaded function string_to_T must be defined for type T.

const T&  value ()

Returns: The options value.

const T&  default_value ()

Returns: The options default value.

Option ()

[virtual]