swig/Examples/python/operator/example.i
Marcelo Matus 54737ee9a9 - recover the proper catching exception mechanism for classes
(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
2004-01-21 01:15:10 +00:00

28 lines
671 B
OpenEdge ABL

/* File : example.i */
%module example
#pragma SWIG nowarn=362
%{
#include "example.h"
%}
/* This header file is a little tough to handle because it has overloaded
operators and constructors. We're going to try and deal with that here */
/* This turns the copy constructor in a function ComplexCopy() that can
be called */
%rename(ComplexCopy) Complex::Complex(Complex const &);
/* Now grab the original header file */
%include "example.h"
/* An output method that turns a complex into a short string */
%extend Complex {
char *__str__() {
static char temp[512];
sprintf(temp,"(%g,%g)", self->re(), self->im());
return temp;
}
};