/// /// JJassubAssets.hpp /// This file was generated by nitrogen. DO NOT MODIFY THIS FILE. /// https://github.com/mrousavy/nitro /// Copyright © Marc Rousavy @ Margelo /// #pragma once #include #include "JassubAssets.hpp" #include #include namespace margelo::nitro::omni { using namespace facebook; /** * The C++ JNI bridge between the C++ struct "JassubAssets" and the Kotlin data class "JassubAssets". */ struct JJassubAssets final: public jni::JavaClass { public: static constexpr auto kJavaDescriptor = "Lcom/margelo/nitro/omni/JassubAssets;"; public: /** * Convert this Java/Kotlin-based struct to the C++ struct JassubAssets by copying all values to C++. */ [[maybe_unused]] [[nodiscard]] JassubAssets toCpp() const { static const auto clazz = javaClassStatic(); static const auto fieldWorkerUrl = clazz->getField("workerUrl"); jni::local_ref workerUrl = this->getFieldValue(fieldWorkerUrl); static const auto fieldWasmUrl = clazz->getField("wasmUrl"); jni::local_ref wasmUrl = this->getFieldValue(fieldWasmUrl); static const auto fieldModernWasmUrl = clazz->getField("modernWasmUrl"); jni::local_ref modernWasmUrl = this->getFieldValue(fieldModernWasmUrl); static const auto fieldFontUrl = clazz->getField("fontUrl"); jni::local_ref fontUrl = this->getFieldValue(fieldFontUrl); return JassubAssets( workerUrl != nullptr ? std::make_optional(workerUrl->toStdString()) : std::nullopt, wasmUrl != nullptr ? std::make_optional(wasmUrl->toStdString()) : std::nullopt, modernWasmUrl != nullptr ? std::make_optional(modernWasmUrl->toStdString()) : std::nullopt, fontUrl != nullptr ? std::make_optional(fontUrl->toStdString()) : std::nullopt ); } public: /** * Create a Java/Kotlin-based struct by copying all values from the given C++ struct to Java. */ [[maybe_unused]] static jni::local_ref fromCpp(const JassubAssets& value) { using JSignature = JJassubAssets(jni::alias_ref, jni::alias_ref, jni::alias_ref, jni::alias_ref); static const auto clazz = javaClassStatic(); static const auto create = clazz->getStaticMethod("fromCpp"); return create( clazz, value.workerUrl.has_value() ? jni::make_jstring(value.workerUrl.value()) : nullptr, value.wasmUrl.has_value() ? jni::make_jstring(value.wasmUrl.value()) : nullptr, value.modernWasmUrl.has_value() ? jni::make_jstring(value.modernWasmUrl.value()) : nullptr, value.fontUrl.has_value() ? jni::make_jstring(value.fontUrl.value()) : nullptr ); } }; } // namespace margelo::nitro::omni