react-native-nitro-input 0.2.0 → 0.3.1
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 +87 -0
- package/README.md +132 -2
- package/android/CMakeLists.txt +4 -0
- package/android/gradle.properties +1 -1
- package/android/src/main/cpp/JReflowEngine.cpp +32 -0
- package/android/src/main/cpp/JReflowEngine.hpp +13 -0
- package/android/src/main/cpp/JRollingEngine.cpp +43 -2
- package/android/src/main/cpp/JRollingEngine.hpp +9 -1
- package/android/src/main/java/com/margelo/nitro/nitroinput/HybridNitroInputView.kt +20 -0
- package/android/src/main/java/com/margelo/nitro/nitroinput/HybridNitroNumberFormatPlatform.kt +284 -0
- package/android/src/main/java/com/margelo/nitro/nitroinput/HybridNitroNumberView.kt +113 -0
- package/android/src/main/java/com/margelo/nitro/nitroinput/HybridNitroTextMeasure.kt +25 -0
- package/android/src/main/java/com/margelo/nitro/nitroinput/HybridNitroTextView.kt +140 -0
- package/android/src/main/java/com/margelo/nitro/nitroinput/NitroInputPackage.kt +2 -1
- package/android/src/main/java/com/margelo/nitro/nitroinput/NitroInputView.kt +69 -10
- package/android/src/main/java/com/margelo/nitro/nitroinput/NitroNumberView.kt +522 -130
- package/android/src/main/java/com/margelo/nitro/nitroinput/NitroTextView.kt +868 -0
- package/android/src/main/java/com/margelo/nitro/nitroinput/ReflowEngine.kt +21 -0
- package/android/src/main/java/com/margelo/nitro/nitroinput/RollingEngine.kt +14 -2
- package/cpp/RollingEngine.cpp +102 -8
- package/cpp/RollingEngine.hpp +44 -3
- 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 +426 -0
- package/ios/HybridNitroNumberView.swift +101 -1
- package/ios/HybridNitroTextView.swift +134 -0
- package/ios/NitroInputView.swift +79 -19
- package/ios/NitroNumberView.swift +520 -147
- package/ios/NitroTextView.swift +583 -0
- package/lib/commonjs/nitrogen/generated/shared/json/NitroInputViewConfig.json +5 -0
- package/lib/commonjs/nitrogen/generated/shared/json/NitroNumberViewConfig.json +26 -0
- package/lib/commonjs/nitrogen/generated/shared/json/NitroTextViewConfig.json +30 -0
- package/lib/commonjs/src/NitroInput.js +8 -6
- package/lib/commonjs/src/NitroNumber.js +54 -3
- package/lib/commonjs/src/NitroText.js +138 -0
- package/lib/commonjs/src/NitroTime.js +65 -0
- package/lib/commonjs/src/NumberFormat.js +525 -0
- package/lib/commonjs/src/formatProps.js +108 -0
- package/lib/commonjs/src/index.js +8 -1
- package/lib/commonjs/src/specs/NitroText.nitro.js +2 -0
- 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 +26 -0
- package/lib/module/nitrogen/generated/shared/json/NitroTextViewConfig.json +30 -0
- package/lib/module/src/NitroInput.js +8 -6
- package/lib/module/src/NitroNumber.js +54 -3
- package/lib/module/src/NitroText.js +98 -0
- package/lib/module/src/NitroTime.js +29 -0
- package/lib/module/src/NumberFormat.js +521 -0
- package/lib/module/src/formatProps.js +104 -0
- package/lib/module/src/index.js +3 -0
- package/lib/module/src/specs/NitroText.nitro.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 +115 -2
- package/lib/typescript/src/NitroText.d.ts +67 -0
- package/lib/typescript/src/NitroTime.d.ts +19 -0
- package/lib/typescript/src/NumberFormat.d.ts +47 -0
- package/lib/typescript/src/formatProps.d.ts +47 -0
- package/lib/typescript/src/index.d.ts +6 -1
- package/lib/typescript/src/specs/NitroInput.nitro.d.ts +10 -0
- package/lib/typescript/src/specs/NitroNumber.nitro.d.ts +80 -1
- package/lib/typescript/src/specs/NitroText.nitro.d.ts +60 -0
- package/lib/typescript/src/specs/NumberFormat.nitro.d.ts +139 -0
- package/nitro.json +36 -0
- package/nitrogen/generated/android/NitroInput+autolinking.cmake +12 -0
- package/nitrogen/generated/android/NitroInputOnLoad.cpp +62 -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 +297 -0
- package/nitrogen/generated/android/c++/JHybridNitroNumberViewSpec.hpp +52 -0
- package/nitrogen/generated/android/c++/JHybridNitroPlatformNumberFormatterSpec.cpp +65 -0
- package/nitrogen/generated/android/c++/JHybridNitroPlatformNumberFormatterSpec.hpp +64 -0
- package/nitrogen/generated/android/c++/JHybridNitroTextMeasureSpec.cpp +58 -0
- package/nitrogen/generated/android/c++/JHybridNitroTextMeasureSpec.hpp +64 -0
- package/nitrogen/generated/android/c++/JHybridNitroTextViewSpec.cpp +253 -0
- package/nitrogen/generated/android/c++/JHybridNitroTextViewSpec.hpp +104 -0
- package/nitrogen/generated/android/c++/JNitroNumberDirection.hpp +3 -0
- package/nitrogen/generated/android/c++/JNitroNumberShimmerDirection.hpp +61 -0
- package/nitrogen/generated/android/c++/JNitroNumberSignDisplay.hpp +67 -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 +130 -0
- package/nitrogen/generated/android/c++/views/JHybridNitroTextViewStateUpdater.cpp +174 -0
- package/nitrogen/generated/android/c++/views/JHybridNitroTextViewStateUpdater.hpp +54 -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 +172 -0
- package/nitrogen/generated/android/kotlin/com/margelo/nitro/nitroinput/HybridNitroPlatformNumberFormatterSpec.kt +62 -0
- package/nitrogen/generated/android/kotlin/com/margelo/nitro/nitroinput/HybridNitroTextMeasureSpec.kt +60 -0
- package/nitrogen/generated/android/kotlin/com/margelo/nitro/nitroinput/HybridNitroTextViewSpec.kt +179 -0
- package/nitrogen/generated/android/kotlin/com/margelo/nitro/nitroinput/NitroNumberDirection.kt +2 -1
- package/nitrogen/generated/android/kotlin/com/margelo/nitro/nitroinput/NitroNumberShimmerDirection.kt +24 -0
- package/nitrogen/generated/android/kotlin/com/margelo/nitro/nitroinput/NitroNumberSignDisplay.kt +26 -0
- 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/android/kotlin/com/margelo/nitro/nitroinput/views/HybridNitroTextViewManager.kt +96 -0
- package/nitrogen/generated/android/kotlin/com/margelo/nitro/nitroinput/views/HybridNitroTextViewStateUpdater.kt +23 -0
- package/nitrogen/generated/ios/NitroInput-Swift-Cxx-Bridge.cpp +68 -0
- package/nitrogen/generated/ios/NitroInput-Swift-Cxx-Bridge.hpp +184 -0
- package/nitrogen/generated/ios/NitroInput-Swift-Cxx-Umbrella.hpp +56 -0
- package/nitrogen/generated/ios/NitroInputAutolinking.mm +34 -0
- package/nitrogen/generated/ios/NitroInputAutolinking.swift +36 -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 +188 -0
- package/nitrogen/generated/ios/c++/HybridNitroPlatformNumberFormatterSpecSwift.cpp +11 -0
- package/nitrogen/generated/ios/c++/HybridNitroPlatformNumberFormatterSpecSwift.hpp +94 -0
- package/nitrogen/generated/ios/c++/HybridNitroTextMeasureSpecSwift.cpp +11 -0
- package/nitrogen/generated/ios/c++/HybridNitroTextMeasureSpecSwift.hpp +90 -0
- package/nitrogen/generated/ios/c++/HybridNitroTextViewSpecSwift.cpp +11 -0
- package/nitrogen/generated/ios/c++/HybridNitroTextViewSpecSwift.hpp +233 -0
- package/nitrogen/generated/ios/c++/views/HybridNitroInputViewComponent.mm +30 -0
- package/nitrogen/generated/ios/c++/views/HybridNitroNumberViewComponent.mm +156 -0
- package/nitrogen/generated/ios/c++/views/HybridNitroTextViewComponent.mm +264 -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 +26 -0
- package/nitrogen/generated/ios/swift/HybridNitroNumberViewSpec_cxx.swift +658 -21
- package/nitrogen/generated/ios/swift/HybridNitroPlatformNumberFormatterSpec.swift +56 -0
- package/nitrogen/generated/ios/swift/HybridNitroPlatformNumberFormatterSpec_cxx.swift +155 -0
- package/nitrogen/generated/ios/swift/HybridNitroTextMeasureSpec.swift +56 -0
- package/nitrogen/generated/ios/swift/HybridNitroTextMeasureSpec_cxx.swift +150 -0
- package/nitrogen/generated/ios/swift/HybridNitroTextViewSpec.swift +75 -0
- package/nitrogen/generated/ios/swift/HybridNitroTextViewSpec_cxx.swift +608 -0
- package/nitrogen/generated/ios/swift/NitroNumberDirection.swift +4 -0
- package/nitrogen/generated/ios/swift/NitroNumberShimmerDirection.swift +44 -0
- package/nitrogen/generated/ios/swift/NitroNumberSignDisplay.swift +52 -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 +52 -0
- package/nitrogen/generated/shared/c++/HybridNitroNumberViewSpec.hpp +58 -0
- package/nitrogen/generated/shared/c++/HybridNitroPlatformNumberFormatterSpec.cpp +23 -0
- package/nitrogen/generated/shared/c++/HybridNitroPlatformNumberFormatterSpec.hpp +65 -0
- package/nitrogen/generated/shared/c++/HybridNitroTextMeasureSpec.cpp +22 -0
- package/nitrogen/generated/shared/c++/HybridNitroTextMeasureSpec.hpp +63 -0
- package/nitrogen/generated/shared/c++/HybridNitroTextViewSpec.cpp +62 -0
- package/nitrogen/generated/shared/c++/HybridNitroTextViewSpec.hpp +115 -0
- package/nitrogen/generated/shared/c++/NitroNumberDirection.hpp +4 -0
- package/nitrogen/generated/shared/c++/NitroNumberShimmerDirection.hpp +80 -0
- package/nitrogen/generated/shared/c++/NitroNumberSignDisplay.hpp +88 -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 +52 -0
- package/nitrogen/generated/shared/c++/views/HybridNitroNumberViewComponent.hpp +80 -0
- package/nitrogen/generated/shared/c++/views/HybridNitroTextViewComponent.cpp +74 -0
- package/nitrogen/generated/shared/c++/views/HybridNitroTextViewComponent.hpp +149 -0
- package/nitrogen/generated/shared/json/NitroInputViewConfig.json +5 -0
- package/nitrogen/generated/shared/json/NitroNumberViewConfig.json +26 -0
- package/nitrogen/generated/shared/json/NitroTextViewConfig.json +30 -0
- package/package.json +2 -2
- package/src/NitroInput.tsx +42 -7
- package/src/NitroNumber.tsx +236 -12
- package/src/NitroText.tsx +166 -0
- package/src/NitroTime.tsx +68 -0
- package/src/NumberFormat.ts +563 -0
- package/src/formatProps.ts +149 -0
- package/src/index.ts +23 -0
- package/src/specs/NitroInput.nitro.ts +10 -0
- package/src/specs/NitroNumber.nitro.ts +82 -1
- package/src/specs/NitroText.nitro.ts +65 -0
- package/src/specs/NumberFormat.nitro.ts +145 -0
|
@@ -0,0 +1,64 @@
|
|
|
1
|
+
///
|
|
2
|
+
/// JNumberFormatCurrencyDisplay.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 "NumberFormatCurrencyDisplay.hpp"
|
|
12
|
+
|
|
13
|
+
namespace margelo::nitro::nitroinput {
|
|
14
|
+
|
|
15
|
+
using namespace facebook;
|
|
16
|
+
|
|
17
|
+
/**
|
|
18
|
+
* The C++ JNI bridge between the C++ enum "NumberFormatCurrencyDisplay" and the Kotlin enum "NumberFormatCurrencyDisplay".
|
|
19
|
+
*/
|
|
20
|
+
struct JNumberFormatCurrencyDisplay final: public jni::JavaClass<JNumberFormatCurrencyDisplay> {
|
|
21
|
+
public:
|
|
22
|
+
static constexpr auto kJavaDescriptor = "Lcom/margelo/nitro/nitroinput/NumberFormatCurrencyDisplay;";
|
|
23
|
+
|
|
24
|
+
public:
|
|
25
|
+
/**
|
|
26
|
+
* Convert this Java/Kotlin-based enum to the C++ enum NumberFormatCurrencyDisplay.
|
|
27
|
+
*/
|
|
28
|
+
[[maybe_unused]]
|
|
29
|
+
[[nodiscard]]
|
|
30
|
+
NumberFormatCurrencyDisplay 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<NumberFormatCurrencyDisplay>(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<JNumberFormatCurrencyDisplay> fromCpp(NumberFormatCurrencyDisplay value) {
|
|
43
|
+
static const auto clazz = javaClassStatic();
|
|
44
|
+
switch (value) {
|
|
45
|
+
case NumberFormatCurrencyDisplay::SYMBOL:
|
|
46
|
+
static const auto fieldSYMBOL = clazz->getStaticField<JNumberFormatCurrencyDisplay>("SYMBOL");
|
|
47
|
+
return clazz->getStaticFieldValue(fieldSYMBOL);
|
|
48
|
+
case NumberFormatCurrencyDisplay::NARROWSYMBOL:
|
|
49
|
+
static const auto fieldNARROWSYMBOL = clazz->getStaticField<JNumberFormatCurrencyDisplay>("NARROWSYMBOL");
|
|
50
|
+
return clazz->getStaticFieldValue(fieldNARROWSYMBOL);
|
|
51
|
+
case NumberFormatCurrencyDisplay::CODE:
|
|
52
|
+
static const auto fieldCODE = clazz->getStaticField<JNumberFormatCurrencyDisplay>("CODE");
|
|
53
|
+
return clazz->getStaticFieldValue(fieldCODE);
|
|
54
|
+
case NumberFormatCurrencyDisplay::NAME:
|
|
55
|
+
static const auto fieldNAME = clazz->getStaticField<JNumberFormatCurrencyDisplay>("NAME");
|
|
56
|
+
return clazz->getStaticFieldValue(fieldNAME);
|
|
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,58 @@
|
|
|
1
|
+
///
|
|
2
|
+
/// JNumberFormatCurrencySign.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 "NumberFormatCurrencySign.hpp"
|
|
12
|
+
|
|
13
|
+
namespace margelo::nitro::nitroinput {
|
|
14
|
+
|
|
15
|
+
using namespace facebook;
|
|
16
|
+
|
|
17
|
+
/**
|
|
18
|
+
* The C++ JNI bridge between the C++ enum "NumberFormatCurrencySign" and the Kotlin enum "NumberFormatCurrencySign".
|
|
19
|
+
*/
|
|
20
|
+
struct JNumberFormatCurrencySign final: public jni::JavaClass<JNumberFormatCurrencySign> {
|
|
21
|
+
public:
|
|
22
|
+
static constexpr auto kJavaDescriptor = "Lcom/margelo/nitro/nitroinput/NumberFormatCurrencySign;";
|
|
23
|
+
|
|
24
|
+
public:
|
|
25
|
+
/**
|
|
26
|
+
* Convert this Java/Kotlin-based enum to the C++ enum NumberFormatCurrencySign.
|
|
27
|
+
*/
|
|
28
|
+
[[maybe_unused]]
|
|
29
|
+
[[nodiscard]]
|
|
30
|
+
NumberFormatCurrencySign 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<NumberFormatCurrencySign>(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<JNumberFormatCurrencySign> fromCpp(NumberFormatCurrencySign value) {
|
|
43
|
+
static const auto clazz = javaClassStatic();
|
|
44
|
+
switch (value) {
|
|
45
|
+
case NumberFormatCurrencySign::STANDARD:
|
|
46
|
+
static const auto fieldSTANDARD = clazz->getStaticField<JNumberFormatCurrencySign>("STANDARD");
|
|
47
|
+
return clazz->getStaticFieldValue(fieldSTANDARD);
|
|
48
|
+
case NumberFormatCurrencySign::ACCOUNTING:
|
|
49
|
+
static const auto fieldACCOUNTING = clazz->getStaticField<JNumberFormatCurrencySign>("ACCOUNTING");
|
|
50
|
+
return clazz->getStaticFieldValue(fieldACCOUNTING);
|
|
51
|
+
default:
|
|
52
|
+
std::string stringValue = std::to_string(static_cast<int>(value));
|
|
53
|
+
throw std::invalid_argument("Invalid enum value (" + stringValue + "!");
|
|
54
|
+
}
|
|
55
|
+
}
|
|
56
|
+
};
|
|
57
|
+
|
|
58
|
+
} // namespace margelo::nitro::nitroinput
|
|
@@ -0,0 +1,64 @@
|
|
|
1
|
+
///
|
|
2
|
+
/// JNumberFormatNotation.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 "NumberFormatNotation.hpp"
|
|
12
|
+
|
|
13
|
+
namespace margelo::nitro::nitroinput {
|
|
14
|
+
|
|
15
|
+
using namespace facebook;
|
|
16
|
+
|
|
17
|
+
/**
|
|
18
|
+
* The C++ JNI bridge between the C++ enum "NumberFormatNotation" and the Kotlin enum "NumberFormatNotation".
|
|
19
|
+
*/
|
|
20
|
+
struct JNumberFormatNotation final: public jni::JavaClass<JNumberFormatNotation> {
|
|
21
|
+
public:
|
|
22
|
+
static constexpr auto kJavaDescriptor = "Lcom/margelo/nitro/nitroinput/NumberFormatNotation;";
|
|
23
|
+
|
|
24
|
+
public:
|
|
25
|
+
/**
|
|
26
|
+
* Convert this Java/Kotlin-based enum to the C++ enum NumberFormatNotation.
|
|
27
|
+
*/
|
|
28
|
+
[[maybe_unused]]
|
|
29
|
+
[[nodiscard]]
|
|
30
|
+
NumberFormatNotation 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<NumberFormatNotation>(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<JNumberFormatNotation> fromCpp(NumberFormatNotation value) {
|
|
43
|
+
static const auto clazz = javaClassStatic();
|
|
44
|
+
switch (value) {
|
|
45
|
+
case NumberFormatNotation::STANDARD:
|
|
46
|
+
static const auto fieldSTANDARD = clazz->getStaticField<JNumberFormatNotation>("STANDARD");
|
|
47
|
+
return clazz->getStaticFieldValue(fieldSTANDARD);
|
|
48
|
+
case NumberFormatNotation::SCIENTIFIC:
|
|
49
|
+
static const auto fieldSCIENTIFIC = clazz->getStaticField<JNumberFormatNotation>("SCIENTIFIC");
|
|
50
|
+
return clazz->getStaticFieldValue(fieldSCIENTIFIC);
|
|
51
|
+
case NumberFormatNotation::ENGINEERING:
|
|
52
|
+
static const auto fieldENGINEERING = clazz->getStaticField<JNumberFormatNotation>("ENGINEERING");
|
|
53
|
+
return clazz->getStaticFieldValue(fieldENGINEERING);
|
|
54
|
+
case NumberFormatNotation::COMPACT:
|
|
55
|
+
static const auto fieldCOMPACT = clazz->getStaticField<JNumberFormatNotation>("COMPACT");
|
|
56
|
+
return clazz->getStaticFieldValue(fieldCOMPACT);
|
|
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,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
|