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 
11 namespace edm {
12 
13  class ParameterDescriptionNode;
14 
16  public:
18 
20  : brief_(false),
21  lineWidth_(80),
22  indentation_(4),
23  startColumn2_(24U),
24  section_(),
25  pass_(0),
26  column1_(0),
27  column2_(0),
28  column3_(0),
29  counter_(0),
30  parent_(OTHER) {}
31 
32  void init();
33 
34  bool brief() const { return brief_; }
35  size_t lineWidth() const { return lineWidth_; }
36  int indentation() const { return indentation_; }
37  int startColumn2() const { return startColumn2_; }
38 
39  void setBrief(bool value) { brief_ = value; }
40  void setLineWidth(size_t value) { lineWidth_ = value; }
42 
43  std::string const& section() const { return section_; }
45 
46  int pass() const { return pass_; }
47  void setPass(int value) { pass_ = value; }
48 
49  size_t column1() const { return column1_; }
50  size_t column2() const { return column2_; }
51  size_t column3() const { return column3_; }
52 
53  void setAtLeast1(size_t width) {
54  if (width > column1_)
55  column1_ = width;
56  }
57  void setAtLeast2(size_t width) {
58  if (width > column2_)
59  column2_ = width;
60  }
61  void setAtLeast3(size_t width) {
62  if (width > column3_)
63  column3_ = width;
64  }
65 
66  int counter() const { return counter_; }
67  void setCounter(int value) { counter_ = value; }
68  void incrementCounter() { ++counter_; }
69  void decrementCounter() { --counter_; }
70 
71  DescriptionParent parent() const { return parent_; }
73 
74  size_t commentWidth() const;
75 
76  static void wrapAndPrintText(std::ostream& os, std::string const& text, size_t indent, size_t suggestedWidth);
77 
78  void indent(std::ostream& os) const;
79  void indent2(std::ostream& os) const;
80 
81  static int offsetModuleLabel() { return 2; }
82  static int offsetTopLevelPSet() { return 2; }
83  static int offsetSectionContent() { return 4; }
84 
85  private:
86  bool brief_;
87  size_t lineWidth_;
89  size_t startColumn2_;
90 
92 
93  int pass_;
94 
95  size_t column1_;
96  size_t column2_;
97  size_t column3_;
98 
99  int counter_;
100 
102  };
103 } // namespace edm
104 #endif
int startColumn2() const
static void wrapAndPrintText(std::ostream &os, std::string const &text, size_t indent, size_t suggestedWidth)
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
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
void setParent(DescriptionParent value)
DescriptionParent parent() const
void setIndentation(int value)
void setLineWidth(size_t value)