in reply to C++ strings, references and XS
If you don't need to handle '\0' characters in your strings, then this is nearly trivial to handle.
char* cAiml::_respond( input, user ) char* input char* user
...does most of the work. Sorry, I never do OO via XS and I'm a bit rusty regarding little XS details so I won't try to fill in the CODE: block for above but C++ turns char* into std::string for you automatically so all you need to do is return undef (or the empty list) for one case or grab output.c_str() for the XS to copy into the returned PV for the other.
Let us know how far you get and someone will likely give you more hints...
- tye
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: C++ strings, references and XS (char*)
by v01d (Novice) on Dec 20, 2005 at 16:08 UTC | |
by tye (Sage) on Dec 20, 2005 at 16:31 UTC | |
by v01d (Novice) on Dec 20, 2005 at 21:58 UTC |