Look for comments within entities
This commit is contained in:
1 parent
3bff65bc9b
commit
4ddce869b2
4 files changed
+12
-3
No files matched your search
@@ -177,7 +177,7 @@ STEPfile::ReadHeader( istream & in ) {
|
||||
//read the values from the istream
|
||||
objsev = obj->STEPread( fileid, 0, ( InstMgr * )0, in, NULL, true, _strict );
|
||||
if( !cmtStr.empty() ) {
|
||||
obj->AddP21Comment( cmtStr );
|
||||
obj->PrependP21Comment( cmtStr );
|
||||
}
|
||||
|
||||
in >> ws;
|
||||
|
||||
@@ -937,7 +937,9 @@ void ReadTokenSeparator( istream & in, std::string * comments ) {
|
||||
case '\\': // try to read a print control directive
|
||||
ReadPcd( in );
|
||||
break;
|
||||
|
||||
case '\n':
|
||||
in.ignore();
|
||||
break;
|
||||
default:
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -15,6 +15,7 @@
|
||||
#include <instmgr.h>
|
||||
#include <STEPcomplex.h>
|
||||
#include <STEPattribute.h>
|
||||
#include <read_func.h> //for ReadTokenSeparator, used when comments are inside entities
|
||||
|
||||
SDAI_Application_instance NilSTEPentity;
|
||||
|
||||
@@ -88,6 +89,10 @@ void SDAI_Application_instance::AddP21Comment( const std::string & s, bool repla
|
||||
p21Comment.append( s );
|
||||
}
|
||||
|
||||
void SDAI_Application_instance::PrependP21Comment( const std::string & s ) {
|
||||
p21Comment.insert(0,s);
|
||||
}
|
||||
|
||||
void SDAI_Application_instance::STEPwrite_reference( ostream & out ) {
|
||||
out << "#" << STEPfile_id;
|
||||
}
|
||||
@@ -444,7 +449,7 @@ Severity SDAI_Application_instance::STEPread( int id, int idIncr,
|
||||
" Missing initial open paren... Trying to recover.\n" );
|
||||
in.putback( c ); // assume you can recover by reading 1st attr value
|
||||
}
|
||||
in >> ws;
|
||||
ReadTokenSeparator(in, &p21Comment);
|
||||
|
||||
int n = attributes.list_length();
|
||||
if( n == 0 ) { // no attributes
|
||||
@@ -455,6 +460,7 @@ Severity SDAI_Application_instance::STEPread( int id, int idIncr,
|
||||
}
|
||||
|
||||
for( i = 0 ; i < n; i++ ) {
|
||||
ReadTokenSeparator(in, &p21Comment);
|
||||
if( attributes[i].aDesc->AttrType() == AttrType_Redefining ) {
|
||||
in >> ws;
|
||||
c = in.peek();
|
||||
|
||||
@@ -61,6 +61,7 @@ class SCL_CORE_EXPORT SDAI_Application_instance : public SDAI_DAObject_SDAI {
|
||||
|
||||
void AddP21Comment( const std::string & s, bool replace = true );
|
||||
void AddP21Comment( const char * s, bool replace = true );
|
||||
void PrependP21Comment( const std::string & s );
|
||||
void DeleteP21Comment() {
|
||||
p21Comment = "";
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user