Quantcast
Channel: GameDev.net
Viewing all articles
Browse latest Browse all 17063

Unable to share array<string> between AS and C++

$
0
0

I'm trying to get an array<string> instance from a RegExp class I implemented on the C++ side and registered with the AS engine.

The AS side:

RegExp re;
int n = re.findall(response, matches);

Error message:

RegExp::findall(): Found -404223764 matches.
---
The script ended with an exception.
func: string getClientId()
modl:
sect: script
line: 32
desc: Index out of bounds

Method registration:

engine->RegisterObjectMethod("RegExp",
       "int findall(string &in, array<string> &inout)",
       asMETHODPR(RegExp, findall,
       (const std::string &, CScriptArray* &), int),
       asCALL_THISCALL);

Method:

int RegExp::findall(const std::string &subject, CScriptArray* &matches) {
if (!regexp) { return 0; }

Poco::RegularExpression::MatchVec matchesVector …

Viewing all articles
Browse latest Browse all 17063

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>