12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273 |
- /*
- * Author: Patrick-Christopher Mattulat
- * Company: Lynar Studios
- * E-Mail: webmaster@lynarstudios.com
- * Created: 2023-04-07
- * Changed: 2023-05-23
- *
- * */
- #include <ls-std/core/evaluator/RawNullPointerArgumentEvaluator.hpp>
- #include <ls-std/core/jni/JniApi.hpp>
- using ls::std::core::RawNullPointerArgumentEvaluator;
- using ls::std::core::experimental::JniApi;
- using ls::std::core::type::RawPointer;
- using std::string;
- JniApi::JniApi(JNIEnv *_environment) : environment(_environment)
- {
- RawNullPointerArgumentEvaluator<JNIEnv>{RawPointer<JNIEnv>{_environment}, "Java environment is not being provided!"}.evaluate();
- }
- JniApi::~JniApi() noexcept = default;
- jboolean JniApi::callBooleanMethod(jobject _javaObject, jmethodID _methodId)
- {
- return this->environment->CallBooleanMethod(_javaObject, _methodId);
- }
- jbyte JniApi::callByteMethod(jobject _javaObject, jmethodID _methodId)
- {
- return this->environment->CallByteMethod(_javaObject, _methodId);
- }
- jchar JniApi::callCharMethod(jobject _javaObject, jmethodID _methodId)
- {
- return this->environment->CallCharMethod(_javaObject, _methodId);
- }
- jdouble JniApi::callDoubleMethod(jobject _javaObject, jmethodID _methodId)
- {
- return this->environment->CallDoubleMethod(_javaObject, _methodId);
- }
- jfloat JniApi::callFloatMethod(jobject _javaObject, jmethodID _methodId)
- {
- return this->environment->CallFloatMethod(_javaObject, _methodId);
- }
- jint JniApi::callIntMethod(jobject _javaObject, jmethodID _methodId)
- {
- return this->environment->CallIntMethod(_javaObject, _methodId);
- }
- jlong JniApi::callLongMethod(jobject _javaObject, jmethodID _methodId)
- {
- return this->environment->CallLongMethod(_javaObject, _methodId);
- }
- jshort JniApi::callShortMethod(jobject _javaObject, jmethodID _methodId)
- {
- return this->environment->CallShortMethod(_javaObject, _methodId);
- }
- jclass JniApi::findClass(const string &_classPath)
- {
- return this->environment->FindClass(_classPath.c_str());
- }
- jmethodID JniApi::getMethodId(jclass _javaClass, const char *_methodIdentifier, const char *_methodSignature)
- {
- return this->environment->GetMethodID(_javaClass, _methodIdentifier, _methodSignature);
- }
|