ewmscp
..
|
#include <OptionsChrono.h>
Public Types | |
typedef rangeValueType | valueType |
![]() | |
typedef std::chrono::system_clock::time_point | valueType |
typedef std::conditional< std::is_same< std::chrono::system_clock::time_point, const char * >::value||false, std::string, std::chrono::system_clock::time_point >::type | rangeValueType |
typedef std::conditional< false, std::string, std::chrono::system_clock::time_point >::type | compareValueType |
![]() | |
typedef void(* | valuePrinterType) (std::ostream &, const std::chrono::system_clock::time_point &) |
Public Member Functions | |
single (char aShortName, const std::string &aLongName, const std::string &aExplanation, valueType aDefault=valueType::clock::now(), const std::vector< valueType > &aRange={}, valuePrinterType aValuePrinter=fDefaultValuePrinter) | |
single (char aShortName, const std::string &aLongName, const std::string &aExplanation, const std::string &aDefault, const std::vector< std::string > &aRange={}, valuePrinterType aValuePrinter=fDefaultValuePrinter) | |
void | fAddDefaultFromStream (std::istream &aStream) override |
special for use in the shellScriptOptionParser More... | |
void | fWriteRange (std::ostream &aStream) const override |
void | fWriteValue (std::ostream &aStream) const override |
write textual representation of value to a std::ostream More... | |
void | fSetMe (std::istream &aStream, const internal::sourceItem &aSource) override |
function to set the value from a string, remembering the source More... | |
void | fCheckRange () const override |
![]() | |
typed_base (Types ... args) | |
virtual void | fAddToRange (rangeValueType aValue) |
add a value to the range of allowed values More... | |
std::enable_if<(!std::is_same< rangeValueType, std::string >::value) &&std::is_same< TT, std::string >::value, void >::type | fAddToRange (const TT &aString) |
void | fAddToRange (InputIt aBegin, InputIt aEnd) |
add values from the iterator range [aBegin,aEnd) to the range of allowed values More... | |
void | fAddToRange (const std::vector< TT > &aRange) |
add values from a vector (may be given as initializer list) to the range of allowed values More... | |
void | fAddToRangeFromStream (std::istream &aStream) override |
void | fWriteRange (std::ostream &aStream) const override |
virtual void | fCheckValueForRange (const compareValueType &aValue) const |
![]() | |
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... | |
![]() | |
void | fWriteOriginalString (std::ostream &aStream) const |
const std::string & | fGetOriginalString () const |
![]() | |
valuePrinter () | |
valuePrinter (valuePrinterType aValuePrinter) | |
virtual void | fSetValuePrinter (valuePrinterType aValuePrinter) |
Static Public Member Functions | |
static void | fDefaultValuePrinter (std::ostream &aStream, const valueType &aValue) |
Protected Attributes | |
std::vector< valueType > | lRange |
![]() | |
std::multiset< rangeValueType > | lRange |
![]() | |
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 |
![]() | |
std::string | lOriginalString |
![]() | |
valuePrinterType | lValuePrinter |
Additional Inherited Members | |
![]() | |
virtual void | fSetMeNoarg (const internal::sourceItem &) |
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 |
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 () |
Definition at line 68 of file OptionsChrono.h.
typedef rangeValueType options::single< std::chrono::system_clock::time_point >::valueType |
Definition at line 74 of file OptionsChrono.h.
options::single< std::chrono::system_clock::time_point >::single | ( | char | aShortName, |
const std::string & | aLongName, | ||
const std::string & | aExplanation, | ||
valueType | aDefault = valueType::clock::now() , |
||
const std::vector< valueType > & | aRange = {} , |
||
valuePrinterType | aValuePrinter = fDefaultValuePrinter |
||
) |
Definition at line 399 of file OptionsChrono.cpp.
References options::internal::typed_base< T >::fAddToRange().
options::single< std::chrono::system_clock::time_point >::single | ( | char | aShortName, |
const std::string & | aLongName, | ||
const std::string & | aExplanation, | ||
const std::string & | aDefault, | ||
const std::vector< std::string > & | aRange = {} , |
||
valuePrinterType | aValuePrinter = fDefaultValuePrinter |
||
) |
Definition at line 407 of file OptionsChrono.cpp.
References options::internal::typed_base< T >::fAddToRange(), and options::internal::fParseTimePointString().
|
overridevirtual |
special for use in the shellScriptOptionParser
read a value from aStram and set that as default
Implements options::base.
Definition at line 421 of file OptionsChrono.cpp.
References options::internal::fParseTimePointString().
|
inlineoverridevirtual |
Implements options::base.
Definition at line 89 of file OptionsChrono.h.
References options::internal::typed_base< T >::fCheckValueForRange().
|
static |
Definition at line 393 of file OptionsChrono.cpp.
|
overridevirtual |
function to set the value from a string, remembering the source
Implements options::base.
Definition at line 452 of file OptionsChrono.cpp.
References options::internal::fParseTimePointString(), and options::base::fSetSource().
|
overridevirtual |
Reimplemented from options::base.
Definition at line 430 of file OptionsChrono.cpp.
References options::internal::typed_base< T >::lRange.
|
overridevirtual |
write textual representation of value to a std::ostream
Implements options::base.
Definition at line 449 of file OptionsChrono.cpp.
Referenced by main().
|
protected |
Definition at line 76 of file OptionsChrono.h.