massive typemap unification
git-svn-id: https://swig.svn.sourceforge.net/svnroot/swig/trunk@7676 626c5289-ae23-0410-ae9c-e8d60b6d4f22
This commit is contained in:
parent
0a405b10e8
commit
1c7c9e44f7
144 changed files with 6378 additions and 7248 deletions
49
SWIG/Examples/test-suite/director_wstring.i
Normal file
49
SWIG/Examples/test-suite/director_wstring.i
Normal file
|
|
@ -0,0 +1,49 @@
|
|||
%module(directors="1") director_wstring;
|
||||
%include stl.i
|
||||
%include std_vector.i
|
||||
%include std_wstring.i
|
||||
|
||||
// Using thread unsafe wrapping
|
||||
%warnfilter(470) A;
|
||||
|
||||
%{
|
||||
#include <vector>
|
||||
#include <string>
|
||||
%}
|
||||
|
||||
%feature("director") A;
|
||||
%inline %{
|
||||
|
||||
struct A
|
||||
{
|
||||
A(const std::wstring& first)
|
||||
: m_strings(1, first)
|
||||
{}
|
||||
|
||||
virtual ~A() {}
|
||||
|
||||
virtual const std::wstring& get_first() const
|
||||
{ return get(0); }
|
||||
|
||||
virtual const std::wstring& get(int n) const
|
||||
{ return m_strings[n]; }
|
||||
|
||||
virtual const std::wstring& call_get_first() const
|
||||
{ return get_first(); }
|
||||
|
||||
virtual const std::wstring& call_get(int n) const
|
||||
{ return get(n); }
|
||||
|
||||
std::vector<std::wstring> m_strings;
|
||||
|
||||
|
||||
virtual void process_text(const char *text)
|
||||
{
|
||||
}
|
||||
|
||||
void call_process_func() { process_text("hello"); }
|
||||
};
|
||||
|
||||
%}
|
||||
|
||||
%template(StringVector) std::vector<std::wstring>;
|
||||
Loading…
Add table
Add a link
Reference in a new issue