CMS 3D CMS Logo

List of all members | Public Types | Public Member Functions | Static Public Member Functions | Private Attributes
edm::DocFormatHelper Class Reference

#include <DocFormatHelper.h>

Public Types

enum  DescriptionParent {
  TOP, OR, XOR, AND,
  OTHER
}
 

Public Member Functions

bool brief () const
 
size_t column1 () const
 
size_t column2 () const
 
size_t column3 () const
 
size_t commentWidth () const
 
int counter () const
 
void decrementCounter ()
 
 DocFormatHelper ()
 
void incrementCounter ()
 
void indent (std::ostream &os) const
 
void indent2 (std::ostream &os) const
 
int indentation () const
 
void init ()
 
size_t lineWidth () const
 
DescriptionParent parent () const
 
int pass () const
 
std::string const & section () const
 
void setAtLeast1 (size_t width)
 
void setAtLeast2 (size_t width)
 
void setAtLeast3 (size_t width)
 
void setBrief (bool value)
 
void setCounter (int value)
 
void setIndentation (int value)
 
void setLineWidth (size_t value)
 
void setParent (DescriptionParent value)
 
void setPass (int value)
 
void setSection (std::string const &value)
 
int startColumn2 () const
 

Static Public Member Functions

static int offsetModuleLabel ()
 
static int offsetSectionContent ()
 
static int offsetTopLevelPSet ()
 
static void wrapAndPrintText (std::ostream &os, std::string const &text, size_t indent, size_t suggestedWidth)
 

Private Attributes

bool brief_
 
size_t column1_
 
size_t column2_
 
size_t column3_
 
int counter_
 
int indentation_
 
size_t lineWidth_
 
DescriptionParent parent_
 
int pass_
 
std::string section_
 
size_t startColumn2_
 

Detailed Description

Definition at line 15 of file DocFormatHelper.h.

Member Enumeration Documentation

◆ DescriptionParent

Enumerator
TOP 
OR 
XOR 
AND 
OTHER 

Definition at line 17 of file DocFormatHelper.h.

17 { TOP, OR, XOR, AND, OTHER };

Constructor & Destructor Documentation

◆ DocFormatHelper()

edm::DocFormatHelper::DocFormatHelper ( )
inline

Definition at line 19 of file DocFormatHelper.h.

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) {}

Member Function Documentation

◆ brief()

bool edm::DocFormatHelper::brief ( ) const
inline

◆ column1()

size_t edm::DocFormatHelper::column1 ( ) const
inline

◆ column2()

size_t edm::DocFormatHelper::column2 ( ) const
inline

◆ column3()

size_t edm::DocFormatHelper::column3 ( ) const
inline

◆ commentWidth()

size_t edm::DocFormatHelper::commentWidth ( ) const

Definition at line 123 of file DocFormatHelper.cc.

123  {
124  // Make the length of a comment at least 30 characters
125  // per line, longer if there is more space available
126  size_t width = 30U;
127  if (lineWidth() > startColumn2() + 30U) {
128  width = lineWidth() - startColumn2();
129  }
130  return width;
131  }

References lineWidth(), startColumn2(), mitigatedMETSequence_cff::U, and ApeEstimator_cff::width.

Referenced by edm::AllowedLabelsDescriptionBase::print_(), edm::ORGroupDescription::print_(), edm::XORGroupDescription::print_(), edm::ANDGroupDescription::print_(), edm::IfExistsDescription::print_(), edm::ParameterWildcardBase::print_(), edm::ParameterDescriptionBase::print_(), and edm::ParameterSwitchBase::printBase().

◆ counter()

int edm::DocFormatHelper::counter ( ) const
inline

Definition at line 66 of file DocFormatHelper.h.

66 { return counter_; }

References counter_.

