ewmscp  ..
Public Member Functions | List of all members
options::internal::OptionHelp Class Reference

special derived class used to give help More...

Inheritance diagram for options::internal::OptionHelp:
[legend]
Collaboration diagram for options::internal::OptionHelp:
[legend]

Public Member Functions

 OptionHelp ()
 
void fSetMeNoarg (const sourceItem &) override
 
void fSetMe (std::istream &, const sourceItem &aSource) override
 function to set the value from a string, remembering the source More...
 
- Public Member Functions inherited from options::single< bool >
 single (char aShortName, const std::string &aLongName, const std::string &aExplanation, bool aDefault=false)
 
 single (const single &)=delete
 
bool operator= (const bool &aValue)
 
void fWriteValue (std::ostream &aStream) const override
 write textual representation of value to a std::ostream More...
 
void fCheckRange () const override
 
void fAddToRangeFromStream (std::istream &) override
 special for use in the shellScriptOptionParser More...
 
void fAddDefaultFromStream (std::istream &aStream) override
 special for use in the shellScriptOptionParser More...
 
bool fGetValue () const
 
- Public Member Functions inherited from options::fundamental_wrapper< bool >
 fundamental_wrapper ()
 
 fundamental_wrapper (bool aValue)
 
fundamental_wrapperoperator= (const bool aValue)
 
bool operator= (const bool &aValue)
 
 operator bool & ()
 
 operator const bool & () const
 
- Public Member Functions inherited from options::base
 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...
 

Additional Inherited Members

- Protected Member Functions inherited from options::base
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 Protected Member Functions inherited from options::base
static std::map< std::string, base * > & fGetOptionMap ()
 
static std::map< char, base * > & fGetShortOptionMap ()
 
- Protected Attributes inherited from options::fundamental_wrapper< bool >
bool lValue
 
- Protected Attributes inherited from options::base
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
 

Detailed Description

special derived class used to give help

Definition at line 936 of file Options.cpp.

Constructor & Destructor Documentation

◆ OptionHelp()

options::internal::OptionHelp::OptionHelp ( )
inline

Definition at line 938 of file Options.cpp.

938  :
939  single('h', "help", "give this help") {
940  }

Member Function Documentation

◆ fSetMe()

void options::internal::OptionHelp::fSetMe ( std::istream &  aStream,
const sourceItem aSource 
)
inlineoverridevirtual

function to set the value from a string, remembering the source

Reimplemented from options::single< bool >.

Definition at line 945 of file Options.cpp.

945  {
946  fSetMeNoarg(aSource);
947  }

References fSetMeNoarg().

Here is the call graph for this function:

◆ fSetMeNoarg()

void options::internal::OptionHelp::fSetMeNoarg ( const sourceItem )
inlineoverridevirtual

Reimplemented from options::single< bool >.

Definition at line 941 of file Options.cpp.

941  {
943  exit(parser::fGetInstance()->fGetHelpReturnValue());
944  }

References options::parser::fGetInstance(), and options::parser::fHelp().

Referenced by fSetMe().

Here is the call graph for this function:
Here is the caller graph for this function:

The documentation for this class was generated from the following file:
options::parser::fHelp
void fHelp()
print help, normally automatically called by the –help option or in case of problems.
Definition: Options.cpp:724
options::internal::OptionHelp::fSetMeNoarg
void fSetMeNoarg(const sourceItem &) override
Definition: Options.cpp:941
options::single< bool >::single
single(char aShortName, const std::string &aLongName, const std::string &aExplanation, bool aDefault=false)
Definition: Options.h:599
options::parser::fGetInstance
static parser * fGetInstance()
get the only allwed instance of the option parser.
Definition: Options.cpp:144