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 <<
"...\"" 584 static const int maxLen = 1024;
585 static const int errLen = 80;
586 static char buf[maxLen];
592 if (!
get(c) || c !=
'$')
595 <<
"invalid first character found : " << c
623 <<
"word '" << buf <<
"...'\n" 624 <<
" is too long (max. " << maxLen <<
" characters)" 659 <<
"word '" << buf <<
"...'\n" 660 <<
" is too long (max. " << maxLen <<
" characters)" 671 buf[errLen] = buf[nChar] =
'\0';
674 <<
"problem while reading string '" << buf <<
"...' after " 675 << nChar <<
" characters\n" 684 <<
"invalid first character found : " << c
704 static const int maxLen = 8000;
705 static const int errLen = 80;
706 static char buf[maxLen];
736 <<
"string \"" << buf <<
"...\"\n" 737 <<
" is too long (max. " << maxLen <<
" characters)" 746 buf[errLen] = buf[nChar] =
'\0';
749 <<
"problem while reading string \"" << buf <<
"...\"" 786 <<
"stream format not binary" 791 is_.read(buf, count);
Istream & readBegin(const char *funcName)
virtual ios_base::fmtflags flags() const
Return flags of output stream.
static bool valid(char)
Is this character valid for a word.
streamFormat format() const
Return current stream format.
intWM_LABEL_SIZE_t label
A label is an int32_t or int64_t as specified by the pre-processor macro WM_LABEL_SIZE.
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)...
A token holds items read from Istream.
bool good() const
Return true if next operation might succeed.
virtual Istream & read(token &)
Return next token from stream.
virtual Istream & rewind()
Rewind and return the stream so that it may be read again.
Istream & readEnd(const char *funcName)
bool read(const char *, int32_t &)
A class for handling words, derived from string.
float floatScalar
Float precision floating point scalar type.
double doubleScalar
Double precision floating point scalar type.
bool readScalar(const char *buf, doubleScalar &s)
Read whole of buf as a scalar. Return true if succesful.
virtual istream & stdStream()
Access to underlying std::istream.
static bool isCompound(const word &name)
Return true if name is a compound type.
bool bad() const
Return true if stream is corrupted.
ISstream & putback(const char &)
Raw, low-level putback character function.
#define FatalIOErrorInFunction(ios)
Report an error message using Foam::FatalIOError.
bool getBack(token &)
Get the put back token if there is one and return true.
label lineNumber() const
Return current stream line number.
const dimensionedScalar c
Speed of light in a vacuum.
punctuationToken
Standard punctuation tokens.
void setState(ios_base::iostate state)
Set stream state.
A class for handling character strings derived from std::string.
static autoPtr< compound > New(const word &type, Istream &)
Select null constructed.