I've been binding angelscript with my game engine. So far, it's been smooth sailing. lovely scripting language!
I'd like to be able to bind a function that returns a variable type. (A template function basically)
The function is this one:
template<typename T>
T getAttribute(const char *element){
static char attribute[1024];
static std::stringstream strStream;
memset(attribute, 0, 1024);
strStream.clear();
this->getAttribute(element, attribute);
strStream<<attribute;
T value;
strStream>>value;
return value;
};
Is there any way to bind this function? I've read through the docs and I didn't really see anything.
Is there anything I can do to make this work? (I don't want to change the class itself. I'd be okay writing a wrapper around that method)
(or) can I use CScriptAny in some way to store and return the data I need?
The datatypes that I'll be returning are usually int, float, double or string (I'm using the CScriptString extension).
Thanks all!