PrettifierPrefixAnnotated.cc
Go to the documentation of this file.
4 #include "fhiclcpp/coding.h"
7 
8 using namespace fhicl;
9 using namespace fhicl::detail;
10 
11 //==========================================================================
12 void
14  any_t const&,
15  ParameterSet const* ps)
16 {
17  info_ = ps->get_src_info(key);
18 }
19 
20 //==========================================================================
21 
22 void
24 {
26  << nl() << indent_() << table::printed_prefix(key) << nl();
27  indent_.push();
28  name_stack_.emplace_back(key);
29 }
30 
31 void
33 {
34  name_stack_.pop_back();
35  indent_.pop();
37  << printed_suffix(key, sequence_sizes_.top()) << nl();
38 }
39 
40 //==========================================================================
41 
42 void
44  std::any const& a)
45 {
46  push_size_(a);
48  << nl() << indent_() << sequence::printed_prefix(key) << nl();
49  indent_.push();
50 }
51 
52 void
54  std::any const&)
55 {
56  indent_.pop();
58  << printed_suffix(key, sequence_sizes_.top()) << nl();
59  pop_size_();
60 }
61 
62 //==========================================================================
63 
64 void
66 {
68  << nl() << indent_() << atom::printed_prefix(key) << atom::value(a)
69  << printed_suffix(key, sequence_sizes_.top()) << nl();
70 }
71 
72 //=========================================================================
73 
74 void
76 {
77  sequence_sizes_.emplace(std::any_cast<ps_sequence_t>(a).size());
79 }
80 
81 void
83 {
84  sequence_sizes_.pop();
86 }
87 
90 {
91  std::ostringstream os;
92  os << "#KEY|";
93  cet::copy_all(name_stack_, std::ostream_iterator<std::string>{os, "."});
94  os << name << "|";
95  return os.str();
96 }
std::string printed_suffix(std::string const &key, std::size_t const sz)
static QCString name
Definition: declinfo.cpp:673
void atom(key_t const &, any_t const &) override
std::string printed_prefix(std::string const &key)
void enter_sequence(key_t const &, any_t const &) override
void exit_table(key_t const &, any_t const &) override
std::string string
Definition: nybbler.cc:12
std::string print_prefix_annotated_info(std::string const &curr_info)
void before_action(key_t const &, any_t const &, ParameterSet const *) override
decltype(auto) constexpr size(T &&obj)
ADL-aware version of std::size.
Definition: StdUtils.h:92
std::string printed_prefix(std::string const &key)
def key(type, name=None)
Definition: graph.py:13
const double a
std::string print_full_key_(name_t const &k) const
std::string value(std::any const &)
static constexpr double ps
Definition: Units.h:99
auto copy_all(FwdCont &, FwdIter)
std::string get_src_info(std::string const &key) const
void enter_table(key_t const &, any_t const &) override
std::string printed_prefix(std::string const &key)
std::string nl(std::size_t i=1)
std::string closing_brace()
void exit_sequence(key_t const &, any_t const &) override