Public Member Functions | Private Attributes | Static Private Attributes | List of all members
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::stringindents_
 

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.

24  : indents_{{std::string(iil * indent_increment, ' ')}}
25  {}
std::stack< std::string > indents_
Definition: Indentation.h:66
std::string string
Definition: nybbler.cc:12
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.

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
static QCString * s
Definition: config.cpp:1042
std::string const& fhicl::detail::Indentation::operator() ( ) const
inline

Definition at line 30 of file Indentation.h.

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

Definition at line 54 of file Indentation.h.

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

Definition at line 59 of file Indentation.h.

60  {
61  indents_.emplace(indents_.top() + std::string(indent_increment, ' '));
62  }
std::stack< std::string > indents_
Definition: Indentation.h:66
std::string string
Definition: nybbler.cc:12
static constexpr std::size_t indent_increment
Definition: Indentation.h:65
auto fhicl::detail::Indentation::size ( )
inline

Definition at line 48 of file Indentation.h.

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.

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

Definition at line 66 of file Indentation.h.


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