Logo ROOT  
Reference Guide
RStyleReader.hxx
Go to the documentation of this file.
1/*************************************************************************
2 * Copyright (C) 1995-2017, Rene Brun and Fons Rademakers. *
3 * All rights reserved. *
4 * *
5 * For the licensing terms see $ROOTSYS/LICENSE. *
6 * For the list of contributors see $ROOTSYS/README/CREDITS. *
7 *************************************************************************/
8
9#ifndef ROOT7_RStyleReader
10#define ROOT7_RStyleReader
11
12#include <ROOT/RStringView.hxx>
13#include <ROOT/RStyle.hxx>
14
15#include <string>
16#include <unordered_map>
17#include <vector>
18
19namespace ROOT {
20namespace Experimental {
21namespace Internal {
22/** \class RStyleReader
23\ingroup GpadROOT7
24\brief Reads the attribute config values from `.rootstylerc`.
25If the style entry is not found there, tries `~/.rootstylerc` and finally `$ROOTSYS/etc/system.rootstylerc`.
26\author Axel Naumann <axel@cern.ch>
27\date 2017-09-29
28\warning This is part of the ROOT 7 prototype! It will change without notice. It might trigger earthquakes. Feedback is welcome!
29*/
30
31/*
32class RStyleReader {
33public:
34 /// Key is the style name.
35 using AllStyles_t = std::unordered_map<std::string, RStyle>;
36
37private:
38 /// Collection of attributes to read into.
39 AllStyles_t &fAttrs;
40
41public:
42 RStyleReader(AllStyles_t &attrs): fAttrs(attrs) {}
43
44 /// Reads the attribute config values from `.rootstylerc`. If the style entry is not found there, tries
45 /// `~/.rootstylerc` and finally `$ROOTSYS/etc/system.rootstylerc`.
46 ///
47 ///\param[out] target - collection to read into.
48 void ReadDefaults();
49
50 /// Adds attributes specified in `filename` to those already existing in `fAttrs`.
51 /// Overwrites values for attributes that already exist in `attrs`!
52 /// \returns `true` on success, `false` if the file cannot be found or the syntax is wrong.
53 /// Prints an error if the syntax is wrong (but not if the file does not exist).
54 bool AddFromStyleFile(const std::string &filename);
55};
56
57*/
58} // namespace Internal
59} // namespace Experimental
60} // namespace ROOT
61
62#endif
VSD Structures.
Definition: StringConv.hxx:21