diff options
author | Jose <jose@zeroc.com> | 2016-03-01 15:12:26 +0100 |
---|---|---|
committer | Jose <jose@zeroc.com> | 2016-03-01 15:12:26 +0100 |
commit | 1419f188bf7d06ba0131cfd94a82f5d43ec0c7dd (patch) | |
tree | 38929143a6575d23e4438e590a20f525a829e194 /ruby/src/IceRuby/Communicator.cpp | |
parent | Fix LMDB nuget package version (diff) | |
parent | Ice::identityToString/Ice::stringToIdentity php/ruby/python implementations (diff) | |
download | ice-1419f188bf7d06ba0131cfd94a82f5d43ec0c7dd.tar.bz2 ice-1419f188bf7d06ba0131cfd94a82f5d43ec0c7dd.tar.xz ice-1419f188bf7d06ba0131cfd94a82f5d43ec0c7dd.zip |
Merge remote-tracking branch 'origin/3.6'
Diffstat (limited to 'ruby/src/IceRuby/Communicator.cpp')
-rw-r--r-- | ruby/src/IceRuby/Communicator.cpp | 30 |
1 files changed, 30 insertions, 0 deletions
diff --git a/ruby/src/IceRuby/Communicator.cpp b/ruby/src/IceRuby/Communicator.cpp index f67f490a560..7d004229160 100644 --- a/ruby/src/IceRuby/Communicator.cpp +++ b/ruby/src/IceRuby/Communicator.cpp @@ -225,6 +225,34 @@ IceRuby_initialize(int argc, VALUE* argv, VALUE self) extern "C" VALUE +IceRuby_stringToIdentity(VALUE self, VALUE str) +{ + ICE_RUBY_TRY + { + string s = getString(str); + Ice::Identity ident = Ice::stringToIdentity(s); + return createIdentity(ident); + } + ICE_RUBY_CATCH + return Qnil; +} + +extern "C" +VALUE +IceRuby_identityToString(VALUE self, VALUE id) +{ + ICE_RUBY_TRY + { + Ice::Identity ident = getIdentity(id); + string str = Ice::identityToString(ident); + return createString(str); + } + ICE_RUBY_CATCH + return Qnil; +} + +extern "C" +VALUE IceRuby_Communicator_destroy(VALUE self) { Ice::CommunicatorPtr p = getCommunicator(self); @@ -574,6 +602,8 @@ void IceRuby::initCommunicator(VALUE iceModule) { rb_define_module_function(iceModule, "initialize", CAST_METHOD(IceRuby_initialize), -1); + rb_define_module_function(iceModule, "identityToString", CAST_METHOD(IceRuby_identityToString), 1); + rb_define_module_function(iceModule, "stringToIdentity", CAST_METHOD(IceRuby_stringToIdentity), 1); _communicatorClass = rb_define_class_under(iceModule, "CommunicatorI", rb_cObject); rb_define_method(_communicatorClass, "destroy", CAST_METHOD(IceRuby_Communicator_destroy), 0); |