« Return to Thread: using cdata in python

using cdata in python

by malat :: Rate this Message:

Reply to Author | View in Thread

Hi there,

  I cannot understand how to use cdata to do this simple task. Let say
I have this class:

class A
{
public:
  unsigned int GetLength();
  void GetBuffer(char *strout);
};

In C++ you would use it this way:

A a;
char *buffer = new char[a.GetLength()];
a.GetBuffer(buffer);

I would like that it behave juste like python: readlines() function.
It should return the properly allocated string as a PyString (may
contains NULL character).

Thanks a bunch !

--
Mathieu

-------------------------------------------------------------------------
This SF.net email is sponsored by the 2008 JavaOne(SM) Conference
Don't miss this year's exciting event. There's still time to save $100.
Use priority code J8TL2D2.
http://ad.doubleclick.net/clk;198757673;13503038;p?http://java.sun.com/javaone
_______________________________________________
Swig-user mailing list
Swig-user@...
https://lists.sourceforge.net/lists/listinfo/swig-user

 « Return to Thread: using cdata in python