CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
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
static void wrapAndPrintText(std::ostream &os, std::string const &text, size_t indent, size_t suggestedWidth)
int startColumn2() const
DescriptionParent parent() const
void setCounter(int value)
size_t lineWidth() const
static int offsetModuleLabel()
int indentation() const
void setBrief(bool value)
void setAtLeast2(size_t width)
static int offsetSectionContent()
tuple text
Definition: runonSM.py:43
void indent2(std::ostream &os) const
void setPass(int value)
DescriptionParent parent_
size_t column2() const
size_t column3() const
void setAtLeast1(size_t width)
size_t column1() const
void setAtLeast3(size_t width)
void indent(std::ostream &os) const
static int offsetTopLevelPSet()
void setSection(std::string const &value)
size_t commentWidth() const
void setParent(DescriptionParent value)
void setIndentation(int value)
void setLineWidth(size_t value)
std::string const & section() const