ewmscp  ..
Namespaces | Classes | Functions
options Namespace Reference

Namespaces

 escapedIO
 
 internal
 template specialisation for options that are std::chrono::time_point<std::chrono::system_clock>
 

Classes

class  base
 base class for options More...
 
class  container
 template for container-based options. More...
 
class  ForeignApplicationOptions
 class to hold a list of options that are to be handled by a foreign option parser More...
 
class  ForeignOption
 special type of option that is not really parsed but used to feed an additional option parser More...
 
class  fundamental_wrapper
 wrapper class for fundamental types More...
 
class  map
 template for map-based options. More...
 
class  OptionsForTApplication
 specific class to give the options for a TApplication as ForeignApplicationOptions to the option parser More...
 
class  originalStringKeeper
 interface class that is used for options where the original string rather than the streamed value is to be written into config files. More...
 
class  parser
 class that contains the parser, i.e. does that option handling More...
 
class  positional
 
class  postFixedNumber
 
class  single
 generic option class with any type that can be used with std::istream and std::ostream More...
 
class  single< bool >
 class specialisation for options of type bool More...
 
class  single< std::chrono::duration< Rep, Period > >
 template specialisation for options that are std::chrono::durations More...
 
class  single< std::chrono::system_clock::time_point >
 
class  single< std::regex >
 
class  valuePrinter
 template interface class for options that provide a value printer More...
 
class  withAction
 

Functions

std::ostream & operator<< (std::ostream &aStream, const internal::sourceItem &aItem)
 operator to write sourceItems to a stream More...
 
template<typename T >
std::ostream & operator<< (std::ostream &aStream, const postFixedNumber< T > &aNumber)
 
template<typename T >
std::istream & operator>> (std::istream &aStream, postFixedNumber< T > &aNumber)
 
template<typename T >
std::ostream & operator<< (std::ostream &aStream, const fundamental_wrapper< T > &aWrapper)
 
template<typename T >
std::istream & operator>> (std::istream &aStream, fundamental_wrapper< T > &aWrapper)
 

Detailed Description

all of the option parser stuff is contained in the namespace options.

Function Documentation

◆ operator<<() [1/3]

template<typename T >
std::ostream& options::operator<< ( std::ostream &  aStream,
const fundamental_wrapper< T > &  aWrapper 
)

Definition at line 155 of file Options.h.

155  {
156  const T& oerks = aWrapper;
157  aStream << oerks;
158  return aStream;
159  };

◆ operator<<() [2/3]

std::ostream & options::operator<< ( std::ostream &  aStream,
const internal::sourceItem aItem 
)

operator to write sourceItems to a stream

Definition at line 57 of file Options.cpp.

57  {
58  aStream << aItem.fGetFile()->fGetName() << ":" << aItem.fGetLineNumber();
59  return aStream;
60  }

References options::internal::sourceItem::fGetFile(), and options::internal::sourceItem::fGetLineNumber().

Here is the call graph for this function:

◆ operator<<() [3/3]

template<typename T >
std::ostream& options::operator<< ( std::ostream &  aStream,
const postFixedNumber< T > &  aNumber 
)

Definition at line 121 of file Options.h.

121  {
122  T n = aNumber;
123  int m = 0;
124  // as long as no better solution pops up for the shell scrip parser
125  // always write just normally
126  //while (n != 0 && (n & ((static_cast<T>(1) << 10) - 1)) == 0) {
127  // n = n >> 10;
128  // m++;
129  //}
130  aStream << n;
131  if (m > 0) {
132  static std::string gMultipliers("kMGTPEZY");
133  aStream << gMultipliers.at(m - 1);
134  }
135  return aStream;
136  }

◆ operator>>() [1/2]

template<typename T >
std::istream& options::operator>> ( std::istream &  aStream,
fundamental_wrapper< T > &  aWrapper 
)

Definition at line 160 of file Options.h.

160  {
161  T& oerks = aWrapper;
162  using escapedIO::operator>>;
163  aStream >> oerks;
164  return aStream;
165  };

◆ operator>>() [2/2]

template<typename T >
std::istream& options::operator>> ( std::istream &  aStream,
postFixedNumber< T > &  aNumber 
)

Definition at line 137 of file Options.h.

137  {
138  T n;
139  aStream >> n;
140  if (!aStream.eof()) {
141  auto c = aStream.peek();
142  static std::string gMultipliers("kMGTPEZY");
143  auto m = gMultipliers.find(c);
144  if (m != std::string::npos) {
145  aStream.get();
146  n = n << ((m + 1) * 10);
147  }
148  }
149  aNumber = n;
150  return aStream;
151  };