#include <yat/utility/OptionInFile.h>
Public Member Functions | |
OptionInFile (CommandLine &cmd, std::string name, std::string desc, bool required=false) | |
Constructor. | |
virtual | ~OptionInFile (void) |
Destructor. | |
std::istream & | istream (void) |
void | print_arg (std::string arg) |
std::string | value (void) const |
void | value (std::stringv) |
set value | |
std::string | description (void) const |
std::string | long_name (void) const |
void | parse (std::vector< std::string >::iterator &, const std::vector< std::string >::iterator &) |
parsing the commandline | |
bool | present (void) const |
Get if option was found in cmd. | |
std::string | print (void) |
print help output | |
void | reset (void) |
sets present to false | |
char | short_name (void) const |
void | validate (void) |
Validate the Option. | |
Protected Member Functions | |
bool | required (void) const |
const CommandLine & | cmd (void) const |
theplu::yat::utility::OptionInFile::OptionInFile | ( | CommandLine & | cmd, | |
std::string | name, | |||
std::string | desc, | |||
bool | required = false | |||
) |
Constructor.
cmd | Commandline Option is associated with | |
name | string such as "file" for --file, "f" for -f or "f,file" for having both short and long option name | |
desc | string used in help display | |
required | If true option must be found in commandline or exception is thrown in validation |
std::istream& theplu::yat::utility::OptionInFile::istream | ( | void | ) |
void theplu::yat::utility::OptionArg< std::string >::print_arg | ( | std::string | arg | ) | [inline, inherited] |
arg | string to be used in help output such as `=TARGET' in `--target=TARGET'. See print3(). |
std::string theplu::yat::utility::OptionArg< std::string >::value | ( | void | ) | const [inline, inherited] |
void theplu::yat::utility::OptionArg< std::string >::value | ( | std::string | v | ) | [inline, inherited] |
set value
bool theplu::yat::utility::OptionArg< std::string >::required | ( | void | ) | const [inline, protected, inherited] |
std::string theplu::yat::utility::Option::description | ( | void | ) | const [inherited] |
std::string theplu::yat::utility::Option::long_name | ( | void | ) | const [inherited] |
bool theplu::yat::utility::Option::present | ( | void | ) | const [inherited] |
Get if option was found in cmd.
std::string theplu::yat::utility::Option::print | ( | void | ) | [inherited] |
print help output
This function calls the four virtual private functions print1, print2, print3, and print4. This allows an inherited class to implement one (or several) of these functions and keep the default output of the others. The default behavior is that:
char theplu::yat::utility::Option::short_name | ( | void | ) | const [inherited] |
void theplu::yat::utility::Option::validate | ( | void | ) | [inherited] |
Validate the Option.
This function is called after commandline is parsed.
const CommandLine& theplu::yat::utility::Option::cmd | ( | void | ) | const [protected, inherited] |