From: Andrey S. <dar...@ma...> - 2008-01-28 14:48:36
|
Hi, all! I wrote following swig file: --- begin of 1.swg --- %module test %include <windows.i> %{ # include <afx.h> %} %typemap( in, checkfn = "lua_isstring" ) _CString& ( CString s ) %{ if ( !LuaHelpers::GetLuaString( L, $input, s ) ) { SWIG_fail; } $1 = &s; %} %extend A { %typemap( in ) CString& s = _CString&; void test ( CString& s ) { self->test( s ); } %clear CString& s; // %typemap( in ) CString& s; } %ignore A::test; class A { public: void test ( CString& s ); }; class B { public: void test ( CString& s ); }; --- end of 2.swg --- It is not important why i need such strange code 8-) But this code allow to show the problem i discovered. As they said in "10.2.4 Deleting a typemap", lines %typemap( in ) CString& s; and %clear CString& s; in this case have to do same thing - do not allow to apply rules on B::test's argument. But if i use commented %typemap instead of %clear, %typemap doesn't delete and applies to B::test. -- WBR, Andrey Starodubtsev mailto:dar...@ma... |