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

void addCategory (std::string const &pluginCategory, std::string const &section)
 
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
 
std::string sectionOfCategoryAlreadyPrinted (std::string const &pluginCategory) 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::vector< std::pair< std::string, std::string > > pluginCategoriesAlreadyPrinted_
 
std::string section_
 
size_t startColumn2_
 

Detailed Description

Definition at line 17 of file DocFormatHelper.h.

Member Enumeration Documentation

◆ DescriptionParent

Constructor & Destructor Documentation

◆ DocFormatHelper()

edm::DocFormatHelper::DocFormatHelper ( )
inline

Member Function Documentation

◆ addCategory()

void edm::DocFormatHelper::addCategory ( std::string const &  pluginCategory,
std::string const &  section 
)

Definition at line 146 of file DocFormatHelper.cc.

References pluginCategoriesAlreadyPrinted_, cond::pluginCategory(), and section().

146  {
148  }
std::vector< std::pair< std::string, std::string > > pluginCategoriesAlreadyPrinted_
std::string const & section() const
const char * pluginCategory()

◆ brief()

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

Definition at line 36 of file DocFormatHelper.h.

References brief_.

Referenced by edm::ParameterSetDescription::print(), edm::EmptyGroupDescription::print_(), edm::AllowedLabelsDescriptionBase::print_(), edm::ORGroupDescription::print_(), edm::IfExistsDescription::print_(), edm::ANDGroupDescription::print_(), edm::XORGroupDescription::print_(), edm::ParameterWildcardBase::print_(), edm::ParameterDescriptionBase::print_(), edm::ParameterSwitchBase::printBase(), edm::ParameterDescriptionBase::printDefault_(), edm::ParameterWildcardWithSpecifics::printNestedContent_(), edm::AllowedLabelsDescriptionBase::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_().

36 { return brief_; }

◆ 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

◆ counter()

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

Definition at line 68 of file DocFormatHelper.h.

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_().

68 { return counter_; }

◆ 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  )

Definition at line 114 of file DocFormatHelper.cc.

References column1_, column2_, column3_, counter_, OTHER, parent_, pass_, section_, and AlCaHLTBitMon_QueryRunRegistry::string.

Referenced by edm::ORGroupDescription::printNestedContent_(), edm::ANDGroupDescription::printNestedContent_(), edm::XORGroupDescription::printNestedContent_(), edm::IfExistsDescription::printNestedContent_(), edm::PluginDescription< T >::printNestedContent_(), edm::ParameterDescription< ParameterSetDescription >::printNestedContent_(), edm::ParameterDescription< std::vector< ParameterSet > >::printNestedContent_(), edm::ParameterSwitchBase::printNestedContentBase(), and edm::AllowedLabelsDescriptionBase::printNestedContentBase_().

◆ lineWidth()

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

Definition at line 37 of file DocFormatHelper.h.

References lineWidth_.

Referenced by commentWidth().

37 { return lineWidth_; }

◆ offsetModuleLabel()

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

Definition at line 83 of file DocFormatHelper.h.

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

83 { return 2; }

◆ offsetSectionContent()

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

◆ offsetTopLevelPSet()

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

Definition at line 84 of file DocFormatHelper.h.

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

84 { return 2; }

◆ 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 45 of file DocFormatHelper.h.

References section_.

Referenced by addCategory(), 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::XORGroupDescription::printNestedContent_(), edm::IfExistsDescription::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_().

45 { return section_; }

◆ sectionOfCategoryAlreadyPrinted()

std::string edm::DocFormatHelper::sectionOfCategoryAlreadyPrinted ( std::string const &  pluginCategory) const

Definition at line 150 of file DocFormatHelper.cc.

References pluginCategoriesAlreadyPrinted_, cond::pluginCategory(), and AlCaHLTBitMon_QueryRunRegistry::string.

150  {
151  auto iter = std::find_if(
154  [&pluginCategory](std::pair<std::string, std::string> const& elem) { return elem.first == pluginCategory; });
155  if (iter == pluginCategoriesAlreadyPrinted_.end()) {
156  return std::string();
157  }
158  return iter->second;
159  }
std::vector< std::pair< std::string, std::string > > pluginCategoriesAlreadyPrinted_
const char * pluginCategory()

◆ 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

◆ 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

◆ 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 98 of file DocFormatHelper.cc.

References indent(), and submitPVValidationJobs::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().

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

Member Data Documentation

◆ brief_

bool edm::DocFormatHelper::brief_
private

Definition at line 92 of file DocFormatHelper.h.

Referenced by brief(), and setBrief().

◆ column1_

size_t edm::DocFormatHelper::column1_
private

Definition at line 101 of file DocFormatHelper.h.

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

◆ column2_

size_t edm::DocFormatHelper::column2_
private

Definition at line 102 of file DocFormatHelper.h.

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

◆ column3_

size_t edm::DocFormatHelper::column3_
private

Definition at line 103 of file DocFormatHelper.h.

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

◆ counter_

int edm::DocFormatHelper::counter_
private

Definition at line 105 of file DocFormatHelper.h.

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

◆ indentation_

int edm::DocFormatHelper::indentation_
private

Definition at line 94 of file DocFormatHelper.h.

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

◆ lineWidth_

size_t edm::DocFormatHelper::lineWidth_
private

Definition at line 93 of file DocFormatHelper.h.

Referenced by lineWidth(), and setLineWidth().

◆ parent_

DescriptionParent edm::DocFormatHelper::parent_
private

Definition at line 107 of file DocFormatHelper.h.

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

◆ pass_

int edm::DocFormatHelper::pass_
private

Definition at line 99 of file DocFormatHelper.h.

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

◆ pluginCategoriesAlreadyPrinted_

std::vector<std::pair<std::string, std::string> > edm::DocFormatHelper::pluginCategoriesAlreadyPrinted_
private

Definition at line 91 of file DocFormatHelper.h.

Referenced by addCategory(), and sectionOfCategoryAlreadyPrinted().

◆ section_

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

Definition at line 97 of file DocFormatHelper.h.

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

◆ startColumn2_

size_t edm::DocFormatHelper::startColumn2_
private

Definition at line 95 of file DocFormatHelper.h.

Referenced by indent2(), and startColumn2().