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;
116 if (
read(*wPtr).bad())
147 char c = nextValid();
187 string* sPtr =
new string;
189 if (
read(*sPtr).bad())
206 if (
read(nextC).bad())
217 if (readVerbatim(*vsPtr).bad())
236 if (
read(*fnPtr).bad())
253 if (
read(nextC).bad())
266 if (readVariable(*vPtr).bad())
288 case '0' :
case '1' :
case '2' :
case '3' :
case '4' :
289 case '5' :
case '6' :
case '7' :
case '8' :
case '9' :
291 bool asLabel = (
c !=
'.');
313 asLabel = isdigit(
c);
321 setState(is_.rdstate());
330 if (buf_.size() == 2 && buf_[0] ==
'-')
339 #if WM_LABEL_SIZE == 32
340 int64_t int64Val = 0;
341 uint64_t uint64Val = 0;
352 #if WM_LABEL_SIZE == 32
438 buf_.data()[bufErrorLength] = buf_.last() =
'\0';
441 <<
"problem while reading word '" << buf_.cdata() <<
"...' after "
442 << buf_.size() <<
" characters\n"
451 <<
"invalid first character found : " <<
c
473 <<
"cannot read start of string"
483 <<
"Incorrect start of string character found : " <<
c
489 bool escaped =
false;
518 buf_.data()[bufErrorLength] = buf_.last() =
'\0';
521 <<
"found '\\n' while reading string \""
522 << buf_.cdata() <<
"...\""
541 buf_.data()[bufErrorLength] = buf_.last() =
'\0';
544 <<
"problem while reading string \"" << buf_.cdata() <<
"...\""
557 if (!get(
c) ||
c !=
'$')
560 <<
"invalid first character found : " <<
c
634 buf_.data()[bufErrorLength] = buf_.last() =
'\0';
637 <<
"problem while reading string '" << buf_.cdata() <<
"...' after "
638 << buf_.size() <<
" characters\n"
647 <<
"invalid first character found : " <<
c
665 Foam::Istream& Foam::ISstream::readVerbatim(verbatimString& str)
693 buf_.data()[bufErrorLength] = buf_.last() =
'\0';
696 <<
"problem while reading string \"" << buf_.cdata() <<
"...\""
706 setState(is_.rdstate());
709 if (continuation &&
s.size())
711 while (
s.back() ==
'\\')
714 getline(is_, contLine);
715 setState(is_.rdstate());
757 if (bad() || listDepth != 0)
760 <<
" problem while reading delimited string \n"
761 << str.c_str() <<
endl
784 setState(is_.rdstate());
792 setState(is_.rdstate());
800 setState(is_.rdstate());
808 setState(is_.rdstate());
816 setState(is_.rdstate());
824 setState(is_.rdstate());
832 setState(is_.rdstate());
842 <<
"stream format not binary"
846 readBegin(
"binaryBlock");
847 is_.read(buf,
count);
848 readEnd(
"binaryBlock");
850 setState(is_.rdstate());
858 stdStream().rdbuf()->pubseekpos(0);
bool bad() const
Return true if stream is corrupted.
bool good() const
Return true if next operation might succeed.
virtual Istream & rewind()
Rewind and return the stream so that it may be read again.
ISstream & get(char &)
Low-level get character function.
virtual Istream & read(token &)
Return next token from stream.
Istream & readList(string &)
Read a '(...)' delimited set of characters into a string.
ISstream & getLine(string &, const bool continuation=true)
Read line into a string.
Istream & readBlock(string &)
Read a '{...}' delimited set of characters into a string.
ISstream & putback(const char &)
Low-level putback character function.
virtual ios_base::fmtflags flags() const
Return flags of output stream.
An Istream is an abstract base class for all input systems (streams, files, token lists etc)....
bool getBack(token &)
Get the put back token if there is one and return true.
A functionName is a word starting with '#'.
A class for handling character strings derived from std::string.
bool remove(const char)
Remove all occurrences of character returning true if string changed.
static autoPtr< compound > New(const word &type, Istream &)
Select null constructed.
static bool isCompound(const word &name)
Return true if name is a compound type.
A token holds items read from Istream.
punctuationToken
Standard punctuation tokens.
A variable is a word with support for additional characters, in particular '$' and '/'.
static bool valid(char)
Is this character valid for a variable.
A class for handling verbatimStrings, derived from string.
A class for handling words, derived from string.
static bool valid(char)
Is this character valid for a word.
#define FatalIOErrorInFunction(ios)
Report an error message using Foam::FatalIOError.
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.name(), cloud::prefix, mesh, IOobject::MUST_READ, IOobject::NO_WRITE))
const dimensionedScalar c
Speed of light in a vacuum.
errorManipArg< error, int > exit(error &err, const int errNo=1)
bool read(const char *, int32_t &)
intWM_LABEL_SIZE_t label
A label is an int32_t or int64_t as specified by the pre-processor macro WM_LABEL_SIZE.
Ostream & endl(Ostream &os)
Add newline and flush stream.
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.
float floatScalar
Float precision floating point scalar type.
uintWM_LABEL_SIZE_t uLabel
A uLabel is an uint32_t or uint64_t as specified by the pre-processor macro WM_LABEL_SIZE.
label count(const ListType &l, typename ListType::const_reference x)
Count the number of occurrences of a value in a list.
long double longDoubleScalar
Lang double precision floating point scalar type.
word format(conversionProperties.lookup("format"))