/// /// JSubtitleAssets.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 "SubtitleAssets.hpp" #include "JJassubAssets.hpp" #include "JPgsAssets.hpp" #include "JassubAssets.hpp" #include "PgsAssets.hpp" #include #include namespace margelo::nitro::omni { using namespace facebook; /** * The C++ JNI bridge between the C++ struct "SubtitleAssets" and the Kotlin data class "SubtitleAssets". */ struct JSubtitleAssets final: public jni::JavaClass { public: static constexpr auto kJavaDescriptor = "Lcom/margelo/nitro/omni/SubtitleAssets;"; public: /** * Convert this Java/Kotlin-based struct to the C++ struct SubtitleAssets by copying all values to C++. */ [[maybe_unused]] [[nodiscard]] SubtitleAssets toCpp() const { static const auto clazz = javaClassStatic(); static const auto fieldJassub = clazz->getField("jassub"); jni::local_ref jassub = this->getFieldValue(fieldJassub); static const auto fieldPgs = clazz->getField("pgs"); jni::local_ref pgs = this->getFieldValue(fieldPgs); return SubtitleAssets( jassub != nullptr ? std::make_optional(jassub->toCpp()) : std::nullopt, pgs != nullptr ? std::make_optional(pgs->toCpp()) : 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 SubtitleAssets& value) { using JSignature = JSubtitleAssets(jni::alias_ref, jni::alias_ref); static const auto clazz = javaClassStatic(); static const auto create = clazz->getStaticMethod("fromCpp"); return create( clazz, value.jassub.has_value() ? JJassubAssets::fromCpp(value.jassub.value()) : nullptr, value.pgs.has_value() ? JPgsAssets::fromCpp(value.pgs.value()) : nullptr ); } }; } // namespace margelo::nitro::omni