react-native-carrot-quest 0.1.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CarrotQuest.podspec +34 -0
- package/LICENSE +20 -0
- package/README.md +457 -0
- package/android/CMakeLists.txt +24 -0
- package/android/build.gradle +136 -0
- package/android/src/main/AndroidManifest.xml +2 -0
- package/android/src/main/cpp/cpp-adapter.cpp +11 -0
- package/android/src/main/java/com/margelo/nitro/carrotquest/CarrotQuest.kt +585 -0
- package/android/src/main/java/com/margelo/nitro/carrotquest/CarrotQuestPackage.kt +22 -0
- package/android/src/main/java/com/margelo/nitro/carrotquest/CarrotQuestSetup.kt +472 -0
- package/ios/CarrotQuest.swift +588 -0
- package/ios/CarrotQuestSetup.swift +333 -0
- package/lib/module/CarrotQuest.nitro.js +4 -0
- package/lib/module/CarrotQuest.nitro.js.map +1 -0
- package/lib/module/carrot-quest.js +136 -0
- package/lib/module/carrot-quest.js.map +1 -0
- package/lib/module/carrot-quest.native.js +155 -0
- package/lib/module/carrot-quest.native.js.map +1 -0
- package/lib/module/index.js +6 -0
- package/lib/module/index.js.map +1 -0
- package/lib/module/package.json +1 -0
- package/lib/module/subscriptions.js +76 -0
- package/lib/module/subscriptions.js.map +1 -0
- package/lib/typescript/package.json +1 -0
- package/lib/typescript/src/CarrotQuest.nitro.d.ts +394 -0
- package/lib/typescript/src/CarrotQuest.nitro.d.ts.map +1 -0
- package/lib/typescript/src/carrot-quest.d.ts +37 -0
- package/lib/typescript/src/carrot-quest.d.ts.map +1 -0
- package/lib/typescript/src/carrot-quest.native.d.ts +37 -0
- package/lib/typescript/src/carrot-quest.native.d.ts.map +1 -0
- package/lib/typescript/src/index.d.ts +6 -0
- package/lib/typescript/src/index.d.ts.map +1 -0
- package/lib/typescript/src/subscriptions.d.ts +32 -0
- package/lib/typescript/src/subscriptions.d.ts.map +1 -0
- package/nitro.json +23 -0
- package/nitrogen/generated/android/c++/JCarrotQuestEventValue.cpp +30 -0
- package/nitrogen/generated/android/c++/JCarrotQuestEventValue.hpp +83 -0
- package/nitrogen/generated/android/c++/JCarrotQuestLogCategory.hpp +76 -0
- package/nitrogen/generated/android/c++/JCarrotQuestLogEntry.hpp +100 -0
- package/nitrogen/generated/android/c++/JCarrotQuestLogLevel.hpp +70 -0
- package/nitrogen/generated/android/c++/JCarrotQuestProperty.hpp +74 -0
- package/nitrogen/generated/android/c++/JCarrotQuestPropertyKind.hpp +61 -0
- package/nitrogen/generated/android/c++/JCarrotQuestPropertyOperation.hpp +73 -0
- package/nitrogen/generated/android/c++/JCarrotQuestSetupOptions.hpp +94 -0
- package/nitrogen/generated/android/c++/JCarrotQuestTheme.hpp +64 -0
- package/nitrogen/generated/android/c++/JCarrotQuestUrlSource.hpp +64 -0
- package/nitrogen/generated/android/c++/JCarrotQuestUserProperties.hpp +84 -0
- package/nitrogen/generated/android/c++/JFunc_void_CarrotQuestLogEntry.hpp +84 -0
- package/nitrogen/generated/android/c++/JFunc_void_bool.hpp +75 -0
- package/nitrogen/generated/android/c++/JFunc_void_double.hpp +75 -0
- package/nitrogen/generated/android/c++/JFunc_void_std__string.hpp +76 -0
- package/nitrogen/generated/android/c++/JHybridCarrotQuestSpec.cpp +388 -0
- package/nitrogen/generated/android/c++/JHybridCarrotQuestSpec.hpp +96 -0
- package/nitrogen/generated/android/carrotquest+autolinking.cmake +82 -0
- package/nitrogen/generated/android/carrotquest+autolinking.gradle +27 -0
- package/nitrogen/generated/android/carrotquestOnLoad.cpp +62 -0
- package/nitrogen/generated/android/carrotquestOnLoad.hpp +34 -0
- package/nitrogen/generated/android/kotlin/com/margelo/nitro/carrotquest/CarrotQuestEventValue.kt +75 -0
- package/nitrogen/generated/android/kotlin/com/margelo/nitro/carrotquest/CarrotQuestLogCategory.kt +29 -0
- package/nitrogen/generated/android/kotlin/com/margelo/nitro/carrotquest/CarrotQuestLogEntry.kt +81 -0
- package/nitrogen/generated/android/kotlin/com/margelo/nitro/carrotquest/CarrotQuestLogLevel.kt +27 -0
- package/nitrogen/generated/android/kotlin/com/margelo/nitro/carrotquest/CarrotQuestProperty.kt +66 -0
- package/nitrogen/generated/android/kotlin/com/margelo/nitro/carrotquest/CarrotQuestPropertyKind.kt +24 -0
- package/nitrogen/generated/android/kotlin/com/margelo/nitro/carrotquest/CarrotQuestPropertyOperation.kt +28 -0
- package/nitrogen/generated/android/kotlin/com/margelo/nitro/carrotquest/CarrotQuestSetupOptions.kt +91 -0
- package/nitrogen/generated/android/kotlin/com/margelo/nitro/carrotquest/CarrotQuestTheme.kt +25 -0
- package/nitrogen/generated/android/kotlin/com/margelo/nitro/carrotquest/CarrotQuestUrlSource.kt +25 -0
- package/nitrogen/generated/android/kotlin/com/margelo/nitro/carrotquest/CarrotQuestUserProperties.kt +66 -0
- package/nitrogen/generated/android/kotlin/com/margelo/nitro/carrotquest/Func_void_CarrotQuestLogEntry.kt +80 -0
- package/nitrogen/generated/android/kotlin/com/margelo/nitro/carrotquest/Func_void_bool.kt +80 -0
- package/nitrogen/generated/android/kotlin/com/margelo/nitro/carrotquest/Func_void_double.kt +80 -0
- package/nitrogen/generated/android/kotlin/com/margelo/nitro/carrotquest/Func_void_std__string.kt +80 -0
- package/nitrogen/generated/android/kotlin/com/margelo/nitro/carrotquest/HybridCarrotQuestSpec.kt +209 -0
- package/nitrogen/generated/android/kotlin/com/margelo/nitro/carrotquest/carrotquestOnLoad.kt +35 -0
- package/nitrogen/generated/ios/CarrotQuest+autolinking.rb +62 -0
- package/nitrogen/generated/ios/CarrotQuest-Swift-Cxx-Bridge.cpp +97 -0
- package/nitrogen/generated/ios/CarrotQuest-Swift-Cxx-Bridge.hpp +637 -0
- package/nitrogen/generated/ios/CarrotQuest-Swift-Cxx-Umbrella.hpp +80 -0
- package/nitrogen/generated/ios/CarrotQuestAutolinking.mm +33 -0
- package/nitrogen/generated/ios/CarrotQuestAutolinking.swift +26 -0
- package/nitrogen/generated/ios/c++/HybridCarrotQuestSpecSwift.cpp +11 -0
- package/nitrogen/generated/ios/c++/HybridCarrotQuestSpecSwift.hpp +344 -0
- package/nitrogen/generated/ios/swift/CarrotQuestEventValue.swift +32 -0
- package/nitrogen/generated/ios/swift/CarrotQuestLogCategory.swift +64 -0
- package/nitrogen/generated/ios/swift/CarrotQuestLogEntry.swift +86 -0
- package/nitrogen/generated/ios/swift/CarrotQuestLogLevel.swift +56 -0
- package/nitrogen/generated/ios/swift/CarrotQuestProperty.swift +56 -0
- package/nitrogen/generated/ios/swift/CarrotQuestPropertyKind.swift +44 -0
- package/nitrogen/generated/ios/swift/CarrotQuestPropertyOperation.swift +60 -0
- package/nitrogen/generated/ios/swift/CarrotQuestSetupOptions.swift +172 -0
- package/nitrogen/generated/ios/swift/CarrotQuestTheme.swift +48 -0
- package/nitrogen/generated/ios/swift/CarrotQuestUrlSource.swift +48 -0
- package/nitrogen/generated/ios/swift/CarrotQuestUserProperties.swift +110 -0
- package/nitrogen/generated/ios/swift/Func_void.swift +46 -0
- package/nitrogen/generated/ios/swift/Func_void_CarrotQuestLogEntry.swift +46 -0
- package/nitrogen/generated/ios/swift/Func_void_bool.swift +46 -0
- package/nitrogen/generated/ios/swift/Func_void_double.swift +46 -0
- package/nitrogen/generated/ios/swift/Func_void_std__exception_ptr.swift +46 -0
- package/nitrogen/generated/ios/swift/Func_void_std__optional_double_.swift +53 -0
- package/nitrogen/generated/ios/swift/Func_void_std__optional_std__string_.swift +53 -0
- package/nitrogen/generated/ios/swift/Func_void_std__string.swift +46 -0
- package/nitrogen/generated/ios/swift/HybridCarrotQuestSpec.swift +88 -0
- package/nitrogen/generated/ios/swift/HybridCarrotQuestSpec_cxx.swift +674 -0
- package/nitrogen/generated/shared/c++/CarrotQuestLogCategory.hpp +100 -0
- package/nitrogen/generated/shared/c++/CarrotQuestLogEntry.hpp +114 -0
- package/nitrogen/generated/shared/c++/CarrotQuestLogLevel.hpp +92 -0
- package/nitrogen/generated/shared/c++/CarrotQuestProperty.hpp +101 -0
- package/nitrogen/generated/shared/c++/CarrotQuestPropertyKind.hpp +80 -0
- package/nitrogen/generated/shared/c++/CarrotQuestPropertyOperation.hpp +96 -0
- package/nitrogen/generated/shared/c++/CarrotQuestSetupOptions.hpp +121 -0
- package/nitrogen/generated/shared/c++/CarrotQuestTheme.hpp +84 -0
- package/nitrogen/generated/shared/c++/CarrotQuestUrlSource.hpp +84 -0
- package/nitrogen/generated/shared/c++/CarrotQuestUserProperties.hpp +97 -0
- package/nitrogen/generated/shared/c++/HybridCarrotQuestSpec.cpp +55 -0
- package/nitrogen/generated/shared/c++/HybridCarrotQuestSpec.hpp +118 -0
- package/package.json +140 -0
- package/src/CarrotQuest.nitro.ts +493 -0
- package/src/carrot-quest.native.tsx +241 -0
- package/src/carrot-quest.tsx +207 -0
- package/src/index.tsx +57 -0
- package/src/subscriptions.ts +83 -0
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
///
|
|
2
|
+
/// JCarrotQuestEventValue.cpp
|
|
3
|
+
/// This file was generated by nitrogen. DO NOT MODIFY THIS FILE.
|
|
4
|
+
/// https://github.com/mrousavy/nitro
|
|
5
|
+
/// Copyright © Marc Rousavy @ Margelo
|
|
6
|
+
///
|
|
7
|
+
|
|
8
|
+
#include "JCarrotQuestEventValue.hpp"
|
|
9
|
+
|
|
10
|
+
namespace margelo::nitro::carrotquest {
|
|
11
|
+
/**
|
|
12
|
+
* Converts JCarrotQuestEventValue to std::variant<bool, std::string, double>
|
|
13
|
+
*/
|
|
14
|
+
std::variant<bool, std::string, double> JCarrotQuestEventValue::toCpp() const {
|
|
15
|
+
if (isInstanceOf(JCarrotQuestEventValue_impl::First::javaClassStatic())) {
|
|
16
|
+
// It's a `bool`
|
|
17
|
+
auto jniValue = static_cast<const JCarrotQuestEventValue_impl::First*>(this)->getValue();
|
|
18
|
+
return static_cast<bool>(jniValue);
|
|
19
|
+
} else if (isInstanceOf(JCarrotQuestEventValue_impl::Second::javaClassStatic())) {
|
|
20
|
+
// It's a `std::string`
|
|
21
|
+
auto jniValue = static_cast<const JCarrotQuestEventValue_impl::Second*>(this)->getValue();
|
|
22
|
+
return jniValue->toStdString();
|
|
23
|
+
} else if (isInstanceOf(JCarrotQuestEventValue_impl::Third::javaClassStatic())) {
|
|
24
|
+
// It's a `double`
|
|
25
|
+
auto jniValue = static_cast<const JCarrotQuestEventValue_impl::Third*>(this)->getValue();
|
|
26
|
+
return jniValue;
|
|
27
|
+
}
|
|
28
|
+
throw std::invalid_argument("Variant is unknown Kotlin instance!");
|
|
29
|
+
}
|
|
30
|
+
} // namespace margelo::nitro::carrotquest
|
|
@@ -0,0 +1,83 @@
|
|
|
1
|
+
///
|
|
2
|
+
/// JCarrotQuestEventValue.hpp
|
|
3
|
+
/// This file was generated by nitrogen. DO NOT MODIFY THIS FILE.
|
|
4
|
+
/// https://github.com/mrousavy/nitro
|
|
5
|
+
/// Copyright © Marc Rousavy @ Margelo
|
|
6
|
+
///
|
|
7
|
+
|
|
8
|
+
#pragma once
|
|
9
|
+
|
|
10
|
+
#include <fbjni/fbjni.h>
|
|
11
|
+
#include <variant>
|
|
12
|
+
|
|
13
|
+
#include <string>
|
|
14
|
+
#include <variant>
|
|
15
|
+
|
|
16
|
+
namespace margelo::nitro::carrotquest {
|
|
17
|
+
|
|
18
|
+
using namespace facebook;
|
|
19
|
+
|
|
20
|
+
/**
|
|
21
|
+
* The C++ JNI bridge between the C++ std::variant and the Java class "CarrotQuestEventValue".
|
|
22
|
+
*/
|
|
23
|
+
class JCarrotQuestEventValue: public jni::JavaClass<JCarrotQuestEventValue> {
|
|
24
|
+
public:
|
|
25
|
+
static constexpr auto kJavaDescriptor = "Lcom/margelo/nitro/carrotquest/CarrotQuestEventValue;";
|
|
26
|
+
|
|
27
|
+
static jni::local_ref<JCarrotQuestEventValue> create_0(jboolean value) {
|
|
28
|
+
static const auto method = javaClassStatic()->getStaticMethod<JCarrotQuestEventValue(jboolean)>("create");
|
|
29
|
+
return method(javaClassStatic(), value);
|
|
30
|
+
}
|
|
31
|
+
static jni::local_ref<JCarrotQuestEventValue> create_1(jni::alias_ref<jni::JString> value) {
|
|
32
|
+
static const auto method = javaClassStatic()->getStaticMethod<JCarrotQuestEventValue(jni::alias_ref<jni::JString>)>("create");
|
|
33
|
+
return method(javaClassStatic(), value);
|
|
34
|
+
}
|
|
35
|
+
static jni::local_ref<JCarrotQuestEventValue> create_2(double value) {
|
|
36
|
+
static const auto method = javaClassStatic()->getStaticMethod<JCarrotQuestEventValue(double)>("create");
|
|
37
|
+
return method(javaClassStatic(), value);
|
|
38
|
+
}
|
|
39
|
+
|
|
40
|
+
static jni::local_ref<JCarrotQuestEventValue> fromCpp(const std::variant<bool, std::string, double>& variant) {
|
|
41
|
+
switch (variant.index()) {
|
|
42
|
+
case 0: return create_0(std::get<0>(variant));
|
|
43
|
+
case 1: return create_1(jni::make_jstring(std::get<1>(variant)));
|
|
44
|
+
case 2: return create_2(std::get<2>(variant));
|
|
45
|
+
default: throw std::invalid_argument("Variant holds unknown index! (" + std::to_string(variant.index()) + ")");
|
|
46
|
+
}
|
|
47
|
+
}
|
|
48
|
+
|
|
49
|
+
[[nodiscard]] std::variant<bool, std::string, double> toCpp() const;
|
|
50
|
+
};
|
|
51
|
+
|
|
52
|
+
namespace JCarrotQuestEventValue_impl {
|
|
53
|
+
class First final: public jni::JavaClass<First, JCarrotQuestEventValue> {
|
|
54
|
+
public:
|
|
55
|
+
static constexpr auto kJavaDescriptor = "Lcom/margelo/nitro/carrotquest/CarrotQuestEventValue$First;";
|
|
56
|
+
|
|
57
|
+
[[nodiscard]] jboolean getValue() const {
|
|
58
|
+
static const auto field = javaClassStatic()->getField<jboolean>("value");
|
|
59
|
+
return getFieldValue(field);
|
|
60
|
+
}
|
|
61
|
+
};
|
|
62
|
+
|
|
63
|
+
class Second final: public jni::JavaClass<Second, JCarrotQuestEventValue> {
|
|
64
|
+
public:
|
|
65
|
+
static constexpr auto kJavaDescriptor = "Lcom/margelo/nitro/carrotquest/CarrotQuestEventValue$Second;";
|
|
66
|
+
|
|
67
|
+
[[nodiscard]] jni::local_ref<jni::JString> getValue() const {
|
|
68
|
+
static const auto field = javaClassStatic()->getField<jni::JString>("value");
|
|
69
|
+
return getFieldValue(field);
|
|
70
|
+
}
|
|
71
|
+
};
|
|
72
|
+
|
|
73
|
+
class Third final: public jni::JavaClass<Third, JCarrotQuestEventValue> {
|
|
74
|
+
public:
|
|
75
|
+
static constexpr auto kJavaDescriptor = "Lcom/margelo/nitro/carrotquest/CarrotQuestEventValue$Third;";
|
|
76
|
+
|
|
77
|
+
[[nodiscard]] double getValue() const {
|
|
78
|
+
static const auto field = javaClassStatic()->getField<double>("value");
|
|
79
|
+
return getFieldValue(field);
|
|
80
|
+
}
|
|
81
|
+
};
|
|
82
|
+
} // namespace JCarrotQuestEventValue_impl
|
|
83
|
+
} // namespace margelo::nitro::carrotquest
|
|
@@ -0,0 +1,76 @@
|
|
|
1
|
+
///
|
|
2
|
+
/// JCarrotQuestLogCategory.hpp
|
|
3
|
+
/// This file was generated by nitrogen. DO NOT MODIFY THIS FILE.
|
|
4
|
+
/// https://github.com/mrousavy/nitro
|
|
5
|
+
/// Copyright © Marc Rousavy @ Margelo
|
|
6
|
+
///
|
|
7
|
+
|
|
8
|
+
#pragma once
|
|
9
|
+
|
|
10
|
+
#include <fbjni/fbjni.h>
|
|
11
|
+
#include "CarrotQuestLogCategory.hpp"
|
|
12
|
+
|
|
13
|
+
namespace margelo::nitro::carrotquest {
|
|
14
|
+
|
|
15
|
+
using namespace facebook;
|
|
16
|
+
|
|
17
|
+
/**
|
|
18
|
+
* The C++ JNI bridge between the C++ enum "CarrotQuestLogCategory" and the Kotlin enum "CarrotQuestLogCategory".
|
|
19
|
+
*/
|
|
20
|
+
struct JCarrotQuestLogCategory final: public jni::JavaClass<JCarrotQuestLogCategory> {
|
|
21
|
+
public:
|
|
22
|
+
static constexpr auto kJavaDescriptor = "Lcom/margelo/nitro/carrotquest/CarrotQuestLogCategory;";
|
|
23
|
+
|
|
24
|
+
public:
|
|
25
|
+
/**
|
|
26
|
+
* Convert this Java/Kotlin-based enum to the C++ enum CarrotQuestLogCategory.
|
|
27
|
+
*/
|
|
28
|
+
[[maybe_unused]]
|
|
29
|
+
[[nodiscard]]
|
|
30
|
+
CarrotQuestLogCategory toCpp() const {
|
|
31
|
+
static const auto clazz = javaClassStatic();
|
|
32
|
+
static const auto fieldOrdinal = clazz->getField<int>("value");
|
|
33
|
+
int ordinal = this->getFieldValue(fieldOrdinal);
|
|
34
|
+
return static_cast<CarrotQuestLogCategory>(ordinal);
|
|
35
|
+
}
|
|
36
|
+
|
|
37
|
+
public:
|
|
38
|
+
/**
|
|
39
|
+
* Create a Java/Kotlin-based enum with the given C++ enum's value.
|
|
40
|
+
*/
|
|
41
|
+
[[maybe_unused]]
|
|
42
|
+
static jni::alias_ref<JCarrotQuestLogCategory> fromCpp(CarrotQuestLogCategory value) {
|
|
43
|
+
static const auto clazz = javaClassStatic();
|
|
44
|
+
switch (value) {
|
|
45
|
+
case CarrotQuestLogCategory::PUSH:
|
|
46
|
+
static const auto fieldPUSH = clazz->getStaticField<JCarrotQuestLogCategory>("PUSH");
|
|
47
|
+
return clazz->getStaticFieldValue(fieldPUSH);
|
|
48
|
+
case CarrotQuestLogCategory::GENERAL:
|
|
49
|
+
static const auto fieldGENERAL = clazz->getStaticField<JCarrotQuestLogCategory>("GENERAL");
|
|
50
|
+
return clazz->getStaticFieldValue(fieldGENERAL);
|
|
51
|
+
case CarrotQuestLogCategory::NETWORK:
|
|
52
|
+
static const auto fieldNETWORK = clazz->getStaticField<JCarrotQuestLogCategory>("NETWORK");
|
|
53
|
+
return clazz->getStaticFieldValue(fieldNETWORK);
|
|
54
|
+
case CarrotQuestLogCategory::CONNECTIVITY:
|
|
55
|
+
static const auto fieldCONNECTIVITY = clazz->getStaticField<JCarrotQuestLogCategory>("CONNECTIVITY");
|
|
56
|
+
return clazz->getStaticFieldValue(fieldCONNECTIVITY);
|
|
57
|
+
case CarrotQuestLogCategory::AUTH:
|
|
58
|
+
static const auto fieldAUTH = clazz->getStaticField<JCarrotQuestLogCategory>("AUTH");
|
|
59
|
+
return clazz->getStaticFieldValue(fieldAUTH);
|
|
60
|
+
case CarrotQuestLogCategory::REALTIME:
|
|
61
|
+
static const auto fieldREALTIME = clazz->getStaticField<JCarrotQuestLogCategory>("REALTIME");
|
|
62
|
+
return clazz->getStaticFieldValue(fieldREALTIME);
|
|
63
|
+
case CarrotQuestLogCategory::LIFECYCLE:
|
|
64
|
+
static const auto fieldLIFECYCLE = clazz->getStaticField<JCarrotQuestLogCategory>("LIFECYCLE");
|
|
65
|
+
return clazz->getStaticFieldValue(fieldLIFECYCLE);
|
|
66
|
+
case CarrotQuestLogCategory::DATABASE:
|
|
67
|
+
static const auto fieldDATABASE = clazz->getStaticField<JCarrotQuestLogCategory>("DATABASE");
|
|
68
|
+
return clazz->getStaticFieldValue(fieldDATABASE);
|
|
69
|
+
default:
|
|
70
|
+
std::string stringValue = std::to_string(static_cast<int>(value));
|
|
71
|
+
throw std::invalid_argument("Invalid enum value (" + stringValue + "!");
|
|
72
|
+
}
|
|
73
|
+
}
|
|
74
|
+
};
|
|
75
|
+
|
|
76
|
+
} // namespace margelo::nitro::carrotquest
|
|
@@ -0,0 +1,100 @@
|
|
|
1
|
+
///
|
|
2
|
+
/// JCarrotQuestLogEntry.hpp
|
|
3
|
+
/// This file was generated by nitrogen. DO NOT MODIFY THIS FILE.
|
|
4
|
+
/// https://github.com/mrousavy/nitro
|
|
5
|
+
/// Copyright © Marc Rousavy @ Margelo
|
|
6
|
+
///
|
|
7
|
+
|
|
8
|
+
#pragma once
|
|
9
|
+
|
|
10
|
+
#include <fbjni/fbjni.h>
|
|
11
|
+
#include "CarrotQuestLogEntry.hpp"
|
|
12
|
+
|
|
13
|
+
#include "CarrotQuestLogCategory.hpp"
|
|
14
|
+
#include "CarrotQuestLogLevel.hpp"
|
|
15
|
+
#include "JCarrotQuestLogCategory.hpp"
|
|
16
|
+
#include "JCarrotQuestLogLevel.hpp"
|
|
17
|
+
#include <optional>
|
|
18
|
+
#include <string>
|
|
19
|
+
#include <unordered_map>
|
|
20
|
+
|
|
21
|
+
namespace margelo::nitro::carrotquest {
|
|
22
|
+
|
|
23
|
+
using namespace facebook;
|
|
24
|
+
|
|
25
|
+
/**
|
|
26
|
+
* The C++ JNI bridge between the C++ struct "CarrotQuestLogEntry" and the Kotlin data class "CarrotQuestLogEntry".
|
|
27
|
+
*/
|
|
28
|
+
struct JCarrotQuestLogEntry final: public jni::JavaClass<JCarrotQuestLogEntry> {
|
|
29
|
+
public:
|
|
30
|
+
static constexpr auto kJavaDescriptor = "Lcom/margelo/nitro/carrotquest/CarrotQuestLogEntry;";
|
|
31
|
+
|
|
32
|
+
public:
|
|
33
|
+
/**
|
|
34
|
+
* Convert this Java/Kotlin-based struct to the C++ struct CarrotQuestLogEntry by copying all values to C++.
|
|
35
|
+
*/
|
|
36
|
+
[[maybe_unused]]
|
|
37
|
+
[[nodiscard]]
|
|
38
|
+
CarrotQuestLogEntry toCpp() const {
|
|
39
|
+
static const auto clazz = javaClassStatic();
|
|
40
|
+
static const auto fieldTimestampMs = clazz->getField<double>("timestampMs");
|
|
41
|
+
double timestampMs = this->getFieldValue(fieldTimestampMs);
|
|
42
|
+
static const auto fieldLevel = clazz->getField<JCarrotQuestLogLevel>("level");
|
|
43
|
+
jni::local_ref<JCarrotQuestLogLevel> level = this->getFieldValue(fieldLevel);
|
|
44
|
+
static const auto fieldCategory = clazz->getField<JCarrotQuestLogCategory>("category");
|
|
45
|
+
jni::local_ref<JCarrotQuestLogCategory> category = this->getFieldValue(fieldCategory);
|
|
46
|
+
static const auto fieldTag = clazz->getField<jni::JString>("tag");
|
|
47
|
+
jni::local_ref<jni::JString> tag = this->getFieldValue(fieldTag);
|
|
48
|
+
static const auto fieldMessage = clazz->getField<jni::JString>("message");
|
|
49
|
+
jni::local_ref<jni::JString> message = this->getFieldValue(fieldMessage);
|
|
50
|
+
static const auto fieldFields = clazz->getField<jni::JMap<jni::JString, jni::JString>>("fields");
|
|
51
|
+
jni::local_ref<jni::JMap<jni::JString, jni::JString>> fields = this->getFieldValue(fieldFields);
|
|
52
|
+
static const auto fieldError = clazz->getField<jni::JString>("error");
|
|
53
|
+
jni::local_ref<jni::JString> error = this->getFieldValue(fieldError);
|
|
54
|
+
return CarrotQuestLogEntry(
|
|
55
|
+
timestampMs,
|
|
56
|
+
level->toCpp(),
|
|
57
|
+
category->toCpp(),
|
|
58
|
+
tag->toStdString(),
|
|
59
|
+
message->toStdString(),
|
|
60
|
+
[&]() {
|
|
61
|
+
std::unordered_map<std::string, std::string> __map;
|
|
62
|
+
__map.reserve(fields->size());
|
|
63
|
+
for (const auto& __entry : *fields) {
|
|
64
|
+
__map.emplace(__entry.first->toStdString(), __entry.second->toStdString());
|
|
65
|
+
}
|
|
66
|
+
return __map;
|
|
67
|
+
}(),
|
|
68
|
+
error != nullptr ? std::make_optional(error->toStdString()) : std::nullopt
|
|
69
|
+
);
|
|
70
|
+
}
|
|
71
|
+
|
|
72
|
+
public:
|
|
73
|
+
/**
|
|
74
|
+
* Create a Java/Kotlin-based struct by copying all values from the given C++ struct to Java.
|
|
75
|
+
*/
|
|
76
|
+
[[maybe_unused]]
|
|
77
|
+
static jni::local_ref<JCarrotQuestLogEntry::javaobject> fromCpp(const CarrotQuestLogEntry& value) {
|
|
78
|
+
using JSignature = JCarrotQuestLogEntry(double, jni::alias_ref<JCarrotQuestLogLevel>, jni::alias_ref<JCarrotQuestLogCategory>, jni::alias_ref<jni::JString>, jni::alias_ref<jni::JString>, jni::alias_ref<jni::JMap<jni::JString, jni::JString>>, jni::alias_ref<jni::JString>);
|
|
79
|
+
static const auto clazz = javaClassStatic();
|
|
80
|
+
static const auto create = clazz->getStaticMethod<JSignature>("fromCpp");
|
|
81
|
+
return create(
|
|
82
|
+
clazz,
|
|
83
|
+
value.timestampMs,
|
|
84
|
+
JCarrotQuestLogLevel::fromCpp(value.level),
|
|
85
|
+
JCarrotQuestLogCategory::fromCpp(value.category),
|
|
86
|
+
jni::make_jstring(value.tag),
|
|
87
|
+
jni::make_jstring(value.message),
|
|
88
|
+
[&]() -> jni::local_ref<jni::JMap<jni::JString, jni::JString>> {
|
|
89
|
+
auto __map = jni::JHashMap<jni::JString, jni::JString>::create(value.fields.size());
|
|
90
|
+
for (const auto& __entry : value.fields) {
|
|
91
|
+
__map->put(jni::make_jstring(__entry.first), jni::make_jstring(__entry.second));
|
|
92
|
+
}
|
|
93
|
+
return __map;
|
|
94
|
+
}(),
|
|
95
|
+
value.error.has_value() ? jni::make_jstring(value.error.value()) : nullptr
|
|
96
|
+
);
|
|
97
|
+
}
|
|
98
|
+
};
|
|
99
|
+
|
|
100
|
+
} // namespace margelo::nitro::carrotquest
|
|
@@ -0,0 +1,70 @@
|
|
|
1
|
+
///
|
|
2
|
+
/// JCarrotQuestLogLevel.hpp
|
|
3
|
+
/// This file was generated by nitrogen. DO NOT MODIFY THIS FILE.
|
|
4
|
+
/// https://github.com/mrousavy/nitro
|
|
5
|
+
/// Copyright © Marc Rousavy @ Margelo
|
|
6
|
+
///
|
|
7
|
+
|
|
8
|
+
#pragma once
|
|
9
|
+
|
|
10
|
+
#include <fbjni/fbjni.h>
|
|
11
|
+
#include "CarrotQuestLogLevel.hpp"
|
|
12
|
+
|
|
13
|
+
namespace margelo::nitro::carrotquest {
|
|
14
|
+
|
|
15
|
+
using namespace facebook;
|
|
16
|
+
|
|
17
|
+
/**
|
|
18
|
+
* The C++ JNI bridge between the C++ enum "CarrotQuestLogLevel" and the Kotlin enum "CarrotQuestLogLevel".
|
|
19
|
+
*/
|
|
20
|
+
struct JCarrotQuestLogLevel final: public jni::JavaClass<JCarrotQuestLogLevel> {
|
|
21
|
+
public:
|
|
22
|
+
static constexpr auto kJavaDescriptor = "Lcom/margelo/nitro/carrotquest/CarrotQuestLogLevel;";
|
|
23
|
+
|
|
24
|
+
public:
|
|
25
|
+
/**
|
|
26
|
+
* Convert this Java/Kotlin-based enum to the C++ enum CarrotQuestLogLevel.
|
|
27
|
+
*/
|
|
28
|
+
[[maybe_unused]]
|
|
29
|
+
[[nodiscard]]
|
|
30
|
+
CarrotQuestLogLevel toCpp() const {
|
|
31
|
+
static const auto clazz = javaClassStatic();
|
|
32
|
+
static const auto fieldOrdinal = clazz->getField<int>("value");
|
|
33
|
+
int ordinal = this->getFieldValue(fieldOrdinal);
|
|
34
|
+
return static_cast<CarrotQuestLogLevel>(ordinal);
|
|
35
|
+
}
|
|
36
|
+
|
|
37
|
+
public:
|
|
38
|
+
/**
|
|
39
|
+
* Create a Java/Kotlin-based enum with the given C++ enum's value.
|
|
40
|
+
*/
|
|
41
|
+
[[maybe_unused]]
|
|
42
|
+
static jni::alias_ref<JCarrotQuestLogLevel> fromCpp(CarrotQuestLogLevel value) {
|
|
43
|
+
static const auto clazz = javaClassStatic();
|
|
44
|
+
switch (value) {
|
|
45
|
+
case CarrotQuestLogLevel::NONE:
|
|
46
|
+
static const auto fieldNONE = clazz->getStaticField<JCarrotQuestLogLevel>("NONE");
|
|
47
|
+
return clazz->getStaticFieldValue(fieldNONE);
|
|
48
|
+
case CarrotQuestLogLevel::ERROR:
|
|
49
|
+
static const auto fieldERROR = clazz->getStaticField<JCarrotQuestLogLevel>("ERROR");
|
|
50
|
+
return clazz->getStaticFieldValue(fieldERROR);
|
|
51
|
+
case CarrotQuestLogLevel::WARN:
|
|
52
|
+
static const auto fieldWARN = clazz->getStaticField<JCarrotQuestLogLevel>("WARN");
|
|
53
|
+
return clazz->getStaticFieldValue(fieldWARN);
|
|
54
|
+
case CarrotQuestLogLevel::INFO:
|
|
55
|
+
static const auto fieldINFO = clazz->getStaticField<JCarrotQuestLogLevel>("INFO");
|
|
56
|
+
return clazz->getStaticFieldValue(fieldINFO);
|
|
57
|
+
case CarrotQuestLogLevel::DEBUGGING:
|
|
58
|
+
static const auto fieldDEBUGGING = clazz->getStaticField<JCarrotQuestLogLevel>("DEBUGGING");
|
|
59
|
+
return clazz->getStaticFieldValue(fieldDEBUGGING);
|
|
60
|
+
case CarrotQuestLogLevel::VERBOSE:
|
|
61
|
+
static const auto fieldVERBOSE = clazz->getStaticField<JCarrotQuestLogLevel>("VERBOSE");
|
|
62
|
+
return clazz->getStaticFieldValue(fieldVERBOSE);
|
|
63
|
+
default:
|
|
64
|
+
std::string stringValue = std::to_string(static_cast<int>(value));
|
|
65
|
+
throw std::invalid_argument("Invalid enum value (" + stringValue + "!");
|
|
66
|
+
}
|
|
67
|
+
}
|
|
68
|
+
};
|
|
69
|
+
|
|
70
|
+
} // namespace margelo::nitro::carrotquest
|
|
@@ -0,0 +1,74 @@
|
|
|
1
|
+
///
|
|
2
|
+
/// JCarrotQuestProperty.hpp
|
|
3
|
+
/// This file was generated by nitrogen. DO NOT MODIFY THIS FILE.
|
|
4
|
+
/// https://github.com/mrousavy/nitro
|
|
5
|
+
/// Copyright © Marc Rousavy @ Margelo
|
|
6
|
+
///
|
|
7
|
+
|
|
8
|
+
#pragma once
|
|
9
|
+
|
|
10
|
+
#include <fbjni/fbjni.h>
|
|
11
|
+
#include "CarrotQuestProperty.hpp"
|
|
12
|
+
|
|
13
|
+
#include "CarrotQuestPropertyKind.hpp"
|
|
14
|
+
#include "CarrotQuestPropertyOperation.hpp"
|
|
15
|
+
#include "JCarrotQuestPropertyKind.hpp"
|
|
16
|
+
#include "JCarrotQuestPropertyOperation.hpp"
|
|
17
|
+
#include <optional>
|
|
18
|
+
#include <string>
|
|
19
|
+
|
|
20
|
+
namespace margelo::nitro::carrotquest {
|
|
21
|
+
|
|
22
|
+
using namespace facebook;
|
|
23
|
+
|
|
24
|
+
/**
|
|
25
|
+
* The C++ JNI bridge between the C++ struct "CarrotQuestProperty" and the Kotlin data class "CarrotQuestProperty".
|
|
26
|
+
*/
|
|
27
|
+
struct JCarrotQuestProperty final: public jni::JavaClass<JCarrotQuestProperty> {
|
|
28
|
+
public:
|
|
29
|
+
static constexpr auto kJavaDescriptor = "Lcom/margelo/nitro/carrotquest/CarrotQuestProperty;";
|
|
30
|
+
|
|
31
|
+
public:
|
|
32
|
+
/**
|
|
33
|
+
* Convert this Java/Kotlin-based struct to the C++ struct CarrotQuestProperty by copying all values to C++.
|
|
34
|
+
*/
|
|
35
|
+
[[maybe_unused]]
|
|
36
|
+
[[nodiscard]]
|
|
37
|
+
CarrotQuestProperty toCpp() const {
|
|
38
|
+
static const auto clazz = javaClassStatic();
|
|
39
|
+
static const auto fieldKey = clazz->getField<jni::JString>("key");
|
|
40
|
+
jni::local_ref<jni::JString> key = this->getFieldValue(fieldKey);
|
|
41
|
+
static const auto fieldValue = clazz->getField<jni::JString>("value");
|
|
42
|
+
jni::local_ref<jni::JString> value = this->getFieldValue(fieldValue);
|
|
43
|
+
static const auto fieldOperation = clazz->getField<JCarrotQuestPropertyOperation>("operation");
|
|
44
|
+
jni::local_ref<JCarrotQuestPropertyOperation> operation = this->getFieldValue(fieldOperation);
|
|
45
|
+
static const auto fieldKind = clazz->getField<JCarrotQuestPropertyKind>("kind");
|
|
46
|
+
jni::local_ref<JCarrotQuestPropertyKind> kind = this->getFieldValue(fieldKind);
|
|
47
|
+
return CarrotQuestProperty(
|
|
48
|
+
key->toStdString(),
|
|
49
|
+
value->toStdString(),
|
|
50
|
+
operation != nullptr ? std::make_optional(operation->toCpp()) : std::nullopt,
|
|
51
|
+
kind != nullptr ? std::make_optional(kind->toCpp()) : std::nullopt
|
|
52
|
+
);
|
|
53
|
+
}
|
|
54
|
+
|
|
55
|
+
public:
|
|
56
|
+
/**
|
|
57
|
+
* Create a Java/Kotlin-based struct by copying all values from the given C++ struct to Java.
|
|
58
|
+
*/
|
|
59
|
+
[[maybe_unused]]
|
|
60
|
+
static jni::local_ref<JCarrotQuestProperty::javaobject> fromCpp(const CarrotQuestProperty& value) {
|
|
61
|
+
using JSignature = JCarrotQuestProperty(jni::alias_ref<jni::JString>, jni::alias_ref<jni::JString>, jni::alias_ref<JCarrotQuestPropertyOperation>, jni::alias_ref<JCarrotQuestPropertyKind>);
|
|
62
|
+
static const auto clazz = javaClassStatic();
|
|
63
|
+
static const auto create = clazz->getStaticMethod<JSignature>("fromCpp");
|
|
64
|
+
return create(
|
|
65
|
+
clazz,
|
|
66
|
+
jni::make_jstring(value.key),
|
|
67
|
+
jni::make_jstring(value.value),
|
|
68
|
+
value.operation.has_value() ? JCarrotQuestPropertyOperation::fromCpp(value.operation.value()) : nullptr,
|
|
69
|
+
value.kind.has_value() ? JCarrotQuestPropertyKind::fromCpp(value.kind.value()) : nullptr
|
|
70
|
+
);
|
|
71
|
+
}
|
|
72
|
+
};
|
|
73
|
+
|
|
74
|
+
} // namespace margelo::nitro::carrotquest
|
|
@@ -0,0 +1,61 @@
|
|
|
1
|
+
///
|
|
2
|
+
/// JCarrotQuestPropertyKind.hpp
|
|
3
|
+
/// This file was generated by nitrogen. DO NOT MODIFY THIS FILE.
|
|
4
|
+
/// https://github.com/mrousavy/nitro
|
|
5
|
+
/// Copyright © Marc Rousavy @ Margelo
|
|
6
|
+
///
|
|
7
|
+
|
|
8
|
+
#pragma once
|
|
9
|
+
|
|
10
|
+
#include <fbjni/fbjni.h>
|
|
11
|
+
#include "CarrotQuestPropertyKind.hpp"
|
|
12
|
+
|
|
13
|
+
namespace margelo::nitro::carrotquest {
|
|
14
|
+
|
|
15
|
+
using namespace facebook;
|
|
16
|
+
|
|
17
|
+
/**
|
|
18
|
+
* The C++ JNI bridge between the C++ enum "CarrotQuestPropertyKind" and the Kotlin enum "CarrotQuestPropertyKind".
|
|
19
|
+
*/
|
|
20
|
+
struct JCarrotQuestPropertyKind final: public jni::JavaClass<JCarrotQuestPropertyKind> {
|
|
21
|
+
public:
|
|
22
|
+
static constexpr auto kJavaDescriptor = "Lcom/margelo/nitro/carrotquest/CarrotQuestPropertyKind;";
|
|
23
|
+
|
|
24
|
+
public:
|
|
25
|
+
/**
|
|
26
|
+
* Convert this Java/Kotlin-based enum to the C++ enum CarrotQuestPropertyKind.
|
|
27
|
+
*/
|
|
28
|
+
[[maybe_unused]]
|
|
29
|
+
[[nodiscard]]
|
|
30
|
+
CarrotQuestPropertyKind toCpp() const {
|
|
31
|
+
static const auto clazz = javaClassStatic();
|
|
32
|
+
static const auto fieldOrdinal = clazz->getField<int>("value");
|
|
33
|
+
int ordinal = this->getFieldValue(fieldOrdinal);
|
|
34
|
+
return static_cast<CarrotQuestPropertyKind>(ordinal);
|
|
35
|
+
}
|
|
36
|
+
|
|
37
|
+
public:
|
|
38
|
+
/**
|
|
39
|
+
* Create a Java/Kotlin-based enum with the given C++ enum's value.
|
|
40
|
+
*/
|
|
41
|
+
[[maybe_unused]]
|
|
42
|
+
static jni::alias_ref<JCarrotQuestPropertyKind> fromCpp(CarrotQuestPropertyKind value) {
|
|
43
|
+
static const auto clazz = javaClassStatic();
|
|
44
|
+
switch (value) {
|
|
45
|
+
case CarrotQuestPropertyKind::CUSTOM:
|
|
46
|
+
static const auto fieldCUSTOM = clazz->getStaticField<JCarrotQuestPropertyKind>("CUSTOM");
|
|
47
|
+
return clazz->getStaticFieldValue(fieldCUSTOM);
|
|
48
|
+
case CarrotQuestPropertyKind::SYSTEM:
|
|
49
|
+
static const auto fieldSYSTEM = clazz->getStaticField<JCarrotQuestPropertyKind>("SYSTEM");
|
|
50
|
+
return clazz->getStaticFieldValue(fieldSYSTEM);
|
|
51
|
+
case CarrotQuestPropertyKind::ECOMMERCE:
|
|
52
|
+
static const auto fieldECOMMERCE = clazz->getStaticField<JCarrotQuestPropertyKind>("ECOMMERCE");
|
|
53
|
+
return clazz->getStaticFieldValue(fieldECOMMERCE);
|
|
54
|
+
default:
|
|
55
|
+
std::string stringValue = std::to_string(static_cast<int>(value));
|
|
56
|
+
throw std::invalid_argument("Invalid enum value (" + stringValue + "!");
|
|
57
|
+
}
|
|
58
|
+
}
|
|
59
|
+
};
|
|
60
|
+
|
|
61
|
+
} // namespace margelo::nitro::carrotquest
|
|
@@ -0,0 +1,73 @@
|
|
|
1
|
+
///
|
|
2
|
+
/// JCarrotQuestPropertyOperation.hpp
|
|
3
|
+
/// This file was generated by nitrogen. DO NOT MODIFY THIS FILE.
|
|
4
|
+
/// https://github.com/mrousavy/nitro
|
|
5
|
+
/// Copyright © Marc Rousavy @ Margelo
|
|
6
|
+
///
|
|
7
|
+
|
|
8
|
+
#pragma once
|
|
9
|
+
|
|
10
|
+
#include <fbjni/fbjni.h>
|
|
11
|
+
#include "CarrotQuestPropertyOperation.hpp"
|
|
12
|
+
|
|
13
|
+
namespace margelo::nitro::carrotquest {
|
|
14
|
+
|
|
15
|
+
using namespace facebook;
|
|
16
|
+
|
|
17
|
+
/**
|
|
18
|
+
* The C++ JNI bridge between the C++ enum "CarrotQuestPropertyOperation" and the Kotlin enum "CarrotQuestPropertyOperation".
|
|
19
|
+
*/
|
|
20
|
+
struct JCarrotQuestPropertyOperation final: public jni::JavaClass<JCarrotQuestPropertyOperation> {
|
|
21
|
+
public:
|
|
22
|
+
static constexpr auto kJavaDescriptor = "Lcom/margelo/nitro/carrotquest/CarrotQuestPropertyOperation;";
|
|
23
|
+
|
|
24
|
+
public:
|
|
25
|
+
/**
|
|
26
|
+
* Convert this Java/Kotlin-based enum to the C++ enum CarrotQuestPropertyOperation.
|
|
27
|
+
*/
|
|
28
|
+
[[maybe_unused]]
|
|
29
|
+
[[nodiscard]]
|
|
30
|
+
CarrotQuestPropertyOperation toCpp() const {
|
|
31
|
+
static const auto clazz = javaClassStatic();
|
|
32
|
+
static const auto fieldOrdinal = clazz->getField<int>("value");
|
|
33
|
+
int ordinal = this->getFieldValue(fieldOrdinal);
|
|
34
|
+
return static_cast<CarrotQuestPropertyOperation>(ordinal);
|
|
35
|
+
}
|
|
36
|
+
|
|
37
|
+
public:
|
|
38
|
+
/**
|
|
39
|
+
* Create a Java/Kotlin-based enum with the given C++ enum's value.
|
|
40
|
+
*/
|
|
41
|
+
[[maybe_unused]]
|
|
42
|
+
static jni::alias_ref<JCarrotQuestPropertyOperation> fromCpp(CarrotQuestPropertyOperation value) {
|
|
43
|
+
static const auto clazz = javaClassStatic();
|
|
44
|
+
switch (value) {
|
|
45
|
+
case CarrotQuestPropertyOperation::UPDATEORCREATE:
|
|
46
|
+
static const auto fieldUPDATEORCREATE = clazz->getStaticField<JCarrotQuestPropertyOperation>("UPDATEORCREATE");
|
|
47
|
+
return clazz->getStaticFieldValue(fieldUPDATEORCREATE);
|
|
48
|
+
case CarrotQuestPropertyOperation::SETONCE:
|
|
49
|
+
static const auto fieldSETONCE = clazz->getStaticField<JCarrotQuestPropertyOperation>("SETONCE");
|
|
50
|
+
return clazz->getStaticFieldValue(fieldSETONCE);
|
|
51
|
+
case CarrotQuestPropertyOperation::ADD:
|
|
52
|
+
static const auto fieldADD = clazz->getStaticField<JCarrotQuestPropertyOperation>("ADD");
|
|
53
|
+
return clazz->getStaticFieldValue(fieldADD);
|
|
54
|
+
case CarrotQuestPropertyOperation::DELETE:
|
|
55
|
+
static const auto fieldDELETE = clazz->getStaticField<JCarrotQuestPropertyOperation>("DELETE");
|
|
56
|
+
return clazz->getStaticFieldValue(fieldDELETE);
|
|
57
|
+
case CarrotQuestPropertyOperation::APPEND:
|
|
58
|
+
static const auto fieldAPPEND = clazz->getStaticField<JCarrotQuestPropertyOperation>("APPEND");
|
|
59
|
+
return clazz->getStaticFieldValue(fieldAPPEND);
|
|
60
|
+
case CarrotQuestPropertyOperation::UNION:
|
|
61
|
+
static const auto fieldUNION = clazz->getStaticField<JCarrotQuestPropertyOperation>("UNION");
|
|
62
|
+
return clazz->getStaticFieldValue(fieldUNION);
|
|
63
|
+
case CarrotQuestPropertyOperation::EXCLUDE:
|
|
64
|
+
static const auto fieldEXCLUDE = clazz->getStaticField<JCarrotQuestPropertyOperation>("EXCLUDE");
|
|
65
|
+
return clazz->getStaticFieldValue(fieldEXCLUDE);
|
|
66
|
+
default:
|
|
67
|
+
std::string stringValue = std::to_string(static_cast<int>(value));
|
|
68
|
+
throw std::invalid_argument("Invalid enum value (" + stringValue + "!");
|
|
69
|
+
}
|
|
70
|
+
}
|
|
71
|
+
};
|
|
72
|
+
|
|
73
|
+
} // namespace margelo::nitro::carrotquest
|
|
@@ -0,0 +1,94 @@
|
|
|
1
|
+
///
|
|
2
|
+
/// JCarrotQuestSetupOptions.hpp
|
|
3
|
+
/// This file was generated by nitrogen. DO NOT MODIFY THIS FILE.
|
|
4
|
+
/// https://github.com/mrousavy/nitro
|
|
5
|
+
/// Copyright © Marc Rousavy @ Margelo
|
|
6
|
+
///
|
|
7
|
+
|
|
8
|
+
#pragma once
|
|
9
|
+
|
|
10
|
+
#include <fbjni/fbjni.h>
|
|
11
|
+
#include "CarrotQuestSetupOptions.hpp"
|
|
12
|
+
|
|
13
|
+
#include "CarrotQuestLogLevel.hpp"
|
|
14
|
+
#include "CarrotQuestTheme.hpp"
|
|
15
|
+
#include "JCarrotQuestLogLevel.hpp"
|
|
16
|
+
#include "JCarrotQuestTheme.hpp"
|
|
17
|
+
#include <optional>
|
|
18
|
+
#include <string>
|
|
19
|
+
|
|
20
|
+
namespace margelo::nitro::carrotquest {
|
|
21
|
+
|
|
22
|
+
using namespace facebook;
|
|
23
|
+
|
|
24
|
+
/**
|
|
25
|
+
* The C++ JNI bridge between the C++ struct "CarrotQuestSetupOptions" and the Kotlin data class "CarrotQuestSetupOptions".
|
|
26
|
+
*/
|
|
27
|
+
struct JCarrotQuestSetupOptions final: public jni::JavaClass<JCarrotQuestSetupOptions> {
|
|
28
|
+
public:
|
|
29
|
+
static constexpr auto kJavaDescriptor = "Lcom/margelo/nitro/carrotquest/CarrotQuestSetupOptions;";
|
|
30
|
+
|
|
31
|
+
public:
|
|
32
|
+
/**
|
|
33
|
+
* Convert this Java/Kotlin-based struct to the C++ struct CarrotQuestSetupOptions by copying all values to C++.
|
|
34
|
+
*/
|
|
35
|
+
[[maybe_unused]]
|
|
36
|
+
[[nodiscard]]
|
|
37
|
+
CarrotQuestSetupOptions toCpp() const {
|
|
38
|
+
static const auto clazz = javaClassStatic();
|
|
39
|
+
static const auto fieldLocale = clazz->getField<jni::JString>("locale");
|
|
40
|
+
jni::local_ref<jni::JString> locale = this->getFieldValue(fieldLocale);
|
|
41
|
+
static const auto fieldTheme = clazz->getField<JCarrotQuestTheme>("theme");
|
|
42
|
+
jni::local_ref<JCarrotQuestTheme> theme = this->getFieldValue(fieldTheme);
|
|
43
|
+
static const auto fieldUseEuServer = clazz->getField<jni::JBoolean>("useEuServer");
|
|
44
|
+
jni::local_ref<jni::JBoolean> useEuServer = this->getFieldValue(fieldUseEuServer);
|
|
45
|
+
static const auto fieldAppGroup = clazz->getField<jni::JString>("appGroup");
|
|
46
|
+
jni::local_ref<jni::JString> appGroup = this->getFieldValue(fieldAppGroup);
|
|
47
|
+
static const auto fieldIsServiceMode = clazz->getField<jni::JBoolean>("isServiceMode");
|
|
48
|
+
jni::local_ref<jni::JBoolean> isServiceMode = this->getFieldValue(fieldIsServiceMode);
|
|
49
|
+
static const auto fieldParentActivityClassName = clazz->getField<jni::JString>("parentActivityClassName");
|
|
50
|
+
jni::local_ref<jni::JString> parentActivityClassName = this->getFieldValue(fieldParentActivityClassName);
|
|
51
|
+
static const auto fieldNotificationIconResourceName = clazz->getField<jni::JString>("notificationIconResourceName");
|
|
52
|
+
jni::local_ref<jni::JString> notificationIconResourceName = this->getFieldValue(fieldNotificationIconResourceName);
|
|
53
|
+
static const auto fieldLogLevel = clazz->getField<JCarrotQuestLogLevel>("logLevel");
|
|
54
|
+
jni::local_ref<JCarrotQuestLogLevel> logLevel = this->getFieldValue(fieldLogLevel);
|
|
55
|
+
static const auto fieldLogIncludeSensitive = clazz->getField<jni::JBoolean>("logIncludeSensitive");
|
|
56
|
+
jni::local_ref<jni::JBoolean> logIncludeSensitive = this->getFieldValue(fieldLogIncludeSensitive);
|
|
57
|
+
return CarrotQuestSetupOptions(
|
|
58
|
+
locale != nullptr ? std::make_optional(locale->toStdString()) : std::nullopt,
|
|
59
|
+
theme != nullptr ? std::make_optional(theme->toCpp()) : std::nullopt,
|
|
60
|
+
useEuServer != nullptr ? std::make_optional(static_cast<bool>(useEuServer->value())) : std::nullopt,
|
|
61
|
+
appGroup != nullptr ? std::make_optional(appGroup->toStdString()) : std::nullopt,
|
|
62
|
+
isServiceMode != nullptr ? std::make_optional(static_cast<bool>(isServiceMode->value())) : std::nullopt,
|
|
63
|
+
parentActivityClassName != nullptr ? std::make_optional(parentActivityClassName->toStdString()) : std::nullopt,
|
|
64
|
+
notificationIconResourceName != nullptr ? std::make_optional(notificationIconResourceName->toStdString()) : std::nullopt,
|
|
65
|
+
logLevel != nullptr ? std::make_optional(logLevel->toCpp()) : std::nullopt,
|
|
66
|
+
logIncludeSensitive != nullptr ? std::make_optional(static_cast<bool>(logIncludeSensitive->value())) : std::nullopt
|
|
67
|
+
);
|
|
68
|
+
}
|
|
69
|
+
|
|
70
|
+
public:
|
|
71
|
+
/**
|
|
72
|
+
* Create a Java/Kotlin-based struct by copying all values from the given C++ struct to Java.
|
|
73
|
+
*/
|
|
74
|
+
[[maybe_unused]]
|
|
75
|
+
static jni::local_ref<JCarrotQuestSetupOptions::javaobject> fromCpp(const CarrotQuestSetupOptions& value) {
|
|
76
|
+
using JSignature = JCarrotQuestSetupOptions(jni::alias_ref<jni::JString>, jni::alias_ref<JCarrotQuestTheme>, jni::alias_ref<jni::JBoolean>, jni::alias_ref<jni::JString>, jni::alias_ref<jni::JBoolean>, jni::alias_ref<jni::JString>, jni::alias_ref<jni::JString>, jni::alias_ref<JCarrotQuestLogLevel>, jni::alias_ref<jni::JBoolean>);
|
|
77
|
+
static const auto clazz = javaClassStatic();
|
|
78
|
+
static const auto create = clazz->getStaticMethod<JSignature>("fromCpp");
|
|
79
|
+
return create(
|
|
80
|
+
clazz,
|
|
81
|
+
value.locale.has_value() ? jni::make_jstring(value.locale.value()) : nullptr,
|
|
82
|
+
value.theme.has_value() ? JCarrotQuestTheme::fromCpp(value.theme.value()) : nullptr,
|
|
83
|
+
value.useEuServer.has_value() ? jni::JBoolean::valueOf(value.useEuServer.value()) : nullptr,
|
|
84
|
+
value.appGroup.has_value() ? jni::make_jstring(value.appGroup.value()) : nullptr,
|
|
85
|
+
value.isServiceMode.has_value() ? jni::JBoolean::valueOf(value.isServiceMode.value()) : nullptr,
|
|
86
|
+
value.parentActivityClassName.has_value() ? jni::make_jstring(value.parentActivityClassName.value()) : nullptr,
|
|
87
|
+
value.notificationIconResourceName.has_value() ? jni::make_jstring(value.notificationIconResourceName.value()) : nullptr,
|
|
88
|
+
value.logLevel.has_value() ? JCarrotQuestLogLevel::fromCpp(value.logLevel.value()) : nullptr,
|
|
89
|
+
value.logIncludeSensitive.has_value() ? jni::JBoolean::valueOf(value.logIncludeSensitive.value()) : nullptr
|
|
90
|
+
);
|
|
91
|
+
}
|
|
92
|
+
};
|
|
93
|
+
|
|
94
|
+
} // namespace margelo::nitro::carrotquest
|