Logo ROOT   6.12/07
Reference Guide
List of all members | Public Types | Public Member Functions | Static Public Member Functions | Private Attributes | List of all members
ROOT::Experimental::Internal::TDrawingOptsReader Class Reference

Definition at line 33 of file TDrawingOptsReader.hxx.

Public Types

using Attrs_t = std::unordered_map< std::string, std::string >
 

Public Member Functions

 TDrawingOptsReader (Attrs_t &attrs)
 
bool AddFromStyleFile (std::string_view filename)
 Adds attributes specified in filename to those already existing in fAttrs. More...
 
TColor Parse (std::string_view attr, const TColor &deflt, std::vector< std::string_view >={})
 Convenience overloads: More...
 
long long Parse (std::string_view attr, long long deflt, std::vector< std::string_view > opts={})
 
double Parse (std::string_view attr, double deflt, std::vector< std::string_view >={})
 
TColor ParseColor (std::string_view attr, const TColor &deflt)
 Parse a TColor from attr's value. More...
 
double ParseFP (std::string_view attr, double deflt)
 Parse a floating point attribute. More...
 
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 in opts. More...
 

Static Public Member Functions

static Attrs_t ReadDefaults ()
 Reads the attribute config values from .rootstylerc. More...
 

Private Attributes

Attrs_tfAttrs
 Attributes to operate on. More...
 

#include </mnt/build/workspace/root-makedoc-v612/rootspi/rdoc/src/v6-12-00-patches/graf2d/gpad/v7/src/TDrawingOptsReader.hxx>

Member Typedef Documentation

◆ Attrs_t

using ROOT::Experimental::Internal::TDrawingOptsReader::Attrs_t = std::unordered_map<std::string, std::string>

Definition at line 35 of file TDrawingOptsReader.hxx.

Constructor & Destructor Documentation

◆ TDrawingOptsReader()

ROOT::Experimental::Internal::TDrawingOptsReader::TDrawingOptsReader ( Attrs_t attrs)
inline

Definition at line 42 of file TDrawingOptsReader.hxx.

Member Function Documentation

◆ AddFromStyleFile()

bool TDrawingOptsReader::AddFromStyleFile ( std::string_view  filename)

Adds attributes specified in filename to those already existing in fAttrs.

Overwrites values for attributes that already exist in attrs!

Returns
true on success, false if the file cannot be found or the syntax is wrong. Prints an error if the syntax is wrong (but not if the file does not exist).

Definition at line 62 of file TDrawingOptsReader.cxx.

◆ Parse() [1/3]

TColor ROOT::Experimental::Internal::TDrawingOptsReader::Parse ( std::string_view  attr,
const TColor deflt,
std::vector< std::string_view = {} 
)
inline

Convenience overloads:

Definition at line 69 of file TDrawingOptsReader.hxx.

◆ Parse() [2/3]

long long ROOT::Experimental::Internal::TDrawingOptsReader::Parse ( std::string_view  attr,
long long  deflt,
std::vector< std::string_view opts = {} 
)
inline

Definition at line 70 of file TDrawingOptsReader.hxx.

◆ Parse() [3/3]

double ROOT::Experimental::Internal::TDrawingOptsReader::Parse ( std::string_view  attr,
double  deflt,
std::vector< std::string_view = {} 
)
inline

Definition at line 74 of file TDrawingOptsReader.hxx.

◆ ParseColor()

ROOT::Experimental::TColor TDrawingOptsReader::ParseColor ( std::string_view  attr,
const TColor deflt 
)

Parse a TColor from attr's value.

Colors can be specified as RGBA (red green blue alpha) or RRGGBBAA: #fa7f #ffa07bff For all predefined colors in TColor, colors can be specified as name without leading 'k', e.g. red for TColor::kRed. Prints an error and returns TColor::kBlack if the attribute string cannot be parsed or if the attribute has no entry in fAttrs.

Definition at line 41 of file TDrawingOptsReader.cxx.

◆ ParseFP()

double TDrawingOptsReader::ParseFP ( std::string_view  attr,
double  deflt 
)

Parse a floating point attribute.

Returns 0. and prints an error if the attribute string cannot be parsed as a floating point number. Prints an error if the attribute has no entry in fAttrs.

Definition at line 56 of file TDrawingOptsReader.cxx.

◆ ParseInt()

long long TDrawingOptsReader::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 in opts.

Returns 0 (and prints an error) if the string cannot be found in opts, or if the integer cannot be parsed or if the attribute has no entry in fAttrs.

Definition at line 49 of file TDrawingOptsReader.cxx.

◆ ReadDefaults()

TDrawingOptsReader::Attrs_t TDrawingOptsReader::ReadDefaults ( )
static

Reads the attribute config values from .rootstylerc.

If the style entry is not found there, tries ~/.rootstylerc and finally $ROOTSYS/system.rootstylerc.

Definition at line 30 of file TDrawingOptsReader.cxx.

Member Data Documentation

◆ fAttrs

Attrs_t& ROOT::Experimental::Internal::TDrawingOptsReader::fAttrs
private

Attributes to operate on.

Definition at line 39 of file TDrawingOptsReader.hxx.

Libraries for ROOT::Experimental::Internal::TDrawingOptsReader:
[legend]

The documentation for this class was generated from the following files: