mirror of
https://github.com/zoriya/react-native-omni.git
synced 2026-08-05 05:36:17 +00:00
59 lines
1.7 KiB
C++
Generated
59 lines
1.7 KiB
C++
Generated
///
|
|
/// JPgsAssets.hpp
|
|
/// This file was generated by nitrogen. DO NOT MODIFY THIS FILE.
|
|
/// https://github.com/mrousavy/nitro
|
|
/// Copyright © Marc Rousavy @ Margelo
|
|
///
|
|
|
|
#pragma once
|
|
|
|
#include <fbjni/fbjni.h>
|
|
#include "PgsAssets.hpp"
|
|
|
|
#include <optional>
|
|
#include <string>
|
|
|
|
namespace margelo::nitro::omni {
|
|
|
|
using namespace facebook;
|
|
|
|
/**
|
|
* The C++ JNI bridge between the C++ struct "PgsAssets" and the Kotlin data class "PgsAssets".
|
|
*/
|
|
struct JPgsAssets final: public jni::JavaClass<JPgsAssets> {
|
|
public:
|
|
static constexpr auto kJavaDescriptor = "Lcom/margelo/nitro/omni/PgsAssets;";
|
|
|
|
public:
|
|
/**
|
|
* Convert this Java/Kotlin-based struct to the C++ struct PgsAssets by copying all values to C++.
|
|
*/
|
|
[[maybe_unused]]
|
|
[[nodiscard]]
|
|
PgsAssets toCpp() const {
|
|
static const auto clazz = javaClassStatic();
|
|
static const auto fieldWorkerUrl = clazz->getField<jni::JString>("workerUrl");
|
|
jni::local_ref<jni::JString> workerUrl = this->getFieldValue(fieldWorkerUrl);
|
|
return PgsAssets(
|
|
workerUrl != nullptr ? std::make_optional(workerUrl->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<JPgsAssets::javaobject> fromCpp(const PgsAssets& value) {
|
|
using JSignature = JPgsAssets(jni::alias_ref<jni::JString>);
|
|
static const auto clazz = javaClassStatic();
|
|
static const auto create = clazz->getStaticMethod<JSignature>("fromCpp");
|
|
return create(
|
|
clazz,
|
|
value.workerUrl.has_value() ? jni::make_jstring(value.workerUrl.value()) : nullptr
|
|
);
|
|
}
|
|
};
|
|
|
|
} // namespace margelo::nitro::omni
|