Custom string class?

Asked by John Pursey

Hello again,

The library I am wrapping uses custom containers to override allocation on the C++ side. pybindgen generates bindings for these just fine with 'add_container', but is there any way to register a std::string alternative? It has the same behavior and methods of std::string.

Question information

Language:
English Edit question
Status:
Answered
For:
PyBindGen Edit question
Assignee:
No assignee Edit question
Last query:
Last reply:
Revision history for this message
Gustavo Carneiro (gjc) said :
#1

I guess you need to copy/modify the std::string type handlers in pybindgen/typehandlers/stringtype.py. There can be only one 'std::string' type handler, you have to replace it. It's a bit hackish, but I don't think there's any alternative.

Can you help with this problem?

Provide an answer of your own, or ask John Pursey for more information if necessary.

To post a message you must log in.