Go to the documentation of this file.
39 char *endptr =
nullptr;
41 const uintmax_t parsed = ::strtoumax(buf, &endptr, 10);
43 const uint32_t val = uint32_t(parsed);
48 ? parsing::errorType::RANGE
52 if (err != parsing::errorType::NONE)
65 char *endptr =
nullptr;
67 const uintmax_t parsed = ::strtoumax(buf, &endptr, 10);
69 val = uint32_t(parsed);
96 <<
"Bad token - could not get uint32"
104 val = uint32_t(t.labelToken());
106 else if (t.isScalar())
108 const scalar sval(t.scalarToken());
109 const uintmax_t parsed = uintmax_t(std::round(sval));
110 val = 0 + uint32_t(parsed);
115 if ((sval < -1
e-4) || parsed > UINT32_MAX)
118 <<
"Expected label (uint32), value out-of-range "
124 else if (1
e-4 < std::abs(sval - scalar(parsed)))
127 <<
"Expected label (uint32), found non-integral value "
137 <<
"Wrong token type - expected label (uint32), found "
151 os.write(label(val));
Useful combination of include files which define Sin, Sout and Serr and the use of IO streams general...
bool isLabel() const noexcept
errorType checkConversion(const char *buf, char *endptr)
Istream & operator>>(Istream &, directionInfo &)
uint32_t readUint32(Istream &is)
A token holds an item read from Istream.
Ostream & operator<<(Ostream &, const boundaryPatch &p)
InfoProxy< token > info() const
An Istream is an abstract base class for all input systems (streams, files, token lists etc)....
const Foam::Enum< errorType > errorNames
virtual bool check(const char *operation) const
OBJstream os(runTime.globalPath()/outputName)
bool isScalar() const noexcept
errorManipArg< error, int > exit(error &err, const int errNo=1)
bool good() const noexcept
scalar scalarToken() const
const dimensionedScalar e
#define FatalIOErrorInFunction(ios)
An Ostream is an abstract base class for all output systems (streams, files, token lists,...