
Untitled
By: a guest on
May 2nd, 2012 | syntax:
None | size: 0.51 KB | hits: 19 | expires: Never
Using SWIG with methods that take std::string as a parameter
public void setName(SWIGTYPE_p_std__string name)
{
examplePINVOKE.Shape_setName(swigCPtr, SWIGTYPE_p_std__string.getCPtr(name));
if (examplePINVOKE.SWIGPendingException.Pending) throw examplePINVOKE.SWIGPendingException.Retrieve();
}
/* File : example.i */
%module example
%{
#include "example.h"
%}
/* Let's just grab the original header file here */
%include "example.h"
void Shape::setName(const std::string& name)
{
mName = name;
}