34 char Foam::ISstream::nextValid()
62 while (
get(c) && c !=
'\n')
71 if (
get(c) && c ==
'*')
112 void Foam::ISstream::readWordToken(token& t)
114 word* wPtr =
new word;
135 static const int maxLen = 128;
136 static char buf[maxLen];
150 char c = nextValid();
191 string* sPtr =
new string;
220 if (readVerbatim(*vsPtr).
bad())
269 if (readVariable(*vPtr).
bad())
291 case '0' :
case '1' :
case '2' :
case '3' :
case '4' :
292 case '5' :
case '6' :
case '7' :
case '8' :
case '9' :
294 bool asLabel = (c !=
'.');
316 asLabel = isdigit(c);
323 buf[maxLen-1] =
'\0';
326 <<
"number '" << buf <<
"...'\n" 327 <<
" is too long (max. " << maxLen <<
" characters)" 345 if (nChar == 1 && buf[0] ==
'-')
413 static const int maxLen = 1024;
414 static const int errLen = 80;
415 static char buf[maxLen];
445 <<
"word '" << buf <<
"...'\n" 446 <<
" 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 <<
"variable '" << buf <<
"...'\n" 624 <<
" is too long (max. " << maxLen <<
" characters)" 676 <<
"variable '" << buf <<
"...'\n" 677 <<
" is too long (max. " << maxLen <<
" characters)" 687 buf[errLen] = buf[nChar] =
'\0';
690 <<
"problem while reading string '" << buf <<
"...' after " 691 << nChar <<
" characters\n" 700 <<
"invalid first character found : " << c
720 static const int maxLen = 8000;
721 static const int errLen = 80;
722 static char buf[maxLen];
752 <<
"string \"" << buf <<
"...\"\n" 753 <<
" is too long (max. " << maxLen <<
" characters)" 762 buf[errLen] = buf[nChar] =
'\0';
765 <<
"problem while reading string \"" << buf <<
"...\"" 778 while (s.back() ==
'\\')
781 getline(is_, contLine);
823 if (
bad() || listDepth != 0)
826 <<
" problem while reading delimited string \n" 827 << str.c_str() <<
endl 884 <<
"stream format not binary" 889 is_.read(buf, count);
A class for handling verbatimStrings, derived from string.
Istream & readBegin(const char *funcName)
static bool valid(char)
Is this character valid for a variable.
static bool valid(char)
Is this character valid for a word.
Istream & readList(string &)
Read a '(...)' delimited set of characters into a 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.
errorManipArg< error, int > exit(error &err, const int errNo=1)
bool bad() const
Return true if stream is corrupted.
An Istream is an abstract base class for all input systems (streams, files, token lists etc)...
A token holds items read from Istream.
Ostream & endl(Ostream &os)
Add newline and flush stream.
label lineNumber() const
Return current stream line number.
virtual Istream & read(token &)
Return next token from stream.
const dimensionedScalar & c
Speed of light in a vacuum.
bool good() const
Return true if next operation might succeed.
virtual ios_base::fmtflags flags() const
Return flags of output 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 &)
gmvFile<< "tracers "<< particles.size()<< nl;forAllConstIter(Cloud< passiveParticle >, particles, iter){ gmvFile<< iter().position().x()<< " ";}gmvFile<< nl;forAllConstIter(Cloud< passiveParticle >, particles, iter){ gmvFile<< iter().position().y()<< " ";}gmvFile<< nl;forAllConstIter(Cloud< passiveParticle >, particles, iter){ gmvFile<< iter().position().z()<< " ";}gmvFile<< nl;forAll(lagrangianScalarNames, i){ word name=lagrangianScalarNames[i];IOField< scalar > s(IOobject(name, runTime.timeName(), cloud::prefix, mesh, IOobject::MUST_READ, IOobject::NO_WRITE))
A functionName is a word starting with '#'.
A class for handling words, derived from string.
float floatScalar
Float precision floating point scalar type.
punctuationToken
Standard punctuation tokens.
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 successful.
streamFormat format() const
Return current stream format.
Istream & readBlock(string &)
Read a '{...}' delimited set of characters into a string.
virtual istream & stdStream()
Access to underlying std::istream.
static bool isCompound(const word &name)
Return true if name is a compound type.
long double longDoubleScalar
Lang double precision floating point scalar type.
ISstream & putback(const char &)
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.
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.
A variable is a word with support for additional characters, in particular '$' and '/'...
ISstream & getLine(string &)
Read line into a string.