[C++-sig] interfacing headle binary file library, raw pointer and buffer

heroxbd at gmail.com heroxbd at gmail.com
Tue Jun 22 05:37:29 CEST 2010


Allo Nat,

Thank you very much for your reply. I didn't realized I could have this
flexibility with py++ generated code.

Now I could interface these functions.

Cheers!
Benda

Nat Goodspeed <nat at lindenlab.com> writes:

> You want to write a C++ wrapper function something like this:
>
> std::string wrapped_read(size_t len)
> {
>     // manually allocate buffer of size 'len',
>     // e.g. by using std::vector<char>
>     int bytes_read = read(buffer, len);
>     return std::string(buffer, bytes_read);

-- 
XU Benda
Research Center for Neutrino Science
Tohoku University
JAPAN

http://www.awa.tohoku.ac.jp/~benda


More information about the Cplusplus-sig mailing list