react-native-nitro-input 0.2.0 → 0.3.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/CHANGELOG.md +38 -0
- package/README.md +43 -1
- package/android/CMakeLists.txt +4 -0
- package/android/gradle.properties +1 -1
- package/android/src/main/cpp/JRollingEngine.cpp +3 -2
- package/android/src/main/java/com/margelo/nitro/nitroinput/HybridNitroInputView.kt +20 -0
- package/android/src/main/java/com/margelo/nitro/nitroinput/HybridNitroNumberFormatPlatform.kt +209 -0
- package/android/src/main/java/com/margelo/nitro/nitroinput/HybridNitroNumberView.kt +25 -0
- package/android/src/main/java/com/margelo/nitro/nitroinput/NitroInputView.kt +69 -10
- package/android/src/main/java/com/margelo/nitro/nitroinput/NitroNumberView.kt +164 -24
- package/android/src/main/java/com/margelo/nitro/nitroinput/RollingEngine.kt +2 -1
- package/cpp/RollingEngine.cpp +12 -2
- package/cpp/RollingEngine.hpp +8 -1
- package/cpp/numberformat/HybridNitroNumberFormat.cpp +498 -0
- package/cpp/numberformat/HybridNitroNumberFormat.hpp +74 -0
- package/cpp/numberformat/HybridNitroNumberFormatFactory.hpp +11 -0
- package/cpp/numberformat/NumberFormatCore.cpp +629 -0
- package/cpp/numberformat/NumberFormatCore.hpp +154 -0
- package/cpp/numberformat/NumberFormatProbe.cpp +354 -0
- package/cpp/numberformat/NumberFormatProbe.hpp +63 -0
- package/ios/HybridNitroInputView.swift +15 -0
- package/ios/HybridNitroNumberFormatPlatform.swift +348 -0
- package/ios/HybridNitroNumberView.swift +19 -0
- package/ios/NitroInputView.swift +79 -19
- package/ios/NitroNumberView.swift +171 -31
- package/lib/commonjs/nitrogen/generated/shared/json/NitroInputViewConfig.json +5 -0
- package/lib/commonjs/nitrogen/generated/shared/json/NitroNumberViewConfig.json +6 -0
- package/lib/commonjs/src/NitroInput.js +8 -6
- package/lib/commonjs/src/NitroNumber.js +4 -2
- package/lib/commonjs/src/NumberFormat.js +525 -0
- package/lib/commonjs/src/formatProps.js +48 -0
- package/lib/commonjs/src/index.js +3 -1
- package/lib/commonjs/src/specs/NumberFormat.nitro.js +2 -0
- package/lib/module/nitrogen/generated/shared/json/NitroInputViewConfig.json +5 -0
- package/lib/module/nitrogen/generated/shared/json/NitroNumberViewConfig.json +6 -0
- package/lib/module/src/NitroInput.js +8 -6
- package/lib/module/src/NitroNumber.js +4 -2
- package/lib/module/src/NumberFormat.js +521 -0
- package/lib/module/src/formatProps.js +45 -0
- package/lib/module/src/index.js +1 -0
- package/lib/module/src/specs/NumberFormat.nitro.js +1 -0
- package/lib/typescript/src/NitroInput.d.ts +22 -0
- package/lib/typescript/src/NitroNumber.d.ts +36 -1
- package/lib/typescript/src/NumberFormat.d.ts +47 -0
- package/lib/typescript/src/formatProps.d.ts +21 -0
- package/lib/typescript/src/index.d.ts +2 -0
- package/lib/typescript/src/specs/NitroInput.nitro.d.ts +10 -0
- package/lib/typescript/src/specs/NitroNumber.nitro.d.ts +13 -1
- package/lib/typescript/src/specs/NumberFormat.nitro.d.ts +139 -0
- package/nitro.json +16 -0
- package/nitrogen/generated/android/NitroInput+autolinking.cmake +6 -0
- package/nitrogen/generated/android/NitroInputOnLoad.cpp +28 -0
- package/nitrogen/generated/android/c++/JHybridNitroInputViewSpec.cpp +45 -0
- package/nitrogen/generated/android/c++/JHybridNitroInputViewSpec.hpp +10 -0
- package/nitrogen/generated/android/c++/JHybridNitroNumberFormatPlatformSpec.cpp +118 -0
- package/nitrogen/generated/android/c++/JHybridNitroNumberFormatPlatformSpec.hpp +64 -0
- package/nitrogen/generated/android/c++/JHybridNitroNumberViewSpec.cpp +54 -0
- package/nitrogen/generated/android/c++/JHybridNitroNumberViewSpec.hpp +12 -0
- package/nitrogen/generated/android/c++/JHybridNitroPlatformNumberFormatterSpec.cpp +65 -0
- package/nitrogen/generated/android/c++/JHybridNitroPlatformNumberFormatterSpec.hpp +64 -0
- package/nitrogen/generated/android/c++/JNitroNumberDirection.hpp +3 -0
- package/nitrogen/generated/android/c++/JNumberFormatCompactDisplay.hpp +58 -0
- package/nitrogen/generated/android/c++/JNumberFormatCurrencyDisplay.hpp +64 -0
- package/nitrogen/generated/android/c++/JNumberFormatCurrencySign.hpp +58 -0
- package/nitrogen/generated/android/c++/JNumberFormatNotation.hpp +64 -0
- package/nitrogen/generated/android/c++/JNumberFormatPlatformOptions.hpp +161 -0
- package/nitrogen/generated/android/c++/JNumberFormatPlatformSymbols.hpp +89 -0
- package/nitrogen/generated/android/c++/JNumberFormatRoundingMode.hpp +79 -0
- package/nitrogen/generated/android/c++/JNumberFormatSignDisplay.hpp +67 -0
- package/nitrogen/generated/android/c++/JNumberFormatStyle.hpp +64 -0
- package/nitrogen/generated/android/c++/JNumberFormatUnitDisplay.hpp +61 -0
- package/nitrogen/generated/android/c++/views/JHybridNitroInputViewStateUpdater.cpp +25 -0
- package/nitrogen/generated/android/c++/views/JHybridNitroNumberViewStateUpdater.cpp +30 -0
- package/nitrogen/generated/android/kotlin/com/margelo/nitro/nitroinput/HybridNitroInputViewSpec.kt +30 -0
- package/nitrogen/generated/android/kotlin/com/margelo/nitro/nitroinput/HybridNitroNumberFormatPlatformSpec.kt +60 -0
- package/nitrogen/generated/android/kotlin/com/margelo/nitro/nitroinput/HybridNitroNumberViewSpec.kt +36 -0
- package/nitrogen/generated/android/kotlin/com/margelo/nitro/nitroinput/HybridNitroPlatformNumberFormatterSpec.kt +62 -0
- package/nitrogen/generated/android/kotlin/com/margelo/nitro/nitroinput/NitroNumberDirection.kt +2 -1
- package/nitrogen/generated/android/kotlin/com/margelo/nitro/nitroinput/NumberFormatCompactDisplay.kt +23 -0
- package/nitrogen/generated/android/kotlin/com/margelo/nitro/nitroinput/NumberFormatCurrencyDisplay.kt +25 -0
- package/nitrogen/generated/android/kotlin/com/margelo/nitro/nitroinput/NumberFormatCurrencySign.kt +23 -0
- package/nitrogen/generated/android/kotlin/com/margelo/nitro/nitroinput/NumberFormatNotation.kt +25 -0
- package/nitrogen/generated/android/kotlin/com/margelo/nitro/nitroinput/NumberFormatPlatformOptions.kt +136 -0
- package/nitrogen/generated/android/kotlin/com/margelo/nitro/nitroinput/NumberFormatPlatformSymbols.kt +91 -0
- package/nitrogen/generated/android/kotlin/com/margelo/nitro/nitroinput/NumberFormatRoundingMode.kt +30 -0
- package/nitrogen/generated/android/kotlin/com/margelo/nitro/nitroinput/NumberFormatSignDisplay.kt +26 -0
- package/nitrogen/generated/android/kotlin/com/margelo/nitro/nitroinput/NumberFormatStyle.kt +25 -0
- package/nitrogen/generated/android/kotlin/com/margelo/nitro/nitroinput/NumberFormatUnitDisplay.kt +24 -0
- package/nitrogen/generated/ios/NitroInput-Swift-Cxx-Bridge.cpp +34 -0
- package/nitrogen/generated/ios/NitroInput-Swift-Cxx-Bridge.hpp +63 -0
- package/nitrogen/generated/ios/NitroInput-Swift-Cxx-Umbrella.hpp +40 -0
- package/nitrogen/generated/ios/NitroInputAutolinking.mm +18 -0
- package/nitrogen/generated/ios/NitroInputAutolinking.swift +12 -0
- package/nitrogen/generated/ios/c++/HybridNitroInputViewSpecSwift.hpp +30 -0
- package/nitrogen/generated/ios/c++/HybridNitroNumberFormatPlatformSpecSwift.cpp +11 -0
- package/nitrogen/generated/ios/c++/HybridNitroNumberFormatPlatformSpecSwift.hpp +122 -0
- package/nitrogen/generated/ios/c++/HybridNitroNumberViewSpecSwift.hpp +42 -0
- package/nitrogen/generated/ios/c++/HybridNitroPlatformNumberFormatterSpecSwift.cpp +11 -0
- package/nitrogen/generated/ios/c++/HybridNitroPlatformNumberFormatterSpecSwift.hpp +94 -0
- package/nitrogen/generated/ios/c++/views/HybridNitroInputViewComponent.mm +30 -0
- package/nitrogen/generated/ios/c++/views/HybridNitroNumberViewComponent.mm +36 -0
- package/nitrogen/generated/ios/swift/HybridNitroInputViewSpec.swift +5 -0
- package/nitrogen/generated/ios/swift/HybridNitroInputViewSpec_cxx.swift +55 -0
- package/nitrogen/generated/ios/swift/HybridNitroNumberFormatPlatformSpec.swift +56 -0
- package/nitrogen/generated/ios/swift/HybridNitroNumberFormatPlatformSpec_cxx.swift +159 -0
- package/nitrogen/generated/ios/swift/HybridNitroNumberViewSpec.swift +6 -0
- package/nitrogen/generated/ios/swift/HybridNitroNumberViewSpec_cxx.swift +144 -0
- package/nitrogen/generated/ios/swift/HybridNitroPlatformNumberFormatterSpec.swift +56 -0
- package/nitrogen/generated/ios/swift/HybridNitroPlatformNumberFormatterSpec_cxx.swift +155 -0
- package/nitrogen/generated/ios/swift/NitroNumberDirection.swift +4 -0
- package/nitrogen/generated/ios/swift/NumberFormatCompactDisplay.swift +40 -0
- package/nitrogen/generated/ios/swift/NumberFormatCurrencyDisplay.swift +48 -0
- package/nitrogen/generated/ios/swift/NumberFormatCurrencySign.swift +40 -0
- package/nitrogen/generated/ios/swift/NumberFormatNotation.swift +48 -0
- package/nitrogen/generated/ios/swift/NumberFormatPlatformOptions.swift +159 -0
- package/nitrogen/generated/ios/swift/NumberFormatPlatformSymbols.swift +69 -0
- package/nitrogen/generated/ios/swift/NumberFormatRoundingMode.swift +68 -0
- package/nitrogen/generated/ios/swift/NumberFormatSignDisplay.swift +52 -0
- package/nitrogen/generated/ios/swift/NumberFormatStyle.swift +48 -0
- package/nitrogen/generated/ios/swift/NumberFormatUnitDisplay.swift +44 -0
- package/nitrogen/generated/shared/c++/HybridNitroInputViewSpec.cpp +10 -0
- package/nitrogen/generated/shared/c++/HybridNitroInputViewSpec.hpp +10 -0
- package/nitrogen/generated/shared/c++/HybridNitroNumberFormatFactorySpec.cpp +22 -0
- package/nitrogen/generated/shared/c++/HybridNitroNumberFormatFactorySpec.hpp +70 -0
- package/nitrogen/generated/shared/c++/HybridNitroNumberFormatPlatformSpec.cpp +22 -0
- package/nitrogen/generated/shared/c++/HybridNitroNumberFormatPlatformSpec.hpp +70 -0
- package/nitrogen/generated/shared/c++/HybridNitroNumberFormatSpec.cpp +23 -0
- package/nitrogen/generated/shared/c++/HybridNitroNumberFormatSpec.hpp +71 -0
- package/nitrogen/generated/shared/c++/HybridNitroNumberViewSpec.cpp +12 -0
- package/nitrogen/generated/shared/c++/HybridNitroNumberViewSpec.hpp +12 -0
- package/nitrogen/generated/shared/c++/HybridNitroPlatformNumberFormatterSpec.cpp +23 -0
- package/nitrogen/generated/shared/c++/HybridNitroPlatformNumberFormatterSpec.hpp +65 -0
- package/nitrogen/generated/shared/c++/NitroNumberDirection.hpp +4 -0
- package/nitrogen/generated/shared/c++/NumberFormatCompactDisplay.hpp +76 -0
- package/nitrogen/generated/shared/c++/NumberFormatCurrencyDisplay.hpp +84 -0
- package/nitrogen/generated/shared/c++/NumberFormatCurrencySign.hpp +76 -0
- package/nitrogen/generated/shared/c++/NumberFormatGrouping.hpp +80 -0
- package/nitrogen/generated/shared/c++/NumberFormatNotation.hpp +84 -0
- package/nitrogen/generated/shared/c++/NumberFormatOptions.hpp +193 -0
- package/nitrogen/generated/shared/c++/NumberFormatPart.hpp +87 -0
- package/nitrogen/generated/shared/c++/NumberFormatPlatformOptions.hpp +176 -0
- package/nitrogen/generated/shared/c++/NumberFormatPlatformSymbols.hpp +115 -0
- package/nitrogen/generated/shared/c++/NumberFormatRoundingMode.hpp +104 -0
- package/nitrogen/generated/shared/c++/NumberFormatRoundingPriority.hpp +80 -0
- package/nitrogen/generated/shared/c++/NumberFormatSignDisplay.hpp +88 -0
- package/nitrogen/generated/shared/c++/NumberFormatStyle.hpp +84 -0
- package/nitrogen/generated/shared/c++/NumberFormatTrailingZeroDisplay.hpp +76 -0
- package/nitrogen/generated/shared/c++/NumberFormatUnitDisplay.hpp +80 -0
- package/nitrogen/generated/shared/c++/ResolvedNumberFormatOptions.hpp +197 -0
- package/nitrogen/generated/shared/c++/views/HybridNitroInputViewComponent.cpp +10 -0
- package/nitrogen/generated/shared/c++/views/HybridNitroInputViewComponent.hpp +15 -0
- package/nitrogen/generated/shared/c++/views/HybridNitroNumberViewComponent.cpp +12 -0
- package/nitrogen/generated/shared/c++/views/HybridNitroNumberViewComponent.hpp +18 -0
- package/nitrogen/generated/shared/json/NitroInputViewConfig.json +5 -0
- package/nitrogen/generated/shared/json/NitroNumberViewConfig.json +6 -0
- package/package.json +2 -2
- package/src/NitroInput.tsx +42 -7
- package/src/NitroNumber.tsx +57 -7
- package/src/NumberFormat.ts +563 -0
- package/src/formatProps.ts +59 -0
- package/src/index.ts +18 -0
- package/src/specs/NitroInput.nitro.ts +10 -0
- package/src/specs/NitroNumber.nitro.ts +13 -1
- package/src/specs/NumberFormat.nitro.ts +145 -0
|
@@ -0,0 +1,161 @@
|
|
|
1
|
+
///
|
|
2
|
+
/// JNumberFormatPlatformOptions.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 "NumberFormatPlatformOptions.hpp"
|
|
12
|
+
|
|
13
|
+
#include "JNumberFormatCompactDisplay.hpp"
|
|
14
|
+
#include "JNumberFormatCurrencyDisplay.hpp"
|
|
15
|
+
#include "JNumberFormatCurrencySign.hpp"
|
|
16
|
+
#include "JNumberFormatNotation.hpp"
|
|
17
|
+
#include "JNumberFormatRoundingMode.hpp"
|
|
18
|
+
#include "JNumberFormatSignDisplay.hpp"
|
|
19
|
+
#include "JNumberFormatStyle.hpp"
|
|
20
|
+
#include "JNumberFormatUnitDisplay.hpp"
|
|
21
|
+
#include "NumberFormatCompactDisplay.hpp"
|
|
22
|
+
#include "NumberFormatCurrencyDisplay.hpp"
|
|
23
|
+
#include "NumberFormatCurrencySign.hpp"
|
|
24
|
+
#include "NumberFormatNotation.hpp"
|
|
25
|
+
#include "NumberFormatRoundingMode.hpp"
|
|
26
|
+
#include "NumberFormatSignDisplay.hpp"
|
|
27
|
+
#include "NumberFormatStyle.hpp"
|
|
28
|
+
#include "NumberFormatUnitDisplay.hpp"
|
|
29
|
+
#include <optional>
|
|
30
|
+
#include <string>
|
|
31
|
+
#include <vector>
|
|
32
|
+
|
|
33
|
+
namespace margelo::nitro::nitroinput {
|
|
34
|
+
|
|
35
|
+
using namespace facebook;
|
|
36
|
+
|
|
37
|
+
/**
|
|
38
|
+
* The C++ JNI bridge between the C++ struct "NumberFormatPlatformOptions" and the Kotlin data class "NumberFormatPlatformOptions".
|
|
39
|
+
*/
|
|
40
|
+
struct JNumberFormatPlatformOptions final: public jni::JavaClass<JNumberFormatPlatformOptions> {
|
|
41
|
+
public:
|
|
42
|
+
static constexpr auto kJavaDescriptor = "Lcom/margelo/nitro/nitroinput/NumberFormatPlatformOptions;";
|
|
43
|
+
|
|
44
|
+
public:
|
|
45
|
+
/**
|
|
46
|
+
* Convert this Java/Kotlin-based struct to the C++ struct NumberFormatPlatformOptions by copying all values to C++.
|
|
47
|
+
*/
|
|
48
|
+
[[maybe_unused]]
|
|
49
|
+
[[nodiscard]]
|
|
50
|
+
NumberFormatPlatformOptions toCpp() const {
|
|
51
|
+
static const auto clazz = javaClassStatic();
|
|
52
|
+
static const auto fieldLocales = clazz->getField<jni::JArrayClass<jni::JString>>("locales");
|
|
53
|
+
jni::local_ref<jni::JArrayClass<jni::JString>> locales = this->getFieldValue(fieldLocales);
|
|
54
|
+
static const auto fieldNumberingSystem = clazz->getField<jni::JString>("numberingSystem");
|
|
55
|
+
jni::local_ref<jni::JString> numberingSystem = this->getFieldValue(fieldNumberingSystem);
|
|
56
|
+
static const auto fieldStyle = clazz->getField<JNumberFormatStyle>("style");
|
|
57
|
+
jni::local_ref<JNumberFormatStyle> style = this->getFieldValue(fieldStyle);
|
|
58
|
+
static const auto fieldCurrency = clazz->getField<jni::JString>("currency");
|
|
59
|
+
jni::local_ref<jni::JString> currency = this->getFieldValue(fieldCurrency);
|
|
60
|
+
static const auto fieldCurrencyDisplay = clazz->getField<JNumberFormatCurrencyDisplay>("currencyDisplay");
|
|
61
|
+
jni::local_ref<JNumberFormatCurrencyDisplay> currencyDisplay = this->getFieldValue(fieldCurrencyDisplay);
|
|
62
|
+
static const auto fieldCurrencySign = clazz->getField<JNumberFormatCurrencySign>("currencySign");
|
|
63
|
+
jni::local_ref<JNumberFormatCurrencySign> currencySign = this->getFieldValue(fieldCurrencySign);
|
|
64
|
+
static const auto fieldUnit = clazz->getField<jni::JString>("unit");
|
|
65
|
+
jni::local_ref<jni::JString> unit = this->getFieldValue(fieldUnit);
|
|
66
|
+
static const auto fieldUnitDisplay = clazz->getField<JNumberFormatUnitDisplay>("unitDisplay");
|
|
67
|
+
jni::local_ref<JNumberFormatUnitDisplay> unitDisplay = this->getFieldValue(fieldUnitDisplay);
|
|
68
|
+
static const auto fieldNotation = clazz->getField<JNumberFormatNotation>("notation");
|
|
69
|
+
jni::local_ref<JNumberFormatNotation> notation = this->getFieldValue(fieldNotation);
|
|
70
|
+
static const auto fieldCompactDisplay = clazz->getField<JNumberFormatCompactDisplay>("compactDisplay");
|
|
71
|
+
jni::local_ref<JNumberFormatCompactDisplay> compactDisplay = this->getFieldValue(fieldCompactDisplay);
|
|
72
|
+
static const auto fieldUseGrouping = clazz->getField<jboolean>("useGrouping");
|
|
73
|
+
jboolean useGrouping = this->getFieldValue(fieldUseGrouping);
|
|
74
|
+
static const auto fieldMinimumIntegerDigits = clazz->getField<double>("minimumIntegerDigits");
|
|
75
|
+
double minimumIntegerDigits = this->getFieldValue(fieldMinimumIntegerDigits);
|
|
76
|
+
static const auto fieldMinimumFractionDigits = clazz->getField<double>("minimumFractionDigits");
|
|
77
|
+
double minimumFractionDigits = this->getFieldValue(fieldMinimumFractionDigits);
|
|
78
|
+
static const auto fieldMaximumFractionDigits = clazz->getField<double>("maximumFractionDigits");
|
|
79
|
+
double maximumFractionDigits = this->getFieldValue(fieldMaximumFractionDigits);
|
|
80
|
+
static const auto fieldMinimumSignificantDigits = clazz->getField<double>("minimumSignificantDigits");
|
|
81
|
+
double minimumSignificantDigits = this->getFieldValue(fieldMinimumSignificantDigits);
|
|
82
|
+
static const auto fieldMaximumSignificantDigits = clazz->getField<double>("maximumSignificantDigits");
|
|
83
|
+
double maximumSignificantDigits = this->getFieldValue(fieldMaximumSignificantDigits);
|
|
84
|
+
static const auto fieldRoundingMode = clazz->getField<JNumberFormatRoundingMode>("roundingMode");
|
|
85
|
+
jni::local_ref<JNumberFormatRoundingMode> roundingMode = this->getFieldValue(fieldRoundingMode);
|
|
86
|
+
static const auto fieldSignDisplay = clazz->getField<JNumberFormatSignDisplay>("signDisplay");
|
|
87
|
+
jni::local_ref<JNumberFormatSignDisplay> signDisplay = this->getFieldValue(fieldSignDisplay);
|
|
88
|
+
return NumberFormatPlatformOptions(
|
|
89
|
+
[&](auto&& __input) {
|
|
90
|
+
size_t __size = __input->size();
|
|
91
|
+
std::vector<std::string> __vector;
|
|
92
|
+
__vector.reserve(__size);
|
|
93
|
+
for (size_t __i = 0; __i < __size; __i++) {
|
|
94
|
+
auto __element = __input->getElement(__i);
|
|
95
|
+
__vector.push_back(__element->toStdString());
|
|
96
|
+
}
|
|
97
|
+
return __vector;
|
|
98
|
+
}(locales),
|
|
99
|
+
numberingSystem != nullptr ? std::make_optional(numberingSystem->toStdString()) : std::nullopt,
|
|
100
|
+
style->toCpp(),
|
|
101
|
+
currency != nullptr ? std::make_optional(currency->toStdString()) : std::nullopt,
|
|
102
|
+
currencyDisplay->toCpp(),
|
|
103
|
+
currencySign->toCpp(),
|
|
104
|
+
unit != nullptr ? std::make_optional(unit->toStdString()) : std::nullopt,
|
|
105
|
+
unitDisplay->toCpp(),
|
|
106
|
+
notation->toCpp(),
|
|
107
|
+
compactDisplay->toCpp(),
|
|
108
|
+
static_cast<bool>(useGrouping),
|
|
109
|
+
minimumIntegerDigits,
|
|
110
|
+
minimumFractionDigits,
|
|
111
|
+
maximumFractionDigits,
|
|
112
|
+
minimumSignificantDigits,
|
|
113
|
+
maximumSignificantDigits,
|
|
114
|
+
roundingMode->toCpp(),
|
|
115
|
+
signDisplay->toCpp()
|
|
116
|
+
);
|
|
117
|
+
}
|
|
118
|
+
|
|
119
|
+
public:
|
|
120
|
+
/**
|
|
121
|
+
* Create a Java/Kotlin-based struct by copying all values from the given C++ struct to Java.
|
|
122
|
+
*/
|
|
123
|
+
[[maybe_unused]]
|
|
124
|
+
static jni::local_ref<JNumberFormatPlatformOptions::javaobject> fromCpp(const NumberFormatPlatformOptions& value) {
|
|
125
|
+
using JSignature = JNumberFormatPlatformOptions(jni::alias_ref<jni::JArrayClass<jni::JString>>, jni::alias_ref<jni::JString>, jni::alias_ref<JNumberFormatStyle>, jni::alias_ref<jni::JString>, jni::alias_ref<JNumberFormatCurrencyDisplay>, jni::alias_ref<JNumberFormatCurrencySign>, jni::alias_ref<jni::JString>, jni::alias_ref<JNumberFormatUnitDisplay>, jni::alias_ref<JNumberFormatNotation>, jni::alias_ref<JNumberFormatCompactDisplay>, jboolean, double, double, double, double, double, jni::alias_ref<JNumberFormatRoundingMode>, jni::alias_ref<JNumberFormatSignDisplay>);
|
|
126
|
+
static const auto clazz = javaClassStatic();
|
|
127
|
+
static const auto create = clazz->getStaticMethod<JSignature>("fromCpp");
|
|
128
|
+
return create(
|
|
129
|
+
clazz,
|
|
130
|
+
[&](auto&& __input) {
|
|
131
|
+
size_t __size = __input.size();
|
|
132
|
+
jni::local_ref<jni::JArrayClass<jni::JString>> __array = jni::JArrayClass<jni::JString>::newArray(__size);
|
|
133
|
+
for (size_t __i = 0; __i < __size; __i++) {
|
|
134
|
+
const auto& __element = __input[__i];
|
|
135
|
+
auto __elementJni = jni::make_jstring(__element);
|
|
136
|
+
__array->setElement(__i, *__elementJni);
|
|
137
|
+
}
|
|
138
|
+
return __array;
|
|
139
|
+
}(value.locales),
|
|
140
|
+
value.numberingSystem.has_value() ? jni::make_jstring(value.numberingSystem.value()) : nullptr,
|
|
141
|
+
JNumberFormatStyle::fromCpp(value.style),
|
|
142
|
+
value.currency.has_value() ? jni::make_jstring(value.currency.value()) : nullptr,
|
|
143
|
+
JNumberFormatCurrencyDisplay::fromCpp(value.currencyDisplay),
|
|
144
|
+
JNumberFormatCurrencySign::fromCpp(value.currencySign),
|
|
145
|
+
value.unit.has_value() ? jni::make_jstring(value.unit.value()) : nullptr,
|
|
146
|
+
JNumberFormatUnitDisplay::fromCpp(value.unitDisplay),
|
|
147
|
+
JNumberFormatNotation::fromCpp(value.notation),
|
|
148
|
+
JNumberFormatCompactDisplay::fromCpp(value.compactDisplay),
|
|
149
|
+
value.useGrouping,
|
|
150
|
+
value.minimumIntegerDigits,
|
|
151
|
+
value.minimumFractionDigits,
|
|
152
|
+
value.maximumFractionDigits,
|
|
153
|
+
value.minimumSignificantDigits,
|
|
154
|
+
value.maximumSignificantDigits,
|
|
155
|
+
JNumberFormatRoundingMode::fromCpp(value.roundingMode),
|
|
156
|
+
JNumberFormatSignDisplay::fromCpp(value.signDisplay)
|
|
157
|
+
);
|
|
158
|
+
}
|
|
159
|
+
};
|
|
160
|
+
|
|
161
|
+
} // namespace margelo::nitro::nitroinput
|
|
@@ -0,0 +1,89 @@
|
|
|
1
|
+
///
|
|
2
|
+
/// JNumberFormatPlatformSymbols.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 "NumberFormatPlatformSymbols.hpp"
|
|
12
|
+
|
|
13
|
+
#include <string>
|
|
14
|
+
|
|
15
|
+
namespace margelo::nitro::nitroinput {
|
|
16
|
+
|
|
17
|
+
using namespace facebook;
|
|
18
|
+
|
|
19
|
+
/**
|
|
20
|
+
* The C++ JNI bridge between the C++ struct "NumberFormatPlatformSymbols" and the Kotlin data class "NumberFormatPlatformSymbols".
|
|
21
|
+
*/
|
|
22
|
+
struct JNumberFormatPlatformSymbols final: public jni::JavaClass<JNumberFormatPlatformSymbols> {
|
|
23
|
+
public:
|
|
24
|
+
static constexpr auto kJavaDescriptor = "Lcom/margelo/nitro/nitroinput/NumberFormatPlatformSymbols;";
|
|
25
|
+
|
|
26
|
+
public:
|
|
27
|
+
/**
|
|
28
|
+
* Convert this Java/Kotlin-based struct to the C++ struct NumberFormatPlatformSymbols by copying all values to C++.
|
|
29
|
+
*/
|
|
30
|
+
[[maybe_unused]]
|
|
31
|
+
[[nodiscard]]
|
|
32
|
+
NumberFormatPlatformSymbols toCpp() const {
|
|
33
|
+
static const auto clazz = javaClassStatic();
|
|
34
|
+
static const auto fieldLocale = clazz->getField<jni::JString>("locale");
|
|
35
|
+
jni::local_ref<jni::JString> locale = this->getFieldValue(fieldLocale);
|
|
36
|
+
static const auto fieldNumberingSystem = clazz->getField<jni::JString>("numberingSystem");
|
|
37
|
+
jni::local_ref<jni::JString> numberingSystem = this->getFieldValue(fieldNumberingSystem);
|
|
38
|
+
static const auto fieldMinusSign = clazz->getField<jni::JString>("minusSign");
|
|
39
|
+
jni::local_ref<jni::JString> minusSign = this->getFieldValue(fieldMinusSign);
|
|
40
|
+
static const auto fieldPlusSign = clazz->getField<jni::JString>("plusSign");
|
|
41
|
+
jni::local_ref<jni::JString> plusSign = this->getFieldValue(fieldPlusSign);
|
|
42
|
+
static const auto fieldPercentSign = clazz->getField<jni::JString>("percentSign");
|
|
43
|
+
jni::local_ref<jni::JString> percentSign = this->getFieldValue(fieldPercentSign);
|
|
44
|
+
static const auto fieldCurrency = clazz->getField<jni::JString>("currency");
|
|
45
|
+
jni::local_ref<jni::JString> currency = this->getFieldValue(fieldCurrency);
|
|
46
|
+
static const auto fieldNan = clazz->getField<jni::JString>("nan");
|
|
47
|
+
jni::local_ref<jni::JString> nan = this->getFieldValue(fieldNan);
|
|
48
|
+
static const auto fieldInfinity = clazz->getField<jni::JString>("infinity");
|
|
49
|
+
jni::local_ref<jni::JString> infinity = this->getFieldValue(fieldInfinity);
|
|
50
|
+
static const auto fieldExponentSeparator = clazz->getField<jni::JString>("exponentSeparator");
|
|
51
|
+
jni::local_ref<jni::JString> exponentSeparator = this->getFieldValue(fieldExponentSeparator);
|
|
52
|
+
return NumberFormatPlatformSymbols(
|
|
53
|
+
locale->toStdString(),
|
|
54
|
+
numberingSystem->toStdString(),
|
|
55
|
+
minusSign->toStdString(),
|
|
56
|
+
plusSign->toStdString(),
|
|
57
|
+
percentSign->toStdString(),
|
|
58
|
+
currency->toStdString(),
|
|
59
|
+
nan->toStdString(),
|
|
60
|
+
infinity->toStdString(),
|
|
61
|
+
exponentSeparator->toStdString()
|
|
62
|
+
);
|
|
63
|
+
}
|
|
64
|
+
|
|
65
|
+
public:
|
|
66
|
+
/**
|
|
67
|
+
* Create a Java/Kotlin-based struct by copying all values from the given C++ struct to Java.
|
|
68
|
+
*/
|
|
69
|
+
[[maybe_unused]]
|
|
70
|
+
static jni::local_ref<JNumberFormatPlatformSymbols::javaobject> fromCpp(const NumberFormatPlatformSymbols& value) {
|
|
71
|
+
using JSignature = JNumberFormatPlatformSymbols(jni::alias_ref<jni::JString>, jni::alias_ref<jni::JString>, jni::alias_ref<jni::JString>, jni::alias_ref<jni::JString>, jni::alias_ref<jni::JString>, jni::alias_ref<jni::JString>, jni::alias_ref<jni::JString>, jni::alias_ref<jni::JString>, jni::alias_ref<jni::JString>);
|
|
72
|
+
static const auto clazz = javaClassStatic();
|
|
73
|
+
static const auto create = clazz->getStaticMethod<JSignature>("fromCpp");
|
|
74
|
+
return create(
|
|
75
|
+
clazz,
|
|
76
|
+
jni::make_jstring(value.locale),
|
|
77
|
+
jni::make_jstring(value.numberingSystem),
|
|
78
|
+
jni::make_jstring(value.minusSign),
|
|
79
|
+
jni::make_jstring(value.plusSign),
|
|
80
|
+
jni::make_jstring(value.percentSign),
|
|
81
|
+
jni::make_jstring(value.currency),
|
|
82
|
+
jni::make_jstring(value.nan),
|
|
83
|
+
jni::make_jstring(value.infinity),
|
|
84
|
+
jni::make_jstring(value.exponentSeparator)
|
|
85
|
+
);
|
|
86
|
+
}
|
|
87
|
+
};
|
|
88
|
+
|
|
89
|
+
} // namespace margelo::nitro::nitroinput
|
|
@@ -0,0 +1,79 @@
|
|
|
1
|
+
///
|
|
2
|
+
/// JNumberFormatRoundingMode.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 "NumberFormatRoundingMode.hpp"
|
|
12
|
+
|
|
13
|
+
namespace margelo::nitro::nitroinput {
|
|
14
|
+
|
|
15
|
+
using namespace facebook;
|
|
16
|
+
|
|
17
|
+
/**
|
|
18
|
+
* The C++ JNI bridge between the C++ enum "NumberFormatRoundingMode" and the Kotlin enum "NumberFormatRoundingMode".
|
|
19
|
+
*/
|
|
20
|
+
struct JNumberFormatRoundingMode final: public jni::JavaClass<JNumberFormatRoundingMode> {
|
|
21
|
+
public:
|
|
22
|
+
static constexpr auto kJavaDescriptor = "Lcom/margelo/nitro/nitroinput/NumberFormatRoundingMode;";
|
|
23
|
+
|
|
24
|
+
public:
|
|
25
|
+
/**
|
|
26
|
+
* Convert this Java/Kotlin-based enum to the C++ enum NumberFormatRoundingMode.
|
|
27
|
+
*/
|
|
28
|
+
[[maybe_unused]]
|
|
29
|
+
[[nodiscard]]
|
|
30
|
+
NumberFormatRoundingMode 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<NumberFormatRoundingMode>(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<JNumberFormatRoundingMode> fromCpp(NumberFormatRoundingMode value) {
|
|
43
|
+
static const auto clazz = javaClassStatic();
|
|
44
|
+
switch (value) {
|
|
45
|
+
case NumberFormatRoundingMode::CEIL:
|
|
46
|
+
static const auto fieldCEIL = clazz->getStaticField<JNumberFormatRoundingMode>("CEIL");
|
|
47
|
+
return clazz->getStaticFieldValue(fieldCEIL);
|
|
48
|
+
case NumberFormatRoundingMode::FLOOR:
|
|
49
|
+
static const auto fieldFLOOR = clazz->getStaticField<JNumberFormatRoundingMode>("FLOOR");
|
|
50
|
+
return clazz->getStaticFieldValue(fieldFLOOR);
|
|
51
|
+
case NumberFormatRoundingMode::EXPAND:
|
|
52
|
+
static const auto fieldEXPAND = clazz->getStaticField<JNumberFormatRoundingMode>("EXPAND");
|
|
53
|
+
return clazz->getStaticFieldValue(fieldEXPAND);
|
|
54
|
+
case NumberFormatRoundingMode::TRUNC:
|
|
55
|
+
static const auto fieldTRUNC = clazz->getStaticField<JNumberFormatRoundingMode>("TRUNC");
|
|
56
|
+
return clazz->getStaticFieldValue(fieldTRUNC);
|
|
57
|
+
case NumberFormatRoundingMode::HALFCEIL:
|
|
58
|
+
static const auto fieldHALFCEIL = clazz->getStaticField<JNumberFormatRoundingMode>("HALFCEIL");
|
|
59
|
+
return clazz->getStaticFieldValue(fieldHALFCEIL);
|
|
60
|
+
case NumberFormatRoundingMode::HALFFLOOR:
|
|
61
|
+
static const auto fieldHALFFLOOR = clazz->getStaticField<JNumberFormatRoundingMode>("HALFFLOOR");
|
|
62
|
+
return clazz->getStaticFieldValue(fieldHALFFLOOR);
|
|
63
|
+
case NumberFormatRoundingMode::HALFEXPAND:
|
|
64
|
+
static const auto fieldHALFEXPAND = clazz->getStaticField<JNumberFormatRoundingMode>("HALFEXPAND");
|
|
65
|
+
return clazz->getStaticFieldValue(fieldHALFEXPAND);
|
|
66
|
+
case NumberFormatRoundingMode::HALFTRUNC:
|
|
67
|
+
static const auto fieldHALFTRUNC = clazz->getStaticField<JNumberFormatRoundingMode>("HALFTRUNC");
|
|
68
|
+
return clazz->getStaticFieldValue(fieldHALFTRUNC);
|
|
69
|
+
case NumberFormatRoundingMode::HALFEVEN:
|
|
70
|
+
static const auto fieldHALFEVEN = clazz->getStaticField<JNumberFormatRoundingMode>("HALFEVEN");
|
|
71
|
+
return clazz->getStaticFieldValue(fieldHALFEVEN);
|
|
72
|
+
default:
|
|
73
|
+
std::string stringValue = std::to_string(static_cast<int>(value));
|
|
74
|
+
throw std::invalid_argument("Invalid enum value (" + stringValue + "!");
|
|
75
|
+
}
|
|
76
|
+
}
|
|
77
|
+
};
|
|
78
|
+
|
|
79
|
+
} // namespace margelo::nitro::nitroinput
|
|
@@ -0,0 +1,67 @@
|
|
|
1
|
+
///
|
|
2
|
+
/// JNumberFormatSignDisplay.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 "NumberFormatSignDisplay.hpp"
|
|
12
|
+
|
|
13
|
+
namespace margelo::nitro::nitroinput {
|
|
14
|
+
|
|
15
|
+
using namespace facebook;
|
|
16
|
+
|
|
17
|
+
/**
|
|
18
|
+
* The C++ JNI bridge between the C++ enum "NumberFormatSignDisplay" and the Kotlin enum "NumberFormatSignDisplay".
|
|
19
|
+
*/
|
|
20
|
+
struct JNumberFormatSignDisplay final: public jni::JavaClass<JNumberFormatSignDisplay> {
|
|
21
|
+
public:
|
|
22
|
+
static constexpr auto kJavaDescriptor = "Lcom/margelo/nitro/nitroinput/NumberFormatSignDisplay;";
|
|
23
|
+
|
|
24
|
+
public:
|
|
25
|
+
/**
|
|
26
|
+
* Convert this Java/Kotlin-based enum to the C++ enum NumberFormatSignDisplay.
|
|
27
|
+
*/
|
|
28
|
+
[[maybe_unused]]
|
|
29
|
+
[[nodiscard]]
|
|
30
|
+
NumberFormatSignDisplay 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<NumberFormatSignDisplay>(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<JNumberFormatSignDisplay> fromCpp(NumberFormatSignDisplay value) {
|
|
43
|
+
static const auto clazz = javaClassStatic();
|
|
44
|
+
switch (value) {
|
|
45
|
+
case NumberFormatSignDisplay::AUTO:
|
|
46
|
+
static const auto fieldAUTO = clazz->getStaticField<JNumberFormatSignDisplay>("AUTO");
|
|
47
|
+
return clazz->getStaticFieldValue(fieldAUTO);
|
|
48
|
+
case NumberFormatSignDisplay::ALWAYS:
|
|
49
|
+
static const auto fieldALWAYS = clazz->getStaticField<JNumberFormatSignDisplay>("ALWAYS");
|
|
50
|
+
return clazz->getStaticFieldValue(fieldALWAYS);
|
|
51
|
+
case NumberFormatSignDisplay::NEVER:
|
|
52
|
+
static const auto fieldNEVER = clazz->getStaticField<JNumberFormatSignDisplay>("NEVER");
|
|
53
|
+
return clazz->getStaticFieldValue(fieldNEVER);
|
|
54
|
+
case NumberFormatSignDisplay::EXCEPTZERO:
|
|
55
|
+
static const auto fieldEXCEPTZERO = clazz->getStaticField<JNumberFormatSignDisplay>("EXCEPTZERO");
|
|
56
|
+
return clazz->getStaticFieldValue(fieldEXCEPTZERO);
|
|
57
|
+
case NumberFormatSignDisplay::NEGATIVE:
|
|
58
|
+
static const auto fieldNEGATIVE = clazz->getStaticField<JNumberFormatSignDisplay>("NEGATIVE");
|
|
59
|
+
return clazz->getStaticFieldValue(fieldNEGATIVE);
|
|
60
|
+
default:
|
|
61
|
+
std::string stringValue = std::to_string(static_cast<int>(value));
|
|
62
|
+
throw std::invalid_argument("Invalid enum value (" + stringValue + "!");
|
|
63
|
+
}
|
|
64
|
+
}
|
|
65
|
+
};
|
|
66
|
+
|
|
67
|
+
} // namespace margelo::nitro::nitroinput
|
|
@@ -0,0 +1,64 @@
|
|
|
1
|
+
///
|
|
2
|
+
/// JNumberFormatStyle.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 "NumberFormatStyle.hpp"
|
|
12
|
+
|
|
13
|
+
namespace margelo::nitro::nitroinput {
|
|
14
|
+
|
|
15
|
+
using namespace facebook;
|
|
16
|
+
|
|
17
|
+
/**
|
|
18
|
+
* The C++ JNI bridge between the C++ enum "NumberFormatStyle" and the Kotlin enum "NumberFormatStyle".
|
|
19
|
+
*/
|
|
20
|
+
struct JNumberFormatStyle final: public jni::JavaClass<JNumberFormatStyle> {
|
|
21
|
+
public:
|
|
22
|
+
static constexpr auto kJavaDescriptor = "Lcom/margelo/nitro/nitroinput/NumberFormatStyle;";
|
|
23
|
+
|
|
24
|
+
public:
|
|
25
|
+
/**
|
|
26
|
+
* Convert this Java/Kotlin-based enum to the C++ enum NumberFormatStyle.
|
|
27
|
+
*/
|
|
28
|
+
[[maybe_unused]]
|
|
29
|
+
[[nodiscard]]
|
|
30
|
+
NumberFormatStyle 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<NumberFormatStyle>(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<JNumberFormatStyle> fromCpp(NumberFormatStyle value) {
|
|
43
|
+
static const auto clazz = javaClassStatic();
|
|
44
|
+
switch (value) {
|
|
45
|
+
case NumberFormatStyle::DECIMAL:
|
|
46
|
+
static const auto fieldDECIMAL = clazz->getStaticField<JNumberFormatStyle>("DECIMAL");
|
|
47
|
+
return clazz->getStaticFieldValue(fieldDECIMAL);
|
|
48
|
+
case NumberFormatStyle::CURRENCY:
|
|
49
|
+
static const auto fieldCURRENCY = clazz->getStaticField<JNumberFormatStyle>("CURRENCY");
|
|
50
|
+
return clazz->getStaticFieldValue(fieldCURRENCY);
|
|
51
|
+
case NumberFormatStyle::PERCENT:
|
|
52
|
+
static const auto fieldPERCENT = clazz->getStaticField<JNumberFormatStyle>("PERCENT");
|
|
53
|
+
return clazz->getStaticFieldValue(fieldPERCENT);
|
|
54
|
+
case NumberFormatStyle::UNIT:
|
|
55
|
+
static const auto fieldUNIT = clazz->getStaticField<JNumberFormatStyle>("UNIT");
|
|
56
|
+
return clazz->getStaticFieldValue(fieldUNIT);
|
|
57
|
+
default:
|
|
58
|
+
std::string stringValue = std::to_string(static_cast<int>(value));
|
|
59
|
+
throw std::invalid_argument("Invalid enum value (" + stringValue + "!");
|
|
60
|
+
}
|
|
61
|
+
}
|
|
62
|
+
};
|
|
63
|
+
|
|
64
|
+
} // namespace margelo::nitro::nitroinput
|
|
@@ -0,0 +1,61 @@
|
|
|
1
|
+
///
|
|
2
|
+
/// JNumberFormatUnitDisplay.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 "NumberFormatUnitDisplay.hpp"
|
|
12
|
+
|
|
13
|
+
namespace margelo::nitro::nitroinput {
|
|
14
|
+
|
|
15
|
+
using namespace facebook;
|
|
16
|
+
|
|
17
|
+
/**
|
|
18
|
+
* The C++ JNI bridge between the C++ enum "NumberFormatUnitDisplay" and the Kotlin enum "NumberFormatUnitDisplay".
|
|
19
|
+
*/
|
|
20
|
+
struct JNumberFormatUnitDisplay final: public jni::JavaClass<JNumberFormatUnitDisplay> {
|
|
21
|
+
public:
|
|
22
|
+
static constexpr auto kJavaDescriptor = "Lcom/margelo/nitro/nitroinput/NumberFormatUnitDisplay;";
|
|
23
|
+
|
|
24
|
+
public:
|
|
25
|
+
/**
|
|
26
|
+
* Convert this Java/Kotlin-based enum to the C++ enum NumberFormatUnitDisplay.
|
|
27
|
+
*/
|
|
28
|
+
[[maybe_unused]]
|
|
29
|
+
[[nodiscard]]
|
|
30
|
+
NumberFormatUnitDisplay 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<NumberFormatUnitDisplay>(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<JNumberFormatUnitDisplay> fromCpp(NumberFormatUnitDisplay value) {
|
|
43
|
+
static const auto clazz = javaClassStatic();
|
|
44
|
+
switch (value) {
|
|
45
|
+
case NumberFormatUnitDisplay::SHORT:
|
|
46
|
+
static const auto fieldSHORT = clazz->getStaticField<JNumberFormatUnitDisplay>("SHORT");
|
|
47
|
+
return clazz->getStaticFieldValue(fieldSHORT);
|
|
48
|
+
case NumberFormatUnitDisplay::NARROW:
|
|
49
|
+
static const auto fieldNARROW = clazz->getStaticField<JNumberFormatUnitDisplay>("NARROW");
|
|
50
|
+
return clazz->getStaticFieldValue(fieldNARROW);
|
|
51
|
+
case NumberFormatUnitDisplay::LONG:
|
|
52
|
+
static const auto fieldLONG = clazz->getStaticField<JNumberFormatUnitDisplay>("LONG");
|
|
53
|
+
return clazz->getStaticFieldValue(fieldLONG);
|
|
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::nitroinput
|
|
@@ -203,6 +203,31 @@ void JHybridNitroInputViewStateUpdater::updateViewProps(jni::alias_ref<jni::JCla
|
|
|
203
203
|
: !newProps->suffixAlign.hasSameValue(oldProps->suffixAlign)) {
|
|
204
204
|
hybridView->setSuffixAlign(newProps->suffixAlign.get());
|
|
205
205
|
}
|
|
206
|
+
if (oldProps == nullptr
|
|
207
|
+
? newProps->letterSpacing.isProvided()
|
|
208
|
+
: !newProps->letterSpacing.hasSameValue(oldProps->letterSpacing)) {
|
|
209
|
+
hybridView->setLetterSpacing(newProps->letterSpacing.get());
|
|
210
|
+
}
|
|
211
|
+
if (oldProps == nullptr
|
|
212
|
+
? newProps->prefixSpacing.isProvided()
|
|
213
|
+
: !newProps->prefixSpacing.hasSameValue(oldProps->prefixSpacing)) {
|
|
214
|
+
hybridView->setPrefixSpacing(newProps->prefixSpacing.get());
|
|
215
|
+
}
|
|
216
|
+
if (oldProps == nullptr
|
|
217
|
+
? newProps->suffixSpacing.isProvided()
|
|
218
|
+
: !newProps->suffixSpacing.hasSameValue(oldProps->suffixSpacing)) {
|
|
219
|
+
hybridView->setSuffixSpacing(newProps->suffixSpacing.get());
|
|
220
|
+
}
|
|
221
|
+
if (oldProps == nullptr
|
|
222
|
+
? newProps->prefixOffset.isProvided()
|
|
223
|
+
: !newProps->prefixOffset.hasSameValue(oldProps->prefixOffset)) {
|
|
224
|
+
hybridView->setPrefixOffset(newProps->prefixOffset.get());
|
|
225
|
+
}
|
|
226
|
+
if (oldProps == nullptr
|
|
227
|
+
? newProps->suffixOffset.isProvided()
|
|
228
|
+
: !newProps->suffixOffset.hasSameValue(oldProps->suffixOffset)) {
|
|
229
|
+
hybridView->setSuffixOffset(newProps->suffixOffset.get());
|
|
230
|
+
}
|
|
206
231
|
if (oldProps == nullptr
|
|
207
232
|
? newProps->placeholder.isProvided()
|
|
208
233
|
: !newProps->placeholder.hasSameValue(oldProps->placeholder)) {
|
|
@@ -223,6 +223,36 @@ void JHybridNitroNumberViewStateUpdater::updateViewProps(jni::alias_ref<jni::JCl
|
|
|
223
223
|
: !newProps->suffixAlign.hasSameValue(oldProps->suffixAlign)) {
|
|
224
224
|
hybridView->setSuffixAlign(newProps->suffixAlign.get());
|
|
225
225
|
}
|
|
226
|
+
if (oldProps == nullptr
|
|
227
|
+
? newProps->letterSpacing.isProvided()
|
|
228
|
+
: !newProps->letterSpacing.hasSameValue(oldProps->letterSpacing)) {
|
|
229
|
+
hybridView->setLetterSpacing(newProps->letterSpacing.get());
|
|
230
|
+
}
|
|
231
|
+
if (oldProps == nullptr
|
|
232
|
+
? newProps->prefixSpacing.isProvided()
|
|
233
|
+
: !newProps->prefixSpacing.hasSameValue(oldProps->prefixSpacing)) {
|
|
234
|
+
hybridView->setPrefixSpacing(newProps->prefixSpacing.get());
|
|
235
|
+
}
|
|
236
|
+
if (oldProps == nullptr
|
|
237
|
+
? newProps->suffixSpacing.isProvided()
|
|
238
|
+
: !newProps->suffixSpacing.hasSameValue(oldProps->suffixSpacing)) {
|
|
239
|
+
hybridView->setSuffixSpacing(newProps->suffixSpacing.get());
|
|
240
|
+
}
|
|
241
|
+
if (oldProps == nullptr
|
|
242
|
+
? newProps->prefixOffset.isProvided()
|
|
243
|
+
: !newProps->prefixOffset.hasSameValue(oldProps->prefixOffset)) {
|
|
244
|
+
hybridView->setPrefixOffset(newProps->prefixOffset.get());
|
|
245
|
+
}
|
|
246
|
+
if (oldProps == nullptr
|
|
247
|
+
? newProps->suffixOffset.isProvided()
|
|
248
|
+
: !newProps->suffixOffset.hasSameValue(oldProps->suffixOffset)) {
|
|
249
|
+
hybridView->setSuffixOffset(newProps->suffixOffset.get());
|
|
250
|
+
}
|
|
251
|
+
if (oldProps == nullptr
|
|
252
|
+
? newProps->tabularNums.isProvided()
|
|
253
|
+
: !newProps->tabularNums.hasSameValue(oldProps->tabularNums)) {
|
|
254
|
+
hybridView->setTabularNums(newProps->tabularNums.get());
|
|
255
|
+
}
|
|
226
256
|
if (oldProps == nullptr
|
|
227
257
|
? newProps->adjustsFontSizeToFit.isProvided()
|
|
228
258
|
: !newProps->adjustsFontSizeToFit.hasSameValue(oldProps->adjustsFontSizeToFit)) {
|
package/nitrogen/generated/android/kotlin/com/margelo/nitro/nitroinput/HybridNitroInputViewSpec.kt
CHANGED
|
@@ -207,6 +207,36 @@ abstract class HybridNitroInputViewSpec: HybridView() {
|
|
|
207
207
|
@set:Keep
|
|
208
208
|
abstract var suffixAlign: NitroInputAffixAlign
|
|
209
209
|
|
|
210
|
+
@get:DoNotStrip
|
|
211
|
+
@get:Keep
|
|
212
|
+
@set:DoNotStrip
|
|
213
|
+
@set:Keep
|
|
214
|
+
abstract var letterSpacing: Double
|
|
215
|
+
|
|
216
|
+
@get:DoNotStrip
|
|
217
|
+
@get:Keep
|
|
218
|
+
@set:DoNotStrip
|
|
219
|
+
@set:Keep
|
|
220
|
+
abstract var prefixSpacing: Double
|
|
221
|
+
|
|
222
|
+
@get:DoNotStrip
|
|
223
|
+
@get:Keep
|
|
224
|
+
@set:DoNotStrip
|
|
225
|
+
@set:Keep
|
|
226
|
+
abstract var suffixSpacing: Double
|
|
227
|
+
|
|
228
|
+
@get:DoNotStrip
|
|
229
|
+
@get:Keep
|
|
230
|
+
@set:DoNotStrip
|
|
231
|
+
@set:Keep
|
|
232
|
+
abstract var prefixOffset: Double
|
|
233
|
+
|
|
234
|
+
@get:DoNotStrip
|
|
235
|
+
@get:Keep
|
|
236
|
+
@set:DoNotStrip
|
|
237
|
+
@set:Keep
|
|
238
|
+
abstract var suffixOffset: Double
|
|
239
|
+
|
|
210
240
|
@get:DoNotStrip
|
|
211
241
|
@get:Keep
|
|
212
242
|
@set:DoNotStrip
|