8#if (defined(_MSVC_LANG) ? _MSVC_LANG : __cplusplus) < 201703L
9#error "OpenPine C++ wrapper headers require C++17."
31 const ffi::Input* input =
nullptr)
32 : data_(data), input_(input) {}
34 int64_t
id()
const {
return data_.id; }
42 if (data_.is_chart_default)
return std::nullopt;
43 return data_.default_value;
46 std::optional<std::string_view>
title()
const {
50 std::optional<std::string_view>
tooltip()
const {
58 std::optional<std::string_view>
group()
const {
62 uint64_t
display()
const {
return data_.display; }
64 bool active()
const {
return data_.active; }
68 bool confirm()
const {
return data_.confirm; }
75 std::optional<std::string_view>
optionAt(uintptr_t index)
const {
76 if (!input_)
return std::nullopt;
77 ffi::PineStringRef ref{};
78 if (!ffi::inputTimeFrameOptionAt(input_, index, &ref))
return std::nullopt;
83 ffi::InputTimeFrame data_;
84 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.