@@ -73,6 +73,7 @@ namespace jni
73
73
74
74
// Foward Declarations
75
75
class Object ;
76
+ template <class TElement > class Array ;
76
77
77
78
/* *
78
79
This namespace is for messy implementation details only. It is not a part
@@ -103,6 +104,9 @@ namespace jni
103
104
std::string valueSig (const Object* obj);
104
105
inline std::string valueSig (const Object* const * obj) { return valueSig (obj ? *obj : nullptr ); }
105
106
107
+ template <class TArg >
108
+ inline std::string valueSig (const Array<TArg>*) { return " [" + valueSig ((TArg*) nullptr ); }
109
+
106
110
template <int n, class TArg >
107
111
inline std::string valueSig (const TArg (*arg)[n]) { return valueSig ((const TArg* const *)arg); }
108
112
@@ -452,7 +456,10 @@ namespace jni
452
456
std::string callMethod (method_t method, internal::value_t * args, internal::ReturnTypeWrapper<std::string> const &) const ;
453
457
std::wstring callMethod (method_t method, internal::value_t * args, internal::ReturnTypeWrapper<std::wstring> const &) const ;
454
458
jni::Object callMethod (method_t method, internal::value_t * args, internal::ReturnTypeWrapper<jni::Object> const &) const ;
459
+ jarray callMethod (method_t method, internal::value_t * args, internal::ReturnTypeWrapper<jarray> const &) const ;
455
460
461
+ template <typename T>
462
+ jni::Array<T> callMethod (method_t method, internal::value_t * args, internal::ReturnTypeWrapper<jni::Array<T>> const &) const ;
456
463
457
464
void getFieldValue (field_t field, internal::ReturnTypeWrapper<void > const &) const ;
458
465
bool getFieldValue (field_t field, internal::ReturnTypeWrapper<bool > const &) const ;
@@ -1025,6 +1032,17 @@ namespace jni
1025
1032
InitializationException (const char * msg) : Exception(msg) {}
1026
1033
};
1027
1034
1035
+ /*
1036
+ Call method returning array: implementation
1037
+ */
1038
+ template <typename T>
1039
+ inline jni::Array<T> Object::callMethod (method_t method, internal::value_t * args,
1040
+ internal::ReturnTypeWrapper<jni::Array<T>> const &) const
1041
+ {
1042
+ jarray result = callMethod (method, args, internal::ReturnTypeWrapper<jarray>{});
1043
+ return jni::Array<T>(result, DeleteLocalInput);
1044
+ }
1045
+
1028
1046
/*
1029
1047
Array Implementation
1030
1048
*/
0 commit comments