39 const std::string& str,
51 const auto trimPoints = stringOps::findTrim(str,
pos, len);
53 pos = trimPoints.first;
54 len = (trimPoints.second - trimPoints.first);
67 result = std::move(driver.
result());
73 <<
"Failed evaluation: "
74 << str.substr(
pos, len) <<
nl;
80 if (result.
size() <= 1)
95 const std::string& str,
100 return stringOps::evaluate(1, str,
pos, len);
Input/output from string buffers.
Output to string buffer, using a OSstream. Always UNCOMPRESSED.
const exprResult & result() const noexcept
Const access to expression result.
A polymorphic field/result from evaluating an expression.
label size() const
The field or object size.
void writeValue(Ostream &os) const
Write the single value, or the first value from field.
bool hasValue() const
Has a value?
void writeField(Ostream &os, const word &keyword="") const
Write the field, optionally as an entry.
Driver for generic primitive field expressions.
virtual unsigned parse(const std::string &expr, size_t pos=0, size_t len=std::string::npos)
Execute the parser.
A class for handling character strings derived from std::string.
OBJstream os(runTime.globalPath()/outputName)
string evaluate(label fieldWidth, const std::string &s, size_t pos=0, size_t len=std::string::npos)
String evaluation with specified (positive, non-zero) field width.
dimensionedScalar pos(const dimensionedScalar &ds)
messageStream InfoErr
Information stream (stderr output on master, null elsewhere)
constexpr char nl
The newline '\n' character (0x0a)
String expression evaluation.