ewmscp
..
|
special type of option that is not really parsed but used to feed an additional option parser More...
#include <OptionsWithForeignParser.h>
Public Member Functions | |
ForeignOption (ForeignApplicationOptions *aForeignApplication, char aShortName, std::string aLongName, std::string aExplanation, short aNargs, const char *aCanonicalForm) | |
void | fSetMe (std::istream &aArg, const internal::sourceItem &aSource) override |
remember argument ad register in list of options that were set. More... | |
void | fSetMeNoarg (const internal::sourceItem &aSource) override |
void | fCheckRange () const override |
range checking does not work, we know no ranges More... | |
void | fAddToRangeFromStream (std::istream &aStream) override |
just read away the line, we cannot do anything sensible here More... | |
void | fAddDefaultFromStream (std::istream &aStream) override |
just read away the line, we cannot do anything sensible here More... | |
void | fWriteValue (std::ostream &aStream) const override |
write textual representation of value to a std::ostream More... | |
virtual | ~ForeignOption () |
virtual void | fAddArgs () const |
add args of this option tho the argument vector of the option list More... | |
![]() | |
base (char aShortName, const std::string &aLongName, const std::string &aExplanation, short aNargs) | |
construct an object of type base More... | |
virtual | ~base () |
virtual void | fRequire (const base *aOtherOption) |
require aOtherOption when this option is set More... | |
virtual void | fRequire (std::vector< const base * > aOtherOptions) |
add vector of other options, particlularly nice for use with initializer list More... | |
template<typename InputIt > | |
void | fRequire (InputIt aBegin, InputIt aEnd) |
add all options from the pair of iterators [aBegin,aEnd) to the list of required options More... | |
virtual void | fForbid (const base *aOtherOption) |
forbid aOtherOption when this option is set More... | |
virtual void | fForbid (std::vector< const base * > aOtherOptions) |
add vector of other options, particlularly nice for use with initializer list More... | |
template<typename InputIt > | |
void | fForbid (InputIt aBegin, InputIt aEnd) |
add all options from the pair of iterators [aBegin,aEnd) to the list of forbidden options More... | |
virtual bool | fIsSet () const |
check if this option was set, regardless of from command line or config file More... | |
virtual bool | fIsContainer () const |
const std::string & | fGetLongName () const |
returns long name of option, usually only for internal use. More... | |
Private Attributes | |
std::string | lCanonical |
std::string | lArg |
ForeignApplicationOptions * | lOptions |
Additional Inherited Members | |
![]() | |
virtual void | fSetSource (const internal::sourceItem &aSource) |
remember the source that provided the value, e.g. commandline or a config file More... | |
virtual void | fWriteCfgLines (std::ostream &aStream, const char *aPrefix) const |
virtual void | fWriteRange (std::ostream &) const |
void | fSetPreserveWorthyStuff (std::vector< std::string > *aStuff) |
void | fHide () |
hide option, will be respected by help More... | |
bool | fIsHidden () const |
void | fDisable () |
disable option by removing it from the maps More... | |
![]() | |
static std::map< std::string, base * > & | fGetOptionMap () |
static std::map< char, base * > & | fGetShortOptionMap () |
![]() | |
char | lShortName |
const std::string | lLongName |
const std::string | lExplanation |
internal::sourceItem | lSource |
short | lNargs |
bool | lHidden |
std::vector< std::string > * | lPreserveWorthyStuff |
std::vector< const base * > | lRequiredOptions |
std::vector< const base * > | lForbiddenOptions |
special type of option that is not really parsed but used to feed an additional option parser
Definition at line 34 of file OptionsWithForeignParser.h.
options::ForeignOption::ForeignOption | ( | ForeignApplicationOptions * | aForeignApplication, |
char | aShortName, | ||
std::string | aLongName, | ||
std::string | aExplanation, | ||
short | aNargs, | ||
const char * | aCanonicalForm | ||
) |
The newly created object is inserted into the maps sorted by long name and by short name, (short name only if it is not '\0') If a clash wopuld occur, i.e. either long or short name is already taken an exception is thrown.
[in] | aShortName | short option without the -, use '\0' to have only a long form |
[in] | aLongName | long option without the –, must always be given |
[in] | aExplanation | explanation for help output |
[in] | aNargs | number of arguments/parameters. May be 0 ot 1. |
[in] | aForeignApplication | required pointer to the ForeignApplicationOptions object that this option shall belong to |
[in] | aCanonicalForm | canonical form of the option, including leading - signs to be given to the other parser |
Definition at line 51 of file OptionsWithForeignParser.cpp.
|
virtual |
Definition at line 57 of file OptionsWithForeignParser.cpp.
|
virtual |
add args of this option tho the argument vector of the option list
Definition at line 70 of file OptionsWithForeignParser.cpp.
References options::ForeignApplicationOptions::fAddToArgc(), lArg, lCanonical, options::base::lNargs, and lOptions.
|
overridevirtual |
just read away the line, we cannot do anything sensible here
Implements options::base.
Definition at line 85 of file OptionsWithForeignParser.cpp.
|
overridevirtual |
just read away the line, we cannot do anything sensible here
Implements options::base.
Definition at line 81 of file OptionsWithForeignParser.cpp.
|
overridevirtual |
range checking does not work, we know no ranges
Implements options::base.
Definition at line 77 of file OptionsWithForeignParser.cpp.
|
overridevirtual |
remember argument ad register in list of options that were set.
Implements options::base.
Definition at line 59 of file OptionsWithForeignParser.cpp.
References options::ForeignApplicationOptions::fRegister(), options::base::fSetSource(), lArg, and lOptions.
|
overridevirtual |
Reimplemented from options::base.
Definition at line 65 of file OptionsWithForeignParser.cpp.
References options::ForeignApplicationOptions::fRegister(), options::base::fSetSource(), and lOptions.
|
overridevirtual |
write textual representation of value to a std::ostream
Implements options::base.
Definition at line 88 of file OptionsWithForeignParser.cpp.
References lArg.
|
private |
Definition at line 37 of file OptionsWithForeignParser.h.
Referenced by fAddArgs(), fSetMe(), and fWriteValue().
|
private |
Definition at line 36 of file OptionsWithForeignParser.h.
Referenced by fAddArgs().
|
private |
Definition at line 38 of file OptionsWithForeignParser.h.
Referenced by fAddArgs(), fSetMe(), and fSetMeNoarg().