I have C++ struct:
typedef struct FunctionArgs
{
char* url;
char* info;
int id;
bool isWorking;
}
And C++ function, which as an argument get FunctionArgs
struct, now I want to call from this function Java method and as argument to that method give FunctionArgs
struct.
void func( const FunctionArgs& args )
{
// Do some code ...
env->CallObjectMethod( clazzObject, clazzMethod, args );
}
As you can see in env->CallObjectMethod( clazzObject, clazzMethod, *args );
function as third argument I give args
which is FunctionArgs
struct object.
In JAVA I have class and function:
class JFunctionArgs
{
String url;
String info;
int id;
boolean isWorking;
}
public class SomeClass
{
public void func( JFunctionArgs args )
{
}
}
I want to know
- Can I do something that I do
env->CallObjectMethod( clazzObject, clazzMethod, args );
, I mean can I give struct object to CallObjectMethod as an argument ? - How can I get struct object in Java code func ?