-
Notifications
You must be signed in to change notification settings - Fork 9
Expand file tree
/
Copy pathJEventPropertiesOutput.cpp
More file actions
30 lines (28 loc) · 1.25 KB
/
JEventPropertiesOutput.cpp
File metadata and controls
30 lines (28 loc) · 1.25 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
///
/// JEventPropertiesOutput.cpp
/// This file was generated by nitrogen. DO NOT MODIFY THIS FILE.
/// https://github.com/mrousavy/nitro
/// Copyright © 2026 Marc Rousavy @ Margelo
///
#include "JEventPropertiesOutput.hpp"
namespace margelo::nitro::rive {
/**
* Converts JEventPropertiesOutput to std::variant<bool, std::string, double>
*/
std::variant<bool, std::string, double> JEventPropertiesOutput::toCpp() const {
if (isInstanceOf(JEventPropertiesOutput_impl::First::javaClassStatic())) {
// It's a `bool`
auto jniValue = static_cast<const JEventPropertiesOutput_impl::First*>(this)->getValue();
return static_cast<bool>(jniValue);
} else if (isInstanceOf(JEventPropertiesOutput_impl::Second::javaClassStatic())) {
// It's a `std::string`
auto jniValue = static_cast<const JEventPropertiesOutput_impl::Second*>(this)->getValue();
return jniValue->toStdString();
} else if (isInstanceOf(JEventPropertiesOutput_impl::Third::javaClassStatic())) {
// It's a `double`
auto jniValue = static_cast<const JEventPropertiesOutput_impl::Third*>(this)->getValue();
return jniValue;
}
throw std::invalid_argument("Variant is unknown Kotlin instance!");
}
} // namespace margelo::nitro::rive