8#if (defined(_MSVC_LANG) ? _MSVC_LANG : __cplusplus) < 201703L
9#error "OpenPine C++ wrapper headers require C++17."
30 InputInt(
const ffi::InputInt& data,
const ffi::Input* input =
nullptr)
31 : data_(data), input_(input) {}
33 int64_t
id()
const {
return data_.id; }
37 std::optional<std::string_view>
title()
const {
41 std::optional<std::string_view>
tooltip()
const {
49 std::optional<std::string_view>
group()
const {
53 uint64_t
display()
const {
return data_.display; }
55 bool active()
const {
return data_.active; }
60 return data_.has_min_value ? std::optional(data_.min_value) : std::nullopt;
64 return data_.has_max_value ? std::optional(data_.max_value) : std::nullopt;
67 std::optional<int64_t>
step()
const {
68 return data_.has_step ? std::optional(data_.step) : std::nullopt;
71 bool confirm()
const {
return data_.confirm; }
78 std::optional<int64_t>
optionAt(uintptr_t index)
const {
79 if (!input_)
return std::nullopt;
81 if (ffi::inputIntOptionAt(input_, index, &out))
return out;
87 const ffi::Input* input_ =
nullptr;
std::optional< std::string_view > optRefToView(bool has_field, const ffi::PineStringRef &ref)
Returns optional string_view when has_field is true, otherwise std::nullopt.
Shared helpers for converting C ABI string refs to std::string_view.
Re-exports FFI types into the openpine namespace.