X-Git-Url: http://git.salome-platform.org/gitweb/?a=blobdiff_plain;f=src%2Fruntime%2FTypeConversions.cxx;h=9f5b145d847c265487f92e52f4f39969d5c1057f;hb=1dafe295a30df6a58e960fc69afca58ca84f5df6;hp=bd24737a98159ac2bdcd4e3a765451898e7587f2;hpb=660812a3b41a91ac60cfe0859607f6035e776664;p=modules%2Fyacs.git diff --git a/src/runtime/TypeConversions.cxx b/src/runtime/TypeConversions.cxx index bd24737a9..9f5b145d8 100644 --- a/src/runtime/TypeConversions.cxx +++ b/src/runtime/TypeConversions.cxx @@ -35,6 +35,7 @@ #include "SALOME_GenericObj.hh" #include +#include #include #ifdef WIN32 @@ -256,6 +257,17 @@ namespace YACS if( t1->isA(t2->id()) ) return 1; } + else if(t1->kind() == Sequence) + { + const TypeCodeSeq *t1c(dynamic_cast(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; } }; @@ -1305,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; @@ -1423,7 +1446,7 @@ namespace YACS static inline std::string convert(const TypeCode *t,double o) { stringstream msg ; - msg << "" << o << "\n"; + msg << "" << setprecision(16) << o << "\n"; return msg.str(); } }; @@ -2267,7 +2290,7 @@ namespace YACS { PyObject *s; PyGILState_STATE gstate = PyGILState_Ensure(); - s=PyObject_Repr(ob); + s=PyObject_Str(ob); std::string ss(PyString_AsString(s),PyString_Size(s)); Py_DECREF(s); PyGILState_Release(gstate);