16 #ifndef ROOT7_TDrawingOptsReader
17 #define ROOT7_TDrawingOptsReader
23 #include <unordered_map>
27 namespace Experimental {
35 using Attrs_t = std::unordered_map<std::string, std::string>;
61 long long ParseInt(std::string_view attr,
long long deflt, std::vector<std::string_view> opts = {});
66 double ParseFP(std::string_view attr,
double deflt);
70 long long Parse(std::string_view attr,
long long deflt, std::vector<std::string_view> opts = {})
74 double Parse(std::string_view attr,
double deflt, std::vector<std::string_view> = {}) {
return ParseFP(attr, deflt); }
long long ParseInt(std::string_view attr, long long deflt, std::vector< std::string_view > opts={})
Parse an integer attribute, or if opts is given, return the index of the string from the options file...
Attrs_t & fAttrs
Attributes to operate on.
TColor Parse(std::string_view attr, const TColor &deflt, std::vector< std::string_view >={})
Convenience overloads:
double Parse(std::string_view attr, double deflt, std::vector< std::string_view >={})
bool AddFromStyleFile(std::string_view filename)
Adds attributes specified in filename to those already existing in fAttrs.
TColor ParseColor(std::string_view attr, const TColor &deflt)
Parse a TColor from attr's value.
std::unordered_map< std::string, std::string > Attrs_t
TDrawingOptsReader(Attrs_t &attrs)
static Attrs_t ReadDefaults()
Reads the attribute config values from .rootstylerc.
double ParseFP(std::string_view attr, double deflt)
Parse a floating point attribute.
A color: Red|Green|Blue|Alpha, or a position in a TPalette.
long long Parse(std::string_view attr, long long deflt, std::vector< std::string_view > opts={})