Referenced by counter.Counters::__getitem__(), edm::AllowedLabelsDescriptionBase::print_(), edm::ORGroupDescription::print_(), edm::ANDGroupDescription::print_(), edm::XORGroupDescription::print_(), edm::IfExistsDescription::print_(), edm::ParameterWildcardBase::print_(), edm::ParameterSwitchBase::printBase(), edm::ParameterDescriptionBase::printDefault_(), edm::ParameterDescription< ParameterSetDescription >::printDefault_(), edm::ParameterDescription< std::vector< ParameterSet > >::printDefault_(), edm::ParameterWildcardWithSpecifics::printNestedContent_(), edm::ORGroupDescription::printNestedContent_(), edm::IfExistsDescription::printNestedContent_(), edm::XORGroupDescription::printNestedContent_(), edm::ANDGroupDescription::printNestedContent_(), edm::AllowedLabelsDescription< ParameterSetDescription >::printNestedContent_(), edm::ParameterDescriptionBase::printNestedContent_(), edm::ParameterWildcard< ParameterSetDescription >::printNestedContent_(), edm::AllowedLabelsDescription< std::vector< ParameterSet > >::printNestedContent_(), edm::ParameterWildcard< std::vector< ParameterSet > >::printNestedContent_(), edm::ParameterDescription< ParameterSetDescription >::printNestedContent_(), edm::ParameterDescription< std::vector< ParameterSet > >::printNestedContent_(), edm::ParameterSwitchBase::printNestedContentBase(), and edm::AllowedLabelsDescriptionBase::printNestedContentBase_().

◆ decrementCounter()

void edm::DocFormatHelper::decrementCounter ( )
inline

◆ incrementCounter()

void edm::DocFormatHelper::incrementCounter ( )
inline

◆ indent()

void edm::DocFormatHelper::indent ( std::ostream &  os) const

◆ indent2()

void edm::DocFormatHelper::indent2 ( std::ostream &  os) const

◆ indentation()

int edm::DocFormatHelper::indentation ( ) const
inline

◆ init()

void edm::DocFormatHelper::init ( void  )

◆ lineWidth()

size_t edm::DocFormatHelper::lineWidth ( ) const
inline

Definition at line 35 of file DocFormatHelper.h.

35 { return lineWidth_; }

References lineWidth_.

Referenced by commentWidth().

◆ offsetModuleLabel()

static int edm::DocFormatHelper::offsetModuleLabel ( )
inlinestatic

Definition at line 81 of file DocFormatHelper.h.

81 { return 2; }

Referenced by edm::ConfigurationDescriptions::print().

◆ offsetSectionContent()

static int edm::DocFormatHelper::offsetSectionContent ( )
inlinestatic

◆ offsetTopLevelPSet()

static int edm::DocFormatHelper::offsetTopLevelPSet ( )
inlinestatic

Definition at line 82 of file DocFormatHelper.h.

82 { return 2; }

Referenced by edm::ConfigurationDescriptions::printForLabel().

◆ parent()

DescriptionParent edm::DocFormatHelper::parent ( void  ) const
inline

◆ pass()

int edm::DocFormatHelper::pass ( ) const
inline

◆ section()

std::string const& edm::DocFormatHelper::section ( ) const
inline

Definition at line 43 of file DocFormatHelper.h.

43 { return section_; }

References section_.

Referenced by VarParsing.VarParsing::parseArguments(), edm::AllowedLabelsDescriptionBase::print_(), edm::ORGroupDescription::print_(), edm::IfExistsDescription::print_(), edm::ANDGroupDescription::print_(), edm::XORGroupDescription::print_(), edm::ParameterWildcardBase::print_(), edm::ParameterSwitchBase::printBase(), edm::ParameterDescriptionBase::printDefault_(), edm::ParameterDescription< ParameterSetDescription >::printDefault_(), edm::ParameterDescription< std::vector< ParameterSet > >::printDefault_(), edm::ParameterWildcardWithSpecifics::printNestedContent_(), edm::ORGroupDescription::printNestedContent_(), edm::IfExistsDescription::printNestedContent_(), edm::XORGroupDescription::printNestedContent_(), edm::ANDGroupDescription::printNestedContent_(), edm::AllowedLabelsDescription< ParameterSetDescription >::printNestedContent_(), edm::ParameterDescriptionBase::printNestedContent_(), edm::ParameterWildcard< ParameterSetDescription >::printNestedContent_(), edm::AllowedLabelsDescription< std::vector< ParameterSet > >::printNestedContent_(), edm::ParameterWildcard< std::vector< ParameterSet > >::printNestedContent_(), edm::ParameterDescription< ParameterSetDescription >::printNestedContent_(), edm::ParameterDescription< std::vector< ParameterSet > >::printNestedContent_(), edm::ParameterSwitchBase::printNestedContentBase(), and edm::AllowedLabelsDescriptionBase::printNestedContentBase_().

