Skip to content

Quick calls #14

Open
DmitrySkiba opened this Issue Jan 22, 2012 · 0 comments

1 participant

@DmitrySkiba
Owner

Sometimes overhead of declaring JNIpp class (via JB_ macros) is just too much.

There should some 'quick' way of doing calling methods or manipulating variables.

Something like this:

java::PString var = java::CallMethod("System","String getenv(String)", java::PString::New("MY_VAR");
int ival = java::GetField("MyClass", "int mVar", myObject);

Note that functions return generic object that has different conversion operators. However, only proper conversion will succeed, all others will throw. E.g. the following will compile but will throw:

java::PObject obj = java::GetField("MyClass", "int mVar", myObject);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Something went wrong with that request. Please try again.