resolved one if is needed.
Add examples showing the problem with SWIG_TypeQuery
and template+typedef and the old type str, and how
it works now.
git-svn-id: https://swig.svn.sourceforge.net/svnroot/swig/trunk/SWIG@5704 626c5289-ae23-0410-ae9c-e8d60b6d4f22
Add the macros
%typemap_asfromcheck()
%typemap_asfrom()
that can be used to defined all the different typemaps
for types where the As/From/Check methods are provided.
All the basic type (int, char,...) typemaps are implemented
using them.
The std::string and std::complex<T> are reimplemented using
the new %typemap_asfrom/check macros too. This helps to complete
all the previously missing typemaps (consttab, varin, varout,..)
and also ilustrates how to define the As/From/Check methods
to use with the %typemap_asfrom/check macros.
As a byproduct, the C complex typemap was added, and the file
complex.i
can be used to load the complex support for either C or C++. The
original C++ std_complex.i is still there, and the corresponding C
ccomplex.i too, if they need to be included explicitly.
Also, the As/From methods are declared via %fragment, so, they
can be reused as needed, and only appear in the wrapped code if
they corresponding typemap is invoked, making the typemaps
and the entire code shorter and simpler.
Marcelo.
git-svn-id: https://swig.svn.sourceforge.net/svnroot/swig/trunk/SWIG@5691 626c5289-ae23-0410-ae9c-e8d60b6d4f22
they only accept PyStrings.
now the raw pointer from calloc.i, for example, works
fine.
some of the SWIG_PyObj_(As|From)XXX routines are getting
too large, so, they also will go into the runtime library.
git-svn-id: https://swig.svn.sourceforge.net/svnroot/swig/trunk/SWIG@5689 626c5289-ae23-0410-ae9c-e8d60b6d4f22
null chars, which are allowed in C++ and python, and proper
sizes:
you can use a shorter string to assign a char[6]:
x = "he\0l" -> x := {'h','e',0,'l',0, 0}
but you always get back in python the original size:
x := {'h','i','0','0',0, 0} -> "hi\0\0\0\0"
Better mapping of (char*)0, now you get a None in the python
side, and using None, you get a (char*)0, just like
all the other C++ pointers. Before (char*)0 was mapped
into python as "", or as seg. faults.
Better mapping of "", which is not None nor (char*)0.
Added more tests using primitive types with simple templates.
git-svn-id: https://swig.svn.sourceforge.net/svnroot/swig/trunk/SWIG@5687 626c5289-ae23-0410-ae9c-e8d60b6d4f22
typedef char namet[5];
const namet def_namet = {'h','o', 0, 'l','a'};
ie, char arrays with null embedded characters, and other odd
char[ANY] situations.
add the corresponding test to the primitive_types.i and runme files.
Marcelo
----------------------------------------------------------------------
git-svn-id: https://swig.svn.sourceforge.net/svnroot/swig/trunk/SWIG@5685 626c5289-ae23-0410-ae9c-e8d60b6d4f22
(throw typemap).
- fix the examples with exception problems and warnings
- proper and consist treatment of basic types (short, unsigned char,...)
now all are checked for range and sign. Before, this was depending of
the use of parsing or no parsing, and/or the converter method, and/or
the use of directors, etc.
git-svn-id: https://swig.svn.sourceforge.net/svnroot/swig/trunk/SWIG@5659 626c5289-ae23-0410-ae9c-e8d60b6d4f22
Java wrapping mechanism doesn't work, showing the
need to use a different way to wrap polymorphic classes.
They are two runtime examples: one for java, which is
failing, and one for python, which works fine.
Detailed description of the case can be found
in the three files committed.
git-svn-id: https://swig.svn.sourceforge.net/svnroot/swig/trunk/SWIG@5582 626c5289-ae23-0410-ae9c-e8d60b6d4f22
They will give you and idea of what is currently working.
If you have another case you think we need to test, please
send me an email to add it and trying it here.
git-svn-id: https://swig.svn.sourceforge.net/svnroot/swig/trunk/SWIG@5581 626c5289-ae23-0410-ae9c-e8d60b6d4f22
side for protected director members.
Lib/python/director.swg: added needed code for runtime checking
Source/Modules/python.cxx: added needed code for runtime checking
director_protected_runme.py: checks now that the runtime protection is working
The extra runtime checking is only done for protected members,
so, the old public directors members don't feel any overhead.
This finished the director protected support for the python language.
Java and Ocalm will need to add the "reprotection" mechanism latter.
But as in the python case, the changes will be localized in the
languages files, and there will be no need to touch the core
files anymore.
git-svn-id: https://swig.svn.sourceforge.net/svnroot/swig/trunk/SWIG@5532 626c5289-ae23-0410-ae9c-e8d60b6d4f22