◆ setAtLeast1()

void edm::DocFormatHelper::setAtLeast1 ( size_t  width)
inline

◆ setAtLeast2()

void edm::DocFormatHelper::setAtLeast2 ( size_t  width)
inline

◆ setAtLeast3()

void edm::DocFormatHelper::setAtLeast3 ( size_t  width)
inline

◆ setBrief()

void edm::DocFormatHelper::setBrief ( bool  value)
inline

Definition at line 39 of file DocFormatHelper.h.

39 { brief_ = value; }

References brief_, and relativeConstraints::value.

Referenced by edm::ConfigurationDescriptions::printForLabel().

◆ setCounter()

void edm::DocFormatHelper::setCounter ( int  value)
inline

◆ setIndentation()

void edm::DocFormatHelper::setIndentation ( int  value)
inline

◆ setLineWidth()

void edm::DocFormatHelper::setLineWidth ( size_t  value)
inline

Definition at line 40 of file DocFormatHelper.h.

40 { lineWidth_ = value; }

References lineWidth_, and relativeConstraints::value.

Referenced by edm::ConfigurationDescriptions::printForLabel().

◆ setParent()

void edm::DocFormatHelper::setParent ( DescriptionParent  value)
inline

◆ setPass()

void edm::DocFormatHelper::setPass ( int  value)
inline

◆ setSection()

void edm::DocFormatHelper::setSection ( std::string const &  value)
inline

◆ startColumn2()

int edm::DocFormatHelper::startColumn2 ( ) const
inline

◆ wrapAndPrintText()

void edm::DocFormatHelper::wrapAndPrintText ( std::ostream &  os,
std::string const &  text,
size_t  indent,
size_t  suggestedWidth 
)
static

Definition at line 97 of file DocFormatHelper.cc.

100  {
101  size_t pos = text.find_first_of('\n');
102  if (pos == std::string::npos) {
103  // no embedded newlines
104  wrapAndPrintLine(os, text, indent, suggestedWidth);
105  } else {
106  // print the first line.
107  wrapAndPrintLine(os, text.substr(0, pos), indent, suggestedWidth);
108  // print all lines after the first.
109  wrapAndPrintText(os, text.substr(pos + 1), indent, suggestedWidth);
110  }
111  }

References indent(), and runonSM::text.

Referenced by edm::ConfigurationDescriptions::print(), edm::AllowedLabelsDescriptionBase::print_(), edm::ORGroupDescription::print_(), edm::ANDGroupDescription::print_(), edm::IfExistsDescription::print_(), edm::XORGroupDescription::print_(), edm::ParameterWildcardBase::print_(), edm::ParameterDescriptionBase::print_(), edm::ParameterSwitchBase::printBase(), and edm::ConfigurationDescriptions::printForLabel().

Member Data Documentation

◆ brief_

bool edm::DocFormatHelper::brief_
private

Definition at line 86 of file DocFormatHelper.h.

Referenced by brief(), and setBrief().

◆ column1_

size_t edm::DocFormatHelper::column1_
private

Definition at line 95 of file DocFormatHelper.h.

Referenced by column1(), init(), and setAtLeast1().

◆ column2_

size_t edm::DocFormatHelper::column2_
private

Definition at line 96 of file DocFormatHelper.h.

Referenced by column2(), init(), and setAtLeast2().

◆ column3_

size_t edm::DocFormatHelper::column3_
private

