33 char Foam::ISstream::nextValid()
61 while (
get(c) && c !=
'\n')
70 if (
get(c) && c ==
'*')
111 void Foam::ISstream::readWordToken(token& t)
113 word* wPtr =
new word;
134 static const int maxLen = 128;
135 static char buf[maxLen];
149 char c = nextValid();
190 string* sPtr =
new string;
217 string* sPtr =
new string;
219 if (readVerbatim(*sPtr).
bad())
259 string* sPtr =
new string;
261 if (readVariable(*sPtr).
bad())
290 case '0' :
case '1' :
case '2' :
case '3' :
case '4' :
291 case '5' :
case '6' :
case '7' :
case '8' :
case '9' :
293 bool asLabel = (c !=
'.');
315 asLabel = isdigit(c);
322 buf[maxLen-1] =
'\0';
325 <<
"number '" << buf <<
"...'\n" 326 <<
" is too long (max. " << maxLen <<
" characters)" 344 if (nChar == 1 && buf[0] ==
'-')
412 static const int maxLen = 1024;
413 static const int errLen = 80;
414 static char buf[maxLen];
444 <<
"word '" << buf <<
"...'\n" 445 <<
" is too long (max. " << maxLen <<
" characters)" 455 buf[errLen] = buf[nChar] =
'\0';
458 <<
"problem while reading word '" << buf <<
"...' after " 459 << nChar <<
" characters\n" 468 <<
"invalid first character found : " << c
483 static const int maxLen = 1024;
484 static const int errLen = 80;
485 static char buf[maxLen];
492 <<
"cannot read start of string" 502 <<
"Incorrect start of string character found : " << c
509 bool escaped =
false;
537 buf[errLen] = buf[nChar] =
'\0';
540 <<
"found '\\n' while reading string \"" 562 <<
"string \"" << buf <<
"...\"\n" 563 <<
" is too long (max. " << maxLen <<
" characters)" 572 buf[errLen] = buf[nChar] =
'\0';
575 <<
"problem while reading string \"" << buf <<
"...\"" 585 static const int maxLen = 1024;
586 static const int errLen = 80;
587 static char buf[maxLen];
593 if (!
get(c) || c !=
'$')
596 <<
"invalid first character found : " << c
624 <<
"word '" << buf <<
"...'\n" 625 <<
" is too long (max. " << maxLen <<
" characters)" 660 <<
"word '" << buf <<
"...'\n" 661 <<
" is too long (max. " << maxLen <<
" characters)" 672 buf[errLen] = buf[nChar] =
'\0';
675 <<
"problem while reading string '" << buf <<
"...' after " 676 << nChar <<
" characters\n" 685 <<
"invalid first character found : " << c
705 static const int maxLen = 8000;
706 static const int errLen = 80;
707 static char buf[maxLen];
737 <<
"string \"" << buf <<
"...\"\n" 738 <<
" is too long (max. " << maxLen <<
" characters)" 747 buf[errLen] = buf[nChar] =
'\0';
750 <<
"problem while reading string \"" << buf <<
"...\"" 787 <<
"stream format not binary" 792 is_.read(buf, count);
void setState(ios_base::iostate state)
Set stream state.
virtual Istream & read(token &)
Return next token from stream.
bool bad() const
Return true if stream is corrupted.
float floatScalar
Float precision floating point scalar type.
An Istream is an abstract base class for all input systems (streams, files, token lists etc)...
A class for handling words, derived from string.
intWM_LABEL_SIZE_t label
A label is an int32_t or int64_t as specified by the pre-processor macro WM_LABEL_SIZE.
virtual ios_base::fmtflags flags() const
Return flags of output stream.
A class for handling character strings derived from std::string.
errorManipArg< error, int > exit(error &err, const int errNo=1)
virtual istream & stdStream()
Access to underlying std::istream.
bool getBack(token &)
Get the put back token if there is one and return true.
static bool isCompound(const word &name)
Return true if name is a compound type.
punctuationToken
Standard punctuation tokens.
static bool valid(char)
Is this character valid for a word.
bool readScalar(const char *buf, doubleScalar &s)
Read whole of buf as a scalar. Return true if succesful.
bool good() const
Return true if next operation might succeed.
streamFormat format() const
Return current stream format.
A token holds items read from Istream.
label lineNumber() const
Return current stream line number.
Istream & readBegin(const char *funcName)
const dimensionedScalar c
Speed of light in a vacuum.
bool read(const char *, int32_t &)
double doubleScalar
Double precision floating point scalar type.
static autoPtr< compound > New(const word &type, Istream &)
Select null constructed.
virtual Istream & rewind()
Rewind and return the stream so that it may be read again.
ISstream & putback(const char &)
Raw, low-level putback character function.
#define FatalIOErrorIn(functionName, ios)
Report an error message using Foam::FatalIOError.
Istream & readEnd(const char *funcName)