【发布时间】:2013-04-20 09:31:00
【问题描述】:
我有第三方 C++ 库,其中一些类方法使用原始字节缓冲区。我不太确定如何处理 Boost::Python。
C++ 库头文件类似于:
class CSomeClass
{
public:
int load( unsigned char *& pInBufferData, int & iInBufferSize );
int save( unsigned char *& pOutBufferData, int & iOutBufferSize );
}
卡在 Boost::Python 代码中...
class_<CSomeClass>("CSomeClass", init<>())
.def("load", &CSomeClass::load, (args(/* what do I put here??? */)))
.def("save", &CSomeClass::save, (args(/* what do I put here??? */)))
如何包装这些原始缓冲区以在 Python 中将它们作为原始字符串公开?
【问题讨论】:
标签: python boost boost-python bytebuffer