Salome HOME
Manage correctly DISBLED state for ElementaryNode.
[modules/yacs.git] / src / runtime / TypeConversions.cxx
index 93bac7e68b7b288f2fd5d64fb6ccea877d027bcf..9f5b145d847c265487f92e52f4f39969d5c1057f 100644 (file)
@@ -257,6 +257,17 @@ namespace YACS
                 if( t1->isA(t2->id()) )
                   return 1;
               }
+            else if(t1->kind() == Sequence)
+              {
+                const TypeCodeSeq *t1c(dynamic_cast<const TypeCodeSeq *>(t1));
+                if(!t1c)
+                  return 0;
+                const TypeCode *t1cc(t1c->contentType());
+                if(t1cc==t2)
+                  return 1;
+                if(t1cc->kind() == Objref && std::string(t1cc->id())==std::string(t2->id()))
+                  return 1;
+              }
             return 0;
           }
       };
@@ -1306,6 +1317,17 @@ namespace YACS
                     }
                   return mystr;
                 }
+              else if ((!xmlStrcmp(cur->name, (const xmlChar *)"string")))// <- here case where pyobj value has been stored in XML. pyobj has kind==ObjRef. And the stored format is String ! EDF11027
+                {
+                  //wait a string, got a string
+                  xmlChar * s = NULL;
+                  s = xmlNodeListGetString(doc, cur->xmlChildrenNode, 1);
+                  if(s==0)return "";
+                  DEBTRACE( "convertToYacsString " << (const char *)s );
+                  std::string mystr=std::string((const char *)s);
+                  xmlFree(s);
+                  return mystr;
+                }
               cur = cur->next;
             }
           stringstream msg;