2 #include "cetlib/container_algorithms.h" 3 #include "cetlib/split_by_regex.h" 4 #include "cetlib/trim.h" 17 std::regex
const reNewLine{
"\n"};
22 auto pos = k.find_last_of(
"]");
23 return pos != std::string::npos && pos == k.size() - 1;
40 if (!mn.is_seq_elem) {
41 os << mn.indent << mn.name <<
": ";
49 suffix(std::unordered_set<std::string>& keysWithCommas_,
50 std::unordered_set<std::string>& keysWithEllipses_,
51 std::string
const& key,
55 if (cet::search_all(keysWithCommas_, key)) {
56 keysWithCommas_.erase(key);
59 if (cet::search_all(keysWithEllipses_, key)) {
60 keysWithEllipses_.erase(key);
61 result.append(
"\n").append(indent).append(
"...");
67 non_whitespace(std::string
const& s, std::size_t
const sz)
80 return sz > 1 ? cet::trim_right_copy(s,
" ") :
"";
84 string_repeat(std::size_t
const n, std::string
const& s)
87 for (std::size_t i{}; i !=
n; ++i)
98 bool const showParents,
99 std::string
const& prefix,
128 for (
auto const& line : cet::split_by_regex(p.
comment(), reNewLine))
172 indent_.modify_top(std::string(3,
' '));
227 for (std::size_t i{}; i != s.
size() - 1; ++i)
232 keysWithCommas_.emplace(s.
key() +
"[0]");
233 keysWithEllipses_.emplace(s.
key() +
"[0]");
bool is_conditional() const
bool suppressFormat(ParameterBase const &p)
bool empty() const noexcept
bool is_sequence_element(std::string const &key)
void enter_table(TableBase const &) override
std::size_t size() const noexcept
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)
~PrintAllowedConfiguration()
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
decltype(auto) constexpr to_string(T &&obj)
ADL-aware version of std::to_string.
std::string stringified_value() const
par_type parameter_type() const
std::string indent(std::size_t const i)
bool showParentsForFirstParam_
std::string const & name() const
std::stack< MaybeDisplayParent > mps_
std::string const & key() const
void enter_sequence(SequenceBase const &) override
void delegated_parameter(DelegateBase const &) override
bool suppressTopLevelFormatting_
void cacheTopLevelParameter(ParameterBase const &p)
std::string const & comment() const
std::ostream & operator<<(std::ostream &os, TableBase const &t)