LArSoft  v07_13_02
Liquid Argon Software toolkit - http://larsoft.org/
fhicl::detail::Indentation Class Reference

#include "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::string > indents_
 

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.

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
fhicl::detail::Indentation::Indentation ( std::string const &  prefix)
inline

Definition at line 28 of file Indentation.h.

28 : indents_{{prefix}} {}
std::stack< std::string > indents_
Definition: Indentation.h:67

Member Function Documentation

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

Definition at line 37 of file Indentation.h.

References indents_, and s.

Referenced by fhicl::detail::PrintAllowedConfiguration::after_action(), and fhicl::detail::PrintAllowedConfiguration::before_action().

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  }
Float_t s
Definition: plot.C:23
std::stack< std::string > indents_
Definition: Indentation.h:67
std::string const& fhicl::detail::Indentation::operator() ( ) 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
auto fhicl::detail::Indentation::size ( void  )
inline

Definition at line 49 of file Indentation.h.

References indents_.

Referenced by fhicl::detail::PrintAllowedConfiguration::before_action().

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: