LArSoft  v09_90_00
Liquid Argon Software toolkit - https://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 21 of file Indentation.h.

Constructor & Destructor Documentation

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

Definition at line 23 of file Indentation.h.

References indent_increment.

24  : indents_{{std::string(iil * indent_increment, ' ')}}
25  {}
std::stack< std::string > indents_
Definition: Indentation.h:66
static constexpr std::size_t indent_increment
Definition: Indentation.h:65
fhicl::detail::Indentation::Indentation ( std::string const &  prefix)
inlineexplicit

Definition at line 27 of file Indentation.h.

27 : indents_{{prefix}} {}
std::stack< std::string > indents_
Definition: Indentation.h:66

Member Function Documentation

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

Definition at line 36 of file Indentation.h.

References indents_.

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

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

Definition at line 30 of file Indentation.h.

References indents_.

31  {
32  return indents_.top();
33  }
std::stack< std::string > indents_
Definition: Indentation.h:66
auto fhicl::detail::Indentation::size ( void  )
inline

Definition at line 48 of file Indentation.h.

References indents_.

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

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

Member Data Documentation

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

Definition at line 65 of file Indentation.h.

Referenced by Indentation(), and push().

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

Definition at line 66 of file Indentation.h.

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


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