8#if (defined(_MSVC_LANG) ? _MSVC_LANG : __cplusplus) < 201703L
9#error "OpenPine C++ wrapper headers require C++17."
30 InputString(
const ffi::InputString& data,
const ffi::Input* input =
nullptr)
31 : data_(data), input_(input) {}
33 int64_t
id()
const {
return data_.id; }
39 std::optional<std::string_view>
title()
const {
43 std::optional<std::string_view>
tooltip()
const {
51 std::optional<std::string_view>
group()
const {
55 uint64_t
display()
const {
return data_.display; }
57 bool active()
const {
return data_.active; }
61 bool confirm()
const {
return data_.confirm; }
68 std::optional<std::string_view>
optionAt(uintptr_t index)
const {
69 if (!input_)
return std::nullopt;
70 ffi::PineStringRef ref{};
71 if (!ffi::inputStringOptionAt(input_, index, &ref))
return std::nullopt;
76 ffi::InputString data_;
77 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.
std::string_view refToView(const ffi::PineStringRef &ref)
Shared helpers for converting C ABI string refs to std::string_view.
Re-exports FFI types into the openpine namespace.