use peek() and ignore() instead of get() and putback()

This commit is contained in:
Mark Pictor
2011-11-14 20:33:13 -05:00
parent 6b95067732
commit 6871bc4eca
+3 -5
View File
@@ -194,7 +194,6 @@ Severity STEPattribute::StrToVal( const char * s, InstMgr * instances, int addFi
******************************************************************/
Severity STEPattribute::STEPread( istream & in, InstMgr * instances, int addFileId,
const char * currSch ) {
char c = '\0';
// The attribute has been redefined by the attribute pointed
// to by _redefAttr so write the redefined value.
@@ -208,8 +207,7 @@ Severity STEPattribute::STEPread( istream & in, InstMgr * instances, int addFile
set_null();
in >> ws; // skip whitespace
in >> c;
in.putback( c ); // leave input stream alone
char c = in.peek();
if( IsDerived() ) {
if( c == '*' ) {
@@ -226,6 +224,7 @@ Severity STEPattribute::STEPread( istream & in, InstMgr * instances, int addFile
CheckRemainingInput( in, &_error, aDesc->TypeName(), ",)" );
return _error.severity();
}
PrimitiveType attrBaseType = NonRefType();
// check for NULL or derived attribute value, return if either
switch( c ) {
@@ -233,7 +232,7 @@ Severity STEPattribute::STEPread( istream & in, InstMgr * instances, int addFile
case ',':
case ')':
if( c == '$' ) {
in.get( c );
in.ignore();
CheckRemainingInput( in, &_error, aDesc->TypeName(), ",)" );
}
if( Nullable() ) {
@@ -245,7 +244,6 @@ Severity STEPattribute::STEPread( istream & in, InstMgr * instances, int addFile
return _error.severity();
}
PrimitiveType attrBaseType = NonRefType();
switch( attrBaseType ) {
case INTEGER_TYPE: {
ReadInteger( *( ptr.i ), in, &_error, ",)" );