Bug#672035: [Swig-user] Using own string class

2012-05-26 Thread William S Fulton
On 24/05/12 22:37, David Piepgrass wrote: At ZNC we have an own string class CString, which is inherited from std::string. The goal is to use it as a just string in target languages. How to do that properly? When you use a string class derived from std::string, the main problem tends to be

Bug#672035: [Swig-user] Using own string class

2012-05-26 Thread William S Fulton
On 24/05/12 19:45, Alexey Sokolov wrote: Hello! At ZNC we have an own string class CString, which is inherited from std::string. The goal is to use it as a just string in target languages. How to do that properly? When I was writing modperl and modpython ZNC modules, I used an approach

Bug#672035: [Swig-user] Using own string class

2012-05-26 Thread Alexey Sokolov
27.05.2012 04:14, William S Fulton пишет: I can't replicate this bug with 2.0.6, you are going to have to provide a test case. swig-2.0.5 introduced a regression which was fixed in 2.0.7 - incorrect typemaps for templates were being used in conjunction with typedef. Please try 2.0.7 and report

Bug#672035: [Swig-user] Using own string class

2012-05-24 Thread Jason Dictos
We do the same thing here, we just use basic in/out typemaps. E.g. %typemap(out) YString { $result = PyString_FromString((char *)static_castconst char *($1)); } %typemap(in) const YString { $1 = new YString(PyString_AsString($input)); } -Original Message- From:

Bug#672035: [Swig-user] Using own string class

2012-05-24 Thread David Piepgrass
At ZNC we have an own string class CString, which is inherited from std::string. The goal is to use it as a just string in target languages. How to do that properly? When you use a string class derived from std::string, the main problem tends to be that SWIG's built-in typemaps refer to