Class for file related options.
More...
#include </scratch/bob/jari/tmp/pristine/yat-0.10.x/yat/utility/OptionOutFile.h>
List of all members.
Public Member Functions |
| OptionOutFile (CommandLine &cmd, std::string name, std::string desc, bool required=false) YAT_DEPRECATE_GCC_PRE4_3 |
| Constructor.
|
virtual | ~OptionOutFile (void) |
| Destructor.
|
std::ostream & | ostream (void) |
| stream ss to underlying file. If no file was given during parsing, reference to std::cout is returned.
|
void | print_arg (std::string arg) |
std::string | value (void) const |
void | value (std::stringv) |
| set value
|
std::string | description (void) const |
void | description (const std::string &description) |
| set description
|
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.
|
Detailed Description
Class for file related options.
- Deprecated:
- Provided for backward compatibility with the 0.5 API. Use OptionFile and StreamRedirect instead (see CommandLine for example code).
Constructor & Destructor Documentation
theplu::yat::utility::OptionOutFile::OptionOutFile |
( |
CommandLine & |
cmd, |
|
|
std::string |
name, |
|
|
std::string |
desc, |
|
|
bool |
required = false |
|
) |
| |
Constructor.
- Parameters:
-
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 |
Member Function Documentation
const CommandLine& theplu::yat::utility::Option::cmd |
( |
void |
| ) |
const |
|
protectedinherited |
std::string theplu::yat::utility::Option::description |
( |
void |
| ) |
const |
|
inherited |
void theplu::yat::utility::Option::description |
( |
const std::string & |
description | ) |
|
|
inherited |
set description
- Since:
- New in yat 0.7
std::string theplu::yat::utility::Option::long_name |
( |
void |
| ) |
const |
|
inherited |
- Returns:
- long name e.g. 'help' for –help option.
bool theplu::yat::utility::Option::present |
( |
void |
| ) |
const |
|
inherited |
Get if option was found in cmd.
- Returns:
- true if option has been detected in parsing
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:
- Parameters:
-
arg | string to be used in help output such as `=TARGET' in `–target=TARGET'. See print3(). |
- Since:
- New in yat 0.5.
- Returns:
- true if Option is required, i.e., if Option is not found during parsing an exception will be thrown.
char theplu::yat::utility::Option::short_name |
( |
void |
| ) |
const |
|
inherited |
- Returns:
- short name e.g. 'h' for -h option.
void theplu::yat::utility::Option::validate |
( |
void |
| ) |
|
|
inherited |
set value
- Since:
- new in yat 0.5
The documentation for this class was generated from the following file: