adding more missing typemaps

git-svn-id: https://swig.svn.sourceforge.net/svnroot/swig/trunk/SWIG@7785 626c5289-ae23-0410-ae9c-e8d60b6d4f22
This commit is contained in:
Marcelo Matus 2005-11-03 11:11:21 +00:00
commit ea0c2ca342
7 changed files with 67 additions and 1 deletions

View file

@ -27,6 +27,11 @@ namespace std
%template(paircA2) pair<const int, const A*>;
%template(pairiiA) pair<int,pair<int, A*> >;
%template(pairiiAc) pair<int,const pair<int, A*> >;
%template() pair<PyObject *, PyObject *>;
%template(pymap) map<PyObject *, PyObject*>;
}

View file

@ -31,3 +31,11 @@ for k in m:
pm = li_std_map.pymap()
pm[1] = (1,2)
pm["foo"] = "hello"
for k in pm:
print pm[k]

View file

@ -121,3 +121,6 @@ std::vector<std::string> vecStr(std::vector<std::string> v) {
%pointer_class(int,PtrInt)
%array_functions(int,ArrInt)
%template(pyvector) std::vector<PyObject*>;

View file

@ -94,3 +94,10 @@ v = vecStr(["hello ", "world"])
if v[0] != 'hello world':
raise RuntimeError,"bad std::string+std::vector"
pv = pyvector([1, "hello", (1,2)])
if pv[1] != "hello":
raise RuntimeError