Go to the documentation of this file.
46 std::transform(inStr.begin(), inStr.end(), oStr.begin(), ::toupper);
54 oStr[0] = std::toupper(oStr[0]);
78 if (s ==
"NO" || s ==
"N" ||
"FALSE" || s ==
"OFF" || s ==
"F")
89 ss <<
std::fixed << std::setprecision(numPrecision) << v;
103 ss << std::setprecision(numPrecision) << v;
112 std::stringstream ss;
121 auto dec = str.find(
'.');
122 if (
dec == word::npos)
125 auto len = str.size();
126 if (len == word::npos)
129 auto firstZero = word::npos;
130 for (
auto n = len - 1;
n >
dec;
n--)
142 if (firstZero ==
dec + 1)
145 return str.substr(0, firstZero);
158 return w1 +
"<" + w2 +
">";
164 return base +
"<" + w1 +
"," + w2 +
">";
175 return base +
"<" + w1 +
"," + w2 +
"," + w3 +
">";
181 return bw + sep + tw;
187 if (
auto pos = w.find_last_of(sep); pos != word::npos)
189 return w.substr(0, pos);
200 if (
auto pos = w.find_last_of(sep); pos != word::npos)
202 return w.substr(pos + 1);
214 !isspace(c) && c !=
'"'
227 !isspace(c) && c !=
';'
349 catch (std::out_of_range& e)
351 val =
static_cast<real>(std::stold(w));
365 val = std::strtod(buf, &c);
368 val =
static_cast<real>(std::strtold(buf, &c));
369 if (val == HUGE_VAL || c == buf)
383 if (
bool t =
isYes(w); t)
388 if (
bool f =
isNo(w); f)
word tailName(const word &w, char sep='.')
Find tail name in a group separated by "." and return it.
word angleBracketsNames3(const word &base, const word &w1, const word &w2, const word &w3)
Output base<w1,sw2,w3>
const real verySmallValue
auto count(const Vector< T, Allocator > &vec, const T &val)
IOstream & fixed(IOstream &io)
IOstream & dec(IOstream &io)
word real2Fixed(const real &v, int32 numPrecision=6)
Convert floating point variable to string with fixed number of precisions.
bool readInt32(const word &w, int32 &val)
Convert word to int32.
word real2FixedStripZeros(const real &v, int32 numPrecision=6)
Convert to fixed point variable and remove zeros.
bool validWordWithQuote(char c)
Is c a valid character including quote?
bool readUint32(const word &w, uint32 &val)
Convert word to uint32.
bool readBoolian_Str(const word &w, bool &val)
Convert word to bool.
bool readReal(const word &w, real &val)
Convert word to real.
word toUpper(const word &inStr)
convert a word to all caps
bool validWord(char c)
Is the character valid for a word name?
const word nullWord
null/empty word
bool readInt64(const word &w, int64 &val)
Convert word to int64.
word baseName(const word &w, char sep='.')
Find the base in a group separated by "." and return it.
word angleBracketsNames2(const word &base, const word &w1, const word &w2)
Output base<w1,w2>
INLINE_FUNCTION_HD T length(const triple< T > &v1)
word angleBracketsNames(const word &w1, const word &w2)
Output <w1,w2>
bool isNo(const word &str)
Check if str equals "No", "N", "False", or "Off".
Vector< T, Allocator > abs(const Vector< T, Allocator > &v)
word removeDecimalZeros(const word &str)
Remove zeros from decimal part of a string number.
bool readInt8(const word &w, int8 &val)
Convert word to int8.
word real2Word(const real &v, int32 numPrecision=6)
Convert floating point variable to string with general format.
word groupNames(const word &bw, const word &tw, char sep='.')
Group words and output bw.tw.
word firstCapital(const word &inStr)
word int322Word(const int32 &v)
Convert int32 to word.
bool isYes(const word &str)
Check if str equals "Yes", "Y", "True", "Ok", "ON", or "T".
int32 countChar(const word &s, const char c)
Count numer of chars c in a word.