diff options
Diffstat (limited to 'ruby/src')
-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 24d9629a847..16bd58cb90f 100644 --- a/ruby/src/IceRuby/Communicator.cpp +++ b/ruby/src/IceRuby/Communicator.cpp @@ -226,6 +226,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_RUBY_TRY @@ -553,6 +581,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); |