40 char *endptr =
nullptr;
42 const intmax_t parsed = ::strtoimax(buf, &endptr, 10);
44 const int64_t val = int64_t(parsed);
48 (parsed < INT64_MIN || parsed > INT64_MAX)
49 ? parsing::errorType::RANGE
53 if (err != parsing::errorType::NONE)
66 char *endptr =
nullptr;
68 const intmax_t parsed = ::strtoimax(buf, &endptr, 10);
70 val = int64_t(parsed);
74 (parsed < INT64_MIN || parsed > INT64_MAX)
97 <<
"Bad token - could not get int64" 107 if (t.isPunctuation())
110 if (prefix == token::PLUS || prefix == token::MINUS)
120 (prefix == token::MINUS)
121 ? (0 - t.labelToken())
125 else if (t.isScalar())
129 (prefix == token::MINUS)
130 ? (0 - t.scalarToken())
134 const intmax_t parsed = intmax_t(std::round(sval));
135 val = 0 + int64_t(parsed);
140 if (parsed < INT64_MIN || parsed > INT64_MAX)
143 <<
"Expected integral (int64), value out-of-range " 149 else if (1
e-4 < std::abs(sval - scalar(parsed)))
152 <<
"Expected integral (int64), found non-integral value " 162 <<
"Wrong token type - expected label (int64), found ";
163 if (prefix == token::PLUS || prefix == token::MINUS)
179 os.write(label(val));
185 #if defined(__APPLE__) 188 return operator>>(is, reinterpret_cast<int64_t&>(val));
193 return (
os << int64_t(val));
errorManipArg< error, int > exit(error &err, const int errNo=1)
An Istream is an abstract base class for all input systems (streams, files, token lists etc)...
Useful combination of include files which define Sin, Sout and Serr and the use of IO streams general...
int64_t readInt64(Istream &is)
Read int64_t from stream.
errorType checkConversion(const char *buf, char *endptr)
Sanity check after strtof, strtod, etc.
const dimensionedScalar e
Elementary charge.
Istream & operator>>(Istream &, directionInfo &)
errorType
Enumeration for possible parsing error.
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)
#define FatalIOErrorInFunction(ios)
Report an error message using Foam::FatalIOError.
const Foam::Enum< errorType > errorNames
Strings corresponding to the errorType.
IOerror FatalIOError
Error stream (stdout output on all processes), with additional 'FOAM FATAL IO ERROR' header text and ...