#ifndef SWIG_STD_BASIC_STRING
/* defining the std::string asptr/from methods */
%fragment(SWIG_AsPtr_frag(std::string),"header",
fragment="SWIG_AsCharPtrAndSize") {
SWIG_AsPtr(std::string)(PyObject* obj, std::string **val)
static swig_type_info* string_info = SWIG_TypeQuery("std::string *");
if (SWIG_ConvertPtr(obj, (void**)&vptr, string_info, 0) != -1) {
char* buf = 0 ; size_t size = 0;
if (SWIG_AsCharPtrAndSize(obj, &buf, &size)) {
if (val) *val = new std::string(buf, size - 1);
PyErr_SetString(PyExc_TypeError,"a string is expected");
%fragment(SWIG_From_frag(std::string),"header",
fragment="SWIG_FromCharArray") {
SWIGINTERNINLINE PyObject*
SWIG_From(std::string)(const std::string& s)
return SWIG_FromCharArray(s.data(), s.size());
%fragment(SWIG_AsVal_frag(std::string),"header",
fragment=SWIG_AsPtr_frag(std::string)) {
SWIG_AsVal(std::string)(PyObject* obj, std::string *val)
int res = SWIG_AsPtr(std::string)(obj, &s);
if (res == SWIG_NEWOBJ) delete s;
PyErr_SetString(PyExc_TypeError,"a string is expected");
%typemap_asptrfromn(SWIG_CCode(STRING), std::string);
%include <std/std_string.i>