Go to the documentation of this file.
39 char *endptr =
nullptr;
41 const intmax_t parsed = ::strtoimax(buf, &endptr, 10);
43 const int32_t
val = int32_t(parsed);
47 (parsed < INT32_MIN || parsed > INT32_MAX)
48 ? parsing::errorType::RANGE
52 if (err != parsing::errorType::NONE)
65 char *endptr =
nullptr;
67 const intmax_t parsed = ::strtoimax(buf, &endptr, 10);
69 val = int32_t(parsed);
73 (parsed < INT32_MIN || parsed > INT32_MAX)
87 <<
"Bad token - could not get int32"
100 <<
"Wrong token type - expected label (int32), found "
129 #if (__SIZEOF_LONG__ == 4)
137 return (os << int32_t(
val));
label labelToken() const
Return label value.
label ListType::const_reference val
Useful combination of include files which define Sin, Sout and Serr and the use of IO streams general...
errorType checkConversion(const char *buf, char *endptr)
Sanity check after strtof, strtod, etc.
Istream & operator>>(Istream &, directionInfo &)
A token holds an item read from Istream.
bool good() const
True if token is not UNDEFINED or ERROR.
bool isLabel() const
Token is LABEL.
intWM_LABEL_SIZE_t label
A label is an int32_t or int64_t as specified by the pre-processor macro WM_LABEL_SIZE.
InfoProxy< token > info() const
Return info proxy for printing token information to a stream.
An Istream is an abstract base class for all input systems (streams, files, token lists etc)....
const Foam::Enum< errorType > errorNames
Strings corresponding to the errorType.
errorType
Enumeration for possible parsing error.
virtual bool check(const char *operation) const
Check IOstream status for given operation.
int32_t readInt32(Istream &is)
Read int32_t from stream.
virtual bool write(const token &tok)=0
Write token to stream or otherwise handle it.
errorManipArg< error, int > exit(error &err, const int errNo=1)
void setBad()
Set stream to be bad.
#define FatalIOErrorInFunction(ios)
Report an error message using Foam::FatalIOError.
An Ostream is an abstract base class for all output systems (streams, files, token lists,...
Ostream & operator<<(Ostream &, const boundaryPatch &)