2 #include "cetlib/container_algorithms.h" 3 #include "cetlib/trim.h" 18 auto pos = k.find_last_of(
"]");
19 return pos != std::string::npos && pos == k.size() - 1;
38 if (!mn.is_seq_elem) {
39 os << mn.indent << mn.name <<
": ";
47 suffix(std::unordered_set<std::string>& keysWithCommas_,
48 std::unordered_set<std::string>& keysWithEllipses_,
49 std::string
const& key,
53 if (cet::search_all(keysWithCommas_, key)) {
54 keysWithCommas_.erase(key);
57 if (cet::search_all(keysWithEllipses_, key)) {
58 keysWithEllipses_.erase(key);
59 result.append(
"\n").append(indent).append(
"...");
65 non_whitespace(std::string
const&
s, std::size_t
const sz)
78 return sz > 1 ? cet::trim_right_copy(s,
" ") :
"";
82 string_repeat(std::size_t
const n, std::string
const& s)
85 for (std::size_t i{}; i !=
n; ++i)
96 bool const showParents,
97 std::string
const& prefix,
124 for (
auto const& line : cet::split_by_regex(p.
comment(),
"\n"))
168 indent_.modify_top(std::string(3,
' '));
223 for (std::size_t i{}; i != s.
size() - 1; ++i)
228 keysWithCommas_.emplace(s.
key() +
"[0]");
229 keysWithEllipses_.emplace(s.
key() +
"[0]");
bool is_conditional() const
bool suppressFormat(ParameterBase const &p)
bool is_sequence_element(std::string const &key)
void enter_table(TableBase const &) override
void exit_sequence(SequenceBase const &) override
PrintAllowedConfiguration(std::ostream &os, bool const showParents=false, std::string const &prefix=std::string(3, ' '), bool const stlf=false)
void after_action(ParameterBase const &) override
void atom(AtomBase const &) override
void maybeReleaseTopLevelParameter(ParameterBase const &p)
void modify_top(std::string const &s)
void exit_table(TableBase const &) override
bool before_action(ParameterBase const &) override
std::string stringified_value() const
par_type parameter_type() const
std::string indent(std::size_t const i)
bool showParentsForFirstParam_
std::stack< MaybeDisplayParent > mps_
void enter_sequence(SequenceBase const &) override
std::string to_string(Flag_t< Storage > const flag)
Convert a flag into a stream (shows its index).
void delegated_parameter(DelegateBase const &) override
bool suppressTopLevelFormatting_
void cacheTopLevelParameter(ParameterBase const &p)
std::ostream & operator<<(std::ostream &, ParameterSetID const &)
std::string comment() const