Definition at line 97 of file DocFormatHelper.h.

Referenced by column3(), init(), and setAtLeast3().

◆ counter_

int edm::DocFormatHelper::counter_
private

Definition at line 99 of file DocFormatHelper.h.

Referenced by counter(), decrementCounter(), incrementCounter(), init(), and setCounter().

◆ indentation_

int edm::DocFormatHelper::indentation_
private

Definition at line 88 of file DocFormatHelper.h.

Referenced by indent(), indentation(), and setIndentation().

◆ lineWidth_

size_t edm::DocFormatHelper::lineWidth_
private

Definition at line 87 of file DocFormatHelper.h.

Referenced by lineWidth(), and setLineWidth().

◆ parent_

DescriptionParent edm::DocFormatHelper::parent_
private

Definition at line 101 of file DocFormatHelper.h.

Referenced by init(), parent(), and setParent().

◆ pass_

int edm::DocFormatHelper::pass_
private

Definition at line 93 of file DocFormatHelper.h.

Referenced by init(), pass(), and setPass().

◆ section_

std::string edm::DocFormatHelper::section_
private

Definition at line 91 of file DocFormatHelper.h.

Referenced by init(), section(), and setSection().

◆ startColumn2_

size_t edm::DocFormatHelper::startColumn2_
private

Definition at line 89 of file DocFormatHelper.h.

Referenced by indent2(), and startColumn2().

edm::DocFormatHelper::column1_
size_t column1_
Definition: DocFormatHelper.h:95
edm::DocFormatHelper::TOP
Definition: DocFormatHelper.h:17
ApeEstimator_cff.width
width
Definition: ApeEstimator_cff.py:24
edm::DocFormatHelper::column2_
size_t column2_
Definition: DocFormatHelper.h:96
edm::DocFormatHelper::pass_
int pass_
Definition: DocFormatHelper.h:93
pos
Definition: PixelAliasList.h:18
edm::DocFormatHelper::indentation_
int indentation_
Definition: DocFormatHelper.h:88
edm::DocFormatHelper::OR
Definition: DocFormatHelper.h:17
edm::DocFormatHelper::column3_
size_t column3_
Definition: DocFormatHelper.h:97
edm::DocFormatHelper::counter_
int counter_
Definition: DocFormatHelper.h:99
edm::DocFormatHelper::lineWidth_
size_t lineWidth_
Definition: DocFormatHelper.h:87
edm::DocFormatHelper::lineWidth
size_t lineWidth() const
Definition: DocFormatHelper.h:35
mitigatedMETSequence_cff.U
U
Definition: mitigatedMETSequence_cff.py:36
AlCaHLTBitMon_QueryRunRegistry.string
string
Definition: AlCaHLTBitMon_QueryRunRegistry.py:256
edm::DocFormatHelper::startColumn2
int startColumn2() const
Definition: DocFormatHelper.h:37
edm::DocFormatHelper::wrapAndPrintText
static void wrapAndPrintText(std::ostream &os, std::string const &text, size_t indent, size_t suggestedWidth)
Definition: DocFormatHelper.cc:97
edm::DocFormatHelper::startColumn2_
size_t startColumn2_
Definition: DocFormatHelper.h:89
edm::DocFormatHelper::indent
void indent(std::ostream &os) const
Definition: DocFormatHelper.cc:133
edm::DocFormatHelper::brief_
bool brief_
Definition: DocFormatHelper.h:86
relativeConstraints.value
value
Definition: relativeConstraints.py:53
edm::DocFormatHelper::section_
std::string section_
Definition: DocFormatHelper.h:91
edm::DocFormatHelper::XOR
Definition: DocFormatHelper.h:17
edm::DocFormatHelper::parent_
DescriptionParent parent_
Definition: DocFormatHelper.h:101
edm::DocFormatHelper::AND
Definition: DocFormatHelper.h:17
edm::DocFormatHelper::OTHER
Definition: DocFormatHelper.h:17
runonSM.text
text
Definition: runonSM.py:43