diff options
Diffstat (limited to 'python/modules/IcePy/Communicator.cpp')
-rw-r--r-- | python/modules/IcePy/Communicator.cpp | 49 |
1 files changed, 49 insertions, 0 deletions
diff --git a/python/modules/IcePy/Communicator.cpp b/python/modules/IcePy/Communicator.cpp index 919086d9ae8..550b0fef0ff 100644 --- a/python/modules/IcePy/Communicator.cpp +++ b/python/modules/IcePy/Communicator.cpp @@ -1715,3 +1715,52 @@ IcePy::getCommunicatorWrapper(const Ice::CommunicatorPtr& communicator) Py_INCREF(obj->wrapper); return obj->wrapper; } + +extern "C" +PyObject* +IcePy_identityToString(PyObject* /*self*/, PyObject* obj) +{ + Ice::Identity id; + if(!getIdentity(obj, id)) + { + return 0; + } + + string str; + + try + { + str = Ice::identityToString(id); + } + catch(const Ice::Exception& ex) + { + setPythonException(ex); + return 0; + } + + return createString(str); +} + +extern "C" +PyObject* +IcePy_stringToIdentity(PyObject* /*self*/, PyObject* obj) +{ + string str; + if(!getStringArg(obj, "str", str)) + { + return 0; + } + + Ice::Identity id; + try + { + id = Ice::stringToIdentity(str); + } + catch(const Ice::Exception& ex) + { + setPythonException(ex); + return 0; + } + + return createIdentity(id); +} |