From: Luigi Ballabio Date: 2001-11-17T23:02:48+09:00 Subject: [ruby-talk:25702] Re: SWIG and strings --============_-1206116759==_ma============ Content-Type: text/plain; charset="us-ascii" ; format="flowed" >Hi, > > Has anybody been able to typemap strings in swig with ruby? Hi, I'd try this (I've not tested it with your code, though): %typemap(ruby,out) string, const string & { $target = rb_str_new2($source->c_str()); }; HTH, Luigi -- --============_-1206116759==_ma============ Content-Type: text/html; charset="us-ascii" Re: [ruby-talk:25593] SWIG and strings
Hi,
  Has anybody been able to typemap strings in swig with ruby?

Hi,
        I'd try this (I've not tested it with your code, though):

%typemap(ruby,out) string, const string & {
    $target = rb_str_new2($source->c_str());
};
HTH,
        Luigi

-- 
--============_-1206116759==_ma============--