ewmscp  ..
Public Member Functions | Private Types | Private Attributes | List of all members
options::single< std::regex > Class Reference

#include <OptionsRegex.h>

Inheritance diagram for options::single< std::regex >:
[legend]
Collaboration diagram for options::single< std::regex >:
[legend]

Public Member Functions

 single (char aShortName, const std::string &aLongName, const std::string &aExplanation, const std::string &aDefault="", std::regex::flag_type aRegexOption=std::regex::ECMAScript)
 
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
 
void fAddDefaultFromStream (std::istream &aStream) override
 special for use in the shellScriptOptionParser More...
 
void fWriteValue (std::ostream &aStream) const override
 write textual representation of value to a std::ostream More...
 
- Public Member Functions inherited from options::internal::typed_base< std::regex, true >
 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
 
- 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...
 
- Public Member Functions inherited from options::originalStringKeeper
void fWriteOriginalString (std::ostream &aStream) const
 
const std::string & fGetOriginalString () const
 

Private Types

typedef std::string rangeValueType
 

Private Attributes

std::regex::flag_type regexOption
 

Additional Inherited Members

- Public Types inherited from options::internal::typed_base< std::regex, true >
typedef std::regex valueType
 
typedef std::conditional< std::is_same< std::regex, const char * >::value||forceRangeValueTypeString, std::string, std::regex >::type rangeValueType
 
typedef std::conditional< forceRangeValueTypeString, std::string, std::regex >::type compareValueType
 
- Protected Member Functions inherited from options::base
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 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::internal::typed_base< std::regex, true >
std::multiset< rangeValueTypelRange
 
- 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
 
- Protected Attributes inherited from options::originalStringKeeper
std::string lOriginalString
 

Detailed Description

Definition at line 8 of file OptionsRegex.h.

Member Typedef Documentation

◆ rangeValueType

typedef std::string options::single< std::regex >::rangeValueType
private

Definition at line 12 of file OptionsRegex.h.

Constructor & Destructor Documentation

◆ single()

options::single< std::regex >::single ( char  aShortName,
const std::string &  aLongName,
const std::string &  aExplanation,
const std::string &  aDefault = "",
std::regex::flag_type  aRegexOption = std::regex::ECMAScript 
)
inline

Definition at line 15 of file OptionsRegex.h.

15  :
16  internal::typed_base<std::regex, true>(aShortName, aLongName, aExplanation, 1),
17  regexOption(aRegexOption) {
18  if (! aDefault.empty() ) {
19  assign(aDefault, std::regex::optimize | regexOption);
20  }
21  lOriginalString = aDefault;
22  }

Member Function Documentation

◆ fAddDefaultFromStream()

void options::single< std::regex >::fAddDefaultFromStream ( std::istream &  aStream)
inlineoverridevirtual

special for use in the shellScriptOptionParser

read a value from aStram and set that as default

Implements options::base.

Definition at line 32 of file OptionsRegex.h.

32  {
33  std::getline(aStream, lOriginalString);
34  assign(lOriginalString);
35  }

◆ fCheckRange()

void options::single< std::regex >::fCheckRange ( ) const
inlineoverridevirtual

Implements options::base.

Definition at line 29 of file OptionsRegex.h.

29  {
30  return;
31  }

◆ fSetMe()

void options::single< std::regex >::fSetMe ( std::istream &  aStream,
const internal::sourceItem aSource 
)
inlineoverridevirtual

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

Implements options::base.

Definition at line 23 of file OptionsRegex.h.

23  {
24  using escapedIO::operator>>;
25  aStream >> lOriginalString;
26  assign(lOriginalString, std::regex::optimize | regexOption);
27  fSetSource(aSource);
28  }

References options::base::fSetSource().

Here is the call graph for this function:

◆ fWriteValue()

void options::single< std::regex >::fWriteValue ( std::ostream &  aStream) const
inlineoverridevirtual

write textual representation of value to a std::ostream

Implements options::base.

Definition at line 36 of file OptionsRegex.h.

36  {
37  aStream << lOriginalString;
38  }

Member Data Documentation

◆ regexOption

std::regex::flag_type options::single< std::regex >::regexOption
private

Definition at line 13 of file OptionsRegex.h.


The documentation for this class was generated from the following file:
options::single< std::regex >::regexOption
std::regex::flag_type regexOption
Definition: OptionsRegex.h:13
options::originalStringKeeper::lOriginalString
std::string lOriginalString
Definition: Options.h:866
options::base::fSetSource
virtual void fSetSource(const internal::sourceItem &aSource)
remember the source that provided the value, e.g. commandline or a config file
Definition: Options.cpp:561