50 const auto colon = str.find(
':');
52 if (colon == std::string::npos)
77 if (readScalar(str, val))
82 else if (str[colon+1] ==
':')
91 if (readScalar(str.substr(1), val))
96 else if (colon == str.size()-1)
100 if (readScalar(str.substr(0, colon), val))
108 scalar minVal, maxVal;
111 readScalar(str.substr(0, colon), minVal)
112 && readScalar(str.substr(colon+1), maxVal)
127 if (!parse(str,
range))
129 Info<<
"Bad scalar-range while parsing: " << str <<
endl;
142 type_(max_ < min_ ? scalarRange::NONE : scalarRange::GE_LE)
150 type_(max_ < min_ ? scalarRange::NONE : scalarRange::GE_LE)
160 case scalarRange::EQ:
164 case scalarRange::GE:
165 case scalarRange::GT:
169 case scalarRange::LE:
170 case scalarRange::LT:
174 case scalarRange::GE_LE:
178 case scalarRange::ALWAYS:
bool good() const noexcept
True if the Switch represents a valid enumeration.
constexpr scalarRange() noexcept
Construct an empty (inverse, NONE) range - never matches.
A min/max value pair with additional methods. In addition to conveniently storing values...
Ostream & endl(Ostream &os)
Add newline and flush stream.
A simple wrapper around bool so that it can be read as a word: true/false, on/off, yes/no, any/none. Also accepts 0/1 as a string and shortcuts t/f, y/n.
static const scalarRange always
A range that always matches.
static bool parse(const std::string &str, scalarRange &range)
Construct by parsing string content.
static constexpr scalarRange ge(const scalar minVal) noexcept
A greater-equals bound.
An Ostream is an abstract base class for all output systems (streams, files, token lists...
OBJstream os(runTime.globalPath()/outputName)
Ostream & operator<<(Ostream &, const boundaryPatch &p)
Write boundaryPatch as dictionary entries (without surrounding braces)
messageStream Info
Information stream (stdout output on master, null elsewhere)
static constexpr scalarRange le(const scalar maxVal) noexcept
A less-equals bound.
static Switch find(const std::string &str)
Find switchType for the given string, returning as a Switch that can be tested for good() or bad()...
Scalar bounds to be used as a unary predicate.