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

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

namespace djinni_generated {

NativeExtendedRecord::NativeExtendedRecord() = default;

NativeExtendedRecord::~NativeExtendedRecord() = default;

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

auto NativeExtendedRecord::toCpp(JNIEnv* jniEnv, JniType j) -> CppType {
    ::djinni::JniLocalScope jscope(jniEnv, 2);
    assert(j != nullptr);
    const auto& data = ::djinni::JniClass<NativeExtendedRecord>::get();
    return {::djinni::Bool::toCpp(jniEnv, jniEnv->GetBooleanField(j, data.field_mFoo))};
}

}  // namespace djinni_generated
