// AUTOGENERATED FILE - DO NOT MODIFY!
// This file generated by Djinni from constants.djinni

#include "NativeConstants.hpp"  // my header
#include "Marshal.hpp"

namespace djinni_generated {

NativeConstants::NativeConstants() = default;

NativeConstants::~NativeConstants() = default;

auto NativeConstants::fromCpp(JNIEnv* jniEnv, const CppType& c) -> ::djinni::LocalRef<JniType> {
    const auto& data = ::djinni::JniClass<NativeConstants>::get();
    auto r = ::djinni::LocalRef<JniType>{jniEnv->NewObject(data.clazz.get(), data.jconstructor,
                                                           ::djinni::get(::djinni::I32::fromCpp(jniEnv, c.some_integer)),
                                                           ::djinni::get(::djinni::String::fromCpp(jniEnv, c.some_string)))};
    ::djinni::jniExceptionCheck(jniEnv);
    return r;
}

auto NativeConstants::toCpp(JNIEnv* jniEnv, JniType j) -> CppType {
    ::djinni::JniLocalScope jscope(jniEnv, 3);
    assert(j != nullptr);
    const auto& data = ::djinni::JniClass<NativeConstants>::get();
    return {::djinni::I32::toCpp(jniEnv, jniEnv->GetIntField(j, data.field_mSomeInteger)),
            ::djinni::String::toCpp(jniEnv, (jstring)jniEnv->GetObjectField(j, data.field_mSomeString))};
}

}  // namespace djinni_generated
