Public Member Functions | Private Attributes | Static Private Attributes | List of all members
fhicl::detail::Indentation Class Reference

#include "/cvmfs/nova.opensciencegrid.org/externals/fhiclcpp/v4_06_10/source/fhiclcpp/detail/Indentation.h"

Public Member Functions

 Indentation (unsigned const iil=0u)
 
 Indentation (std::string const &prefix)
 
std::string const & operator() () const
 
void modify_top (std::string const &s)
 
auto size ()
 
void pop ()
 
void push ()
 

Private Attributes

std::stack< std::stringindents_
 

Static Private Attributes

static constexpr std::size_t indent_increment = 3u
 

Detailed Description

Definition at line 22 of file Indentation.h.

Constructor & Destructor Documentation

fhicl::detail::Indentation::Indentation ( unsigned const  iil = 0u)
inline

Definition at line 24 of file Indentation.h.

References indent_increment, and string.

25  : indents_{{std::string(iil * indent_increment, ' ')}}
26  {}
std::stack< std::string > indents_
Definition: Indentation.h:67
static constexpr std::size_t indent_increment
Definition: Indentation.h:66
enum BeamMode string
fhicl::detail::Indentation::Indentation ( std::string const &  prefix)
inline

Definition at line 28 of file Indentation.h.

References string.

28 : indents_{{prefix}} {}
std::stack< std::string > indents_
Definition: Indentation.h:67
const XML_Char * prefix
Definition: expat.h:380

Member Function Documentation

void fhicl::detail::Indentation::modify_top ( std::string const &  s)
inline

Definition at line 37 of file Indentation.h.

References ana::assert(), and indents_.

38  {
39  assert(!indents_.empty());
40  if (indents_.size() == 1ul) {
41  indents_.top() = s;
42  } else {
43  indents_.pop();
44  indents_.emplace(indents_.top() + s);
45  }
46  }
std::stack< std::string > indents_
Definition: Indentation.h:67
const XML_Char * s
Definition: expat.h:262
assert(nhit_max >=nhit_nbins)
std::string const& fhicl::detail::Indentation::operator() ( void  ) const
inline

Definition at line 31 of file Indentation.h.

References indents_.

32  {
33  return indents_.top();
34  }
std::stack< std::string > indents_
Definition: Indentation.h:67
void fhicl::detail::Indentation::pop ( )
inline

Definition at line 55 of file Indentation.h.

References indents_.

Referenced by fhicl::detail::MaybeDisplayParent::closing_braces().

56  {
57  indents_.pop();
58  }
std::stack< std::string > indents_
Definition: Indentation.h:67
void fhicl::detail::Indentation::push ( )
inline

Definition at line 60 of file Indentation.h.

References indent_increment, indents_, and string.

Referenced by fhicl::detail::MaybeDisplayParent::MaybeDisplayParent().

61  {
62  indents_.emplace(indents_.top() + std::string(indent_increment, ' '));
63  }
std::stack< std::string > indents_
Definition: Indentation.h:67
static constexpr std::size_t indent_increment
Definition: Indentation.h:66
enum BeamMode string
auto fhicl::detail::Indentation::size ( void  )
inline

Definition at line 49 of file Indentation.h.

References indents_.

50  {
51  return indents_.size();
52  }
std::stack< std::string > indents_
Definition: Indentation.h:67

Member Data Documentation

constexpr std::size_t fhicl::detail::Indentation::indent_increment = 3u
staticprivate

Definition at line 66 of file Indentation.h.

Referenced by Indentation(), and push().

std::stack<std::string> fhicl::detail::Indentation::indents_
private

Definition at line 67 of file Indentation.h.

Referenced by modify_top(), operator()(), pop(), push(), and size().


The documentation for this class was generated from the following file: