20#ifndef PQ_PLOTTER_FORMAT_H_
21#define PQ_PLOTTER_FORMAT_H_
35 const char* ptr =
nullptr;
39 bool empty()
const {
return (ptr ==
nullptr || len == 0); }
64 const char* plotBegin =
"";
65 const char* plotEnd =
"";
66 const char* rowBegin =
"";
67 const char* rowEnd =
"\r\n";
68 const char* separator =
",";
73 const char* valueTemplate =
"$v";
74 const char* keyTemplate =
"$k";
77 bool headerEnabled =
false;
81 bool trailingSeparator =
false;
82 bool trailingRowEnd =
true;
87 const char* keyFallback =
"value_$i";
91 static void printString(Print& out,
const char* str) {
92 if (str && *str) out.print(str);
95 void beginPlot(Print& out)
const { printString(out, plotBegin); }
96 void endPlot(Print& out)
const {
97 printString(out, plotEnd);
99 void beginRow(Print& out)
const { printString(out, rowBegin); }
100 void endRow(Print& out)
const {
101 printString(out, rowEnd);
103 void sep(Print& out)
const { printString(out, separator); }
136 static void _writeTemplate(Print& out,
142 const char* keyFallback);
144 static void _writeKey(Print& out,
147 const char* keyFallback);
Lightweight non-owning view of a label (no allocation).
Definition PlotterFormat.h:34
bool empty() const
True if no label is available.
Definition PlotterFormat.h:39