8#if (defined(_MSVC_LANG) ? _MSVC_LANG : __cplusplus) < 201703L
10 "OpenPine C++ wrapper headers require C++17 (std::optional, std::string_view)."
29 const ffi::PlotChar* p_;
38 std::optional<std::string_view>
title()
const {
39 ffi::PineStringRef ref;
40 if (ffi::plotCharTitle(p_, &ref)) {
50 std::optional<double>
value(uintptr_t idx)
const {
52 if (ffi::plotCharValue(p_, idx, &v)) {
62 std::optional<bool>
boolValue(uintptr_t idx)
const {
64 if (ffi::plotCharBoolValue(p_, idx, &v)) {
75 return static_cast<char32_t>(ffi::plotCharChar(p_));
81 ffi::Location
location()
const {
return ffi::plotCharLocation(p_); }
86 std::optional<uint32_t>
color(uintptr_t idx)
const {
88 if (ffi::plotCharColor(p_, idx, &col)) {
98 int32_t
offset()
const {
return ffi::plotCharOffset(p_); }
103 std::optional<std::string_view>
text()
const {
104 ffi::PineStringRef ref;
105 if (ffi::plotCharText(p_, &ref)) {
115 std::optional<uint32_t>
textColor(uintptr_t idx)
const {
117 if (ffi::plotCharTextColor(p_, idx, &col)) {
127 bool editable()
const {
return ffi::plotCharEditable(p_); }
132 ffi::Size
size()
const {
return ffi::plotCharSize(p_); }
139 if (ffi::plotCharShowLast(p_, &v)) {
154 std::optional<std::string_view>
format()
const {
155 ffi::PineStringRef ref;
156 if (ffi::plotCharFormat(p_, &ref)) {
168 if (ffi::plotCharPrecision(p_, &v)) {
A type-safe display bitmask.
std::optional< bool > boolValue(uintptr_t idx) const
Gets the series value at the specified index interpreted as boolean.
bool editable() const
Returns whether the plot-char is editable.
std::optional< std::string_view > text() const
Gets the optional text string.
int32_t offset() const
Gets the bar index offset.
ffi::Location location() const
Gets the placement location.
Display display() const
Gets the display bitmask.
std::optional< uint32_t > textColor(uintptr_t idx) const
Gets the per-bar text color.
std::optional< int32_t > precision() const
Gets the optional decimal precision.
std::optional< std::string_view > title() const
Gets the title.
bool forceOverlay() const
Gets whether the plot-char is forced to render as overlay.
std::optional< uint32_t > color(uintptr_t idx) const
Gets the per-bar color.
char32_t character() const
Gets the character codepoint.
std::optional< double > value(uintptr_t idx) const
Gets the series numeric value at the specified index.
std::optional< uintptr_t > showLast() const
Gets the show_last value, if set.
std::optional< std::string_view > format() const
Gets the optional formatting hint.
PlotChar(const ffi::PlotChar *p)
ffi::Size size() const
Gets the character size.
Type-safe wrappers for display bitmasks used by visuals.
std::string_view refToView(const ffi::PineStringRef &ref)
Shared helpers for converting C ABI string refs to std::string_view.