diff options
author | Sven Gothel <[email protected]> | 2022-11-28 22:18:26 +0100 |
---|---|---|
committer | Sven Gothel <[email protected]> | 2022-11-28 22:18:26 +0100 |
commit | 0dcaa06a81baad16012b84bfa5e46caf0a117590 (patch) | |
tree | 564316bbd1e8bdef4d3ff49c5a490fb4d3fa06db | |
parent | 8d3d0194e7f4680008cb48030ad1731a51eb1166 (diff) |
helper_jni, jau.fs.FileUtil.cxx: Use jau::function instead of std::function
-rw-r--r-- | include/jau/jni/helper_jni.hpp | 14 | ||||
-rw-r--r-- | java_jni/jni/jau/jau_fs_FileUtil.cxx | 2 |
2 files changed, 8 insertions, 8 deletions
diff --git a/include/jau/jni/helper_jni.hpp b/include/jau/jni/helper_jni.hpp index 3e891de..0ee3f75 100644 --- a/include/jau/jni/helper_jni.hpp +++ b/include/jau/jni/helper_jni.hpp @@ -29,7 +29,6 @@ #include <limits> #include <vector> #include <memory> -#include <functional> #include <jni.h> #include <jau/java_uplink.hpp> @@ -37,6 +36,7 @@ #include <jau/basic_types.hpp> #include <jau/darray.hpp> #include <jau/io_util.hpp> +#include <jau/functional.hpp> #include <jau/jni/jni_mem.hpp> @@ -450,7 +450,7 @@ namespace jau::jni { } /** Move assignment operator. */ - shared_ptr_ref& operator=(shared_ptr_ref&& o) { + shared_ptr_ref& operator=(shared_ptr_ref&& o) noexcept { if( nullptr != ref_ptr ) { safe_delete(); } @@ -666,7 +666,7 @@ namespace jau::jni { template <typename T> jobject convert_instance_to_jobject(JNIEnv *env, const std::shared_ptr<T>& elem, - const char *ctor_prototype, std::function<jobject(JNIEnv*, jclass, jmethodID, const std::shared_ptr<T>&)> ctor) + const char *ctor_prototype, jau::function<jobject(JNIEnv*, jclass, jmethodID, const std::shared_ptr<T>&)> ctor) { jclass clazz = search_class(env, T::java_class().c_str()); jmethodID clazz_ctor = search_method(env, clazz, "<init>", ctor_prototype, false); @@ -683,7 +683,7 @@ namespace jau::jni { template <typename T> jobject convert_instance_to_jobject(JNIEnv *env, jclass clazz, - const char *ctor_prototype, std::function<jobject(JNIEnv*, jclass, jmethodID, const std::shared_ptr<T>&)> ctor, + const char *ctor_prototype, jau::function<jobject(JNIEnv*, jclass, jmethodID, const std::shared_ptr<T>&)> ctor, const std::shared_ptr<T>& elem) { jmethodID clazz_ctor = search_method(env, clazz, "<init>", ctor_prototype, false); @@ -722,7 +722,7 @@ namespace jau::jni { template <typename T, typename U> jobject convert_vector_sharedptr_to_jarraylist(JNIEnv *env, T& array, - const char *ctor_prototype, std::function<jobject(JNIEnv*, jclass, jmethodID, const std::shared_ptr<U>&)> ctor) + const char *ctor_prototype, jau::function<jobject(JNIEnv*, jclass, jmethodID, const std::shared_ptr<U>&)> ctor) { const size_t array_size = array.size(); if( array_size > std::numeric_limits<jsize>::max() ) { @@ -756,7 +756,7 @@ namespace jau::jni { } template <typename T, typename U> - jobject convert_vector_sharedptr_to_jarraylist(JNIEnv *env, T& array, std::function<jobject(JNIEnv*, const std::shared_ptr<U>&)> ctor) + jobject convert_vector_sharedptr_to_jarraylist(JNIEnv *env, T& array, jau::function<jobject(JNIEnv*, const std::shared_ptr<U>&)> ctor) { const size_t array_size = array.size(); if( array_size > std::numeric_limits<jsize>::max() ) { @@ -787,7 +787,7 @@ namespace jau::jni { } template <typename T, typename U> - jobject convert_vector_to_jarraylist(JNIEnv *env, T& array, std::function<jobject(JNIEnv*, const U&)> ctor) + jobject convert_vector_to_jarraylist(JNIEnv *env, T& array, jau::function<jobject(JNIEnv*, const U&)> ctor) { const size_t array_size = array.size(); if( array_size > std::numeric_limits<jsize>::max() ) { diff --git a/java_jni/jni/jau/jau_fs_FileUtil.cxx b/java_jni/jni/jau/jau_fs_FileUtil.cxx index f94fbb2..b92036a 100644 --- a/java_jni/jni/jau/jau_fs_FileUtil.cxx +++ b/java_jni/jni/jau/jau_fs_FileUtil.cxx @@ -371,7 +371,7 @@ jobject Java_org_jau_fs_FileUtil_get_1dir_1content(JNIEnv *env, jclass cls, jstr static const std::string _dirItemClazzCtorArgs("(Ljava/lang/String;Ljava/lang/String;)V"); jclass dirItemClazz = jau::jni::search_class(env, _dirItemClassName.c_str()); jmethodID dirItemClazzCtor = jau::jni::search_method(env, dirItemClazz, "<init>", _dirItemClazzCtorArgs.c_str(), false); - std::function<jobject(JNIEnv*, const jau::fs::dir_item&)> ctor_diritem = + jau::function<jobject(JNIEnv*, const jau::fs::dir_item&)> ctor_diritem = [&](JNIEnv *env_, const jau::fs::dir_item& di)->jobject { jstring dname = jau::jni::from_string_to_jstring(env_, di.dirname()); jstring bname = jau::jni::from_string_to_jstring(env_, di.basename()); |