CMS 3D CMS Logo

DocFormatHelper.h
Go to the documentation of this file.
1 #ifndef FWCore_ParameterSet_DocFormatHelper_h
2 #define FWCore_ParameterSet_DocFormatHelper_h
3 
4 // Used internally by ParameterSetDescription in its
5 // print function. This function is used to produce
6 // human readable documentation.
7 
8 #include <string>
9 #include <iosfwd>
10 #include <utility>
11 #include <vector>
12 
13 namespace edm {
14 
15  class ParameterDescriptionNode;
16 
18  public:
20 
22  : brief_(false),
23  lineWidth_(80),
24  indentation_(4),
25  startColumn2_(24U),
26  section_(),
27  pass_(0),
28  column1_(0),
29  column2_(0),
30  column3_(0),
31  counter_(0),
32  parent_(OTHER) {}
33 
34  void init();
35 
36  bool brief() const { return brief_; }
37  size_t lineWidth() const { return lineWidth_; }
38  int indentation() const { return indentation_; }
39  int startColumn2() const { return startColumn2_; }
40 
41  void setBrief(bool value) { brief_ = value; }
42  void setLineWidth(size_t value) { lineWidth_ = value; }
44 
45  std::string const& section() const { return section_; }
47 
48  int pass() const { return pass_; }
49  void setPass(int value) { pass_ = value; }
50 
51  size_t column1() const { return column1_; }
52  size_t column2() const { return column2_; }
53  size_t column3() const { return column3_; }
54 
55  void setAtLeast1(size_t width) {
56  if (width > column1_)
57  column1_ = width;
58  }
59  void setAtLeast2(size_t width) {
60  if (width > column2_)
61  column2_ = width;
62  }
63  void setAtLeast3(size_t width) {
64  if (width > column3_)
65  column3_ = width;
66  }
67 
68  int counter() const { return counter_; }
69  void setCounter(int value) { counter_ = value; }
70  void incrementCounter() { ++counter_; }
71  void decrementCounter() { --counter_; }
72 
73  DescriptionParent parent() const { return parent_; }
75 
76  size_t commentWidth() const;
77 
78  static void wrapAndPrintText(std::ostream& os, std::string const& text, size_t indent, size_t suggestedWidth);
79 
80  void indent(std::ostream& os) const;
81  void indent2(std::ostream& os) const;
82 
83  static int offsetModuleLabel() { return 2; }
84  static int offsetTopLevelPSet() { return 2; }
85  static int offsetSectionContent() { return 4; }
86 
89 
90  private:
91  std::vector<std::pair<std::string, std::string>> pluginCategoriesAlreadyPrinted_;
92  bool brief_;
93  size_t lineWidth_;
95  size_t startColumn2_;
96 
98 
99  int pass_;
100 
101  size_t column1_;
102  size_t column2_;
103  size_t column3_;
104 
105  int counter_;
106 
108  };
109 } // namespace edm
110 #endif
int startColumn2() const
static void wrapAndPrintText(std::ostream &os, std::string const &text, size_t indent, size_t suggestedWidth)
std::vector< std::pair< std::string, std::string > > pluginCategoriesAlreadyPrinted_
size_t commentWidth() const
void setCounter(int value)
void indent2(std::ostream &os) const
static int offsetModuleLabel()
void setBrief(bool value)
size_t column1() const
void setAtLeast2(size_t width)
static int offsetSectionContent()
Definition: value.py:1
size_t column3() const
void setPass(int value)
size_t column2() const
DescriptionParent parent_
std::string const & section() const
const char * pluginCategory()
void addCategory(std::string const &pluginCategory, std::string const &section)
HLT enums.
size_t lineWidth() const
void setAtLeast1(size_t width)
void setAtLeast3(size_t width)
static int offsetTopLevelPSet()
void setSection(std::string const &value)
void indent(std::ostream &os) const
std::string sectionOfCategoryAlreadyPrinted(std::string const &pluginCategory) const
void setParent(DescriptionParent value)
DescriptionParent parent() const
void setIndentation(int value)
void setLineWidth(size_t value)