-// Copyright (C) 2006-2019 CEA/DEN, EDF R&D
+// Copyright (C) 2006-2021 CEA/DEN, EDF R&D
//
// This library is free software; you can redistribute it and/or
// modify it under the terms of the GNU Lesser General Public
{
namespace ENGINE
{
- void printbin(const std::string& bin)
- {
- register char c;
- for(int i=0;i<bin.length();i++)
- {
- c=bin[i];
- if (c < ' ' || c >= 0x7f)
- {
- fprintf(stderr,"\\x%02x",c & 0xff);
- }
- else
- fprintf(stderr,"%c",c);
- }
- fprintf(stderr,"\n");
- }
-
std::string getImplName(ImplType impl)
{
switch(impl)
{
static inline std::string convert(const TypeCode *t,YACS::ENGINE::Any* o,void*,int protocol)
{
- if(o->getType()->kind()==String)
+ if(o->getType()->kind()==String || o->getType()->kind()==Objref)
return o->getStringValue();
stringstream msg;
msg << "Problem in conversion: a objref(string) is expected " ;
{
//Check if objref is a GenericObj and register it if it is the case (workaround for bad management of GenericObj)
if(o=="" || (t->isA(Runtime::_tc_file)) || (strncmp(t->id(),"python",6)==0) || (strncmp(t->id(),"json",4)==0))
- return YACS::ENGINE::AtomAny::New(o);
+ return YACS::ENGINE::AtomAny::New(o, const_cast<TypeCode *>(t));
//Objref CORBA. prefix=IOR,corbaname,corbaloc
CORBA::Object_var obref;
else
DEBTRACE("It's a CORBA::Object but not a SALOME::GenericObj");
- return YACS::ENGINE::AtomAny::New(o);
+ return YACS::ENGINE::AtomAny::New(o, const_cast<TypeCode *>(t));
}
};