34 char Foam::ISstream::nextValid()
62 while (
get(c) && c !=
'\n')
70 if (
get(c) && c ==
'*')
72 if (
get(c) && c ==
'/')
104 static char numberBuffer[100];
118 char c = nextValid();
158 string* sPtr =
new string;
160 if (!read(*sPtr).bad())
175 case '0' :
case '1' :
case '2' :
case '3' :
case '4' :
176 case '5' :
case '6' :
case '7' :
case '8' :
case '9' :
186 numberBuffer[i++] = c;
201 numberBuffer[i++] = c;
208 numberBuffer[i] =
'\0';
210 setState(is_.rdstate());
216 if (i == 1 && numberBuffer[0] ==
'-')
222 t = scalar(atof(numberBuffer));
226 long lt = atol(numberBuffer);
234 t = scalar(atof(numberBuffer));
252 if (!read(*wPtr).bad())
284 static const int maxLen = 1024;
285 static const int errLen = 80;
286 static char buf[maxLen];
302 buf[maxLen-1] =
'\0';
307 <<
"problem while reading word '" << buf <<
"'\n"
315 buf[maxLen-1] =
'\0';
319 <<
"word '" << buf <<
"' ...\n"
320 <<
" is too long (max. " << maxLen <<
" characters)"
346 <<
"invalid first character found : " << c
360 static const int maxLen = 1024;
361 static const int errLen = 80;
362 static char buf[maxLen];
371 <<
"cannot read start of string"
385 <<
"Incorrect start of string character"
392 bool escaped =
false;
424 <<
"found '\\n' while reading string \""
443 buf[maxLen-1] =
'\0';
447 <<
"string \"" << buf <<
"...\"\n"
448 <<
" is too long (max. " << maxLen <<
" characters)"
461 <<
"problem while reading string \"" << buf <<
"...\""
471 setState(is_.rdstate());
479 setState(is_.rdstate());
487 setState(is_.rdstate());
498 <<
"stream format not binary"
502 readBegin(
"binaryBlock");
503 is_.read(buf, count);
504 readEnd(
"binaryBlock");
506 setState(is_.rdstate());
514 stream().rdbuf()->pubseekpos(0);