@@ -353,7 +353,7 @@ TokenArgument::TokenArgument(const Token& t) {
353353}
354354
355355EntityArgument::EntityArgument (Ifc2x3::Type::Enum ty, const Token& t) {
356- entity = new IfcUtil::IfcArgumentSelect (ty, new TokenArgument (t ));
356+ entity = new Ifc::IfcUntypedEntity ( new Entity ( 0 ,t. first -> file ,t. second ));
357357}
358358
359359//
@@ -371,7 +371,7 @@ ArgumentList::ArgumentList(Tokens* t, std::vector<unsigned int>& ids) {
371371 if ( TokenFunc::isDatatype (next) ) {
372372 t->Next ();
373373 try {
374- Push ( new EntityArgument (Ifc2x3::Type::FromString (TokenFunc::asString (next)),t->Next ()) );
374+ Push ( new EntityArgument (Ifc2x3::Type::ALL,next) ); // Ifc2x3::Type:: FromString(TokenFunc::asString(next)),t->Next()) );
375375 } catch ( IfcException& e ) {
376376 Logger::Message (Logger::LOG_ERROR,e.what ());
377377 }
@@ -493,22 +493,7 @@ EntityArgument::operator IfcEntities() const { throw IfcException("Argument is n
493493unsigned int EntityArgument::Size () const { return 1 ; }
494494ArgumentPtr EntityArgument::operator [] (unsigned int i) const { throw IfcException (" Argument is not a list of arguments" ); }
495495std::string EntityArgument::toString (bool upper) const {
496- ArgumentPtr arg = entity->wrappedValue ();
497- IfcParse::TokenArgument* token_arg = dynamic_cast <IfcParse::TokenArgument*>(arg);
498- const bool is_string = TokenFunc::isString (token_arg->token );
499- std::string token_string = token_arg ? (is_string
500- ? TokenFunc::asString (token_arg->token )
501- : TokenFunc::toString (token_arg->token ))
502- : std::string ();
503- std::string dt = Ifc2x3::Type::ToString (entity->type ());
504- if ( upper ) {
505- for (std::string::iterator p = dt.begin (); p != dt.end (); ++p ) *p = toupper (*p);
506- if (is_string) token_string = IfcWrite::IfcCharacterEncoder (token_string);
507- } else {
508- token_string.insert (token_string.begin (),' \' ' );
509- token_string.push_back (' \' ' );
510- }
511- return dt + " (" + token_string + " )" ;
496+ return entity->entity ->toString (upper);
512497}
513498// return entity->entity->toString(); }
514499bool EntityArgument::isNull () const { return false ; }
@@ -599,7 +584,10 @@ std::string Entity::toString(bool upper) {
599584 if ( upper ) {
600585 for (std::string::iterator p = dt.begin (); p != dt.end (); ++p ) *p = toupper (*p);
601586 }
602- ss << " #" << _id << " =" << dt << args->toString (upper);
587+ if (_id) {
588+ ss << " #" << _id << " =" ;
589+ }
590+ ss << dt << args->toString (upper);
603591 return ss.str ();
604592}
605593
0 commit comments