Fix serialization of simple type attributes

This commit is contained in:
Thomas Krijnen
2014-06-07 11:47:26 +02:00
parent e4f141b107
commit 68e60f0586
2 changed files with 7 additions and 3 deletions
+3 -1
View File
@@ -891,7 +891,9 @@ std::ostream& operator<< (std::ostream& os, const IfcParse::IfcFile& f) {
for ( MapEntityById::const_iterator it = f.begin(); it != f.end(); ++ it ) {
const IfcEntity e = it->second;
os << e->entity->toString(true) << ";" << std::endl;
if (!IfcSchema::Type::IsSimple(e->type())) {
os << e->entity->toString(true) << ";" << std::endl;
}
}
os << "ENDSEC;" << std::endl;
+4 -2
View File
@@ -84,8 +84,10 @@ std::string IfcWritableEntity::toString(bool upper) {
if ( upper ) {
for (std::string::iterator p = dt.begin(); p != dt.end(); ++p ) *p = toupper(*p);
}
if ( _id ) ss << "#" << *_id;
ss << "=" << dt << "(";
if ( _id && !IfcSchema::Type::IsSimple(_type) ) {
ss << "#" << *_id << "=";
}
ss << dt << "(";
for ( std::map<int,ArgumentPtr>::const_iterator it = args.begin(); it != args.end(); ++ it ) {
if ( it != args.begin() ) ss << ",";
const ArgumentPtr a = it->second;