1 #ifndef fhiclcpp_types_detail_MaybeDisplayParent_h 2 #define fhiclcpp_types_detail_MaybeDisplayParent_h 4 #include "cetlib/exempt_ptr.h" 17 using base_ptr = cet::exempt_ptr<ParameterBase>;
22 bool const showParents,
26 std::vector<std::string>{}}
29 std::ostringstream os;
33 for (
auto it =
names_.begin(),
e =
names_.end() - 1; it !=
e; ++it) {
34 std::string
const& name = *it;
35 std::string
const& next_name = *std::next(it);
42 if (!std::isdigit(name[0])) {
43 if (std::isdigit(next_name[0])) {
44 os << indent << name <<
": [ # index: " << next_name <<
'\n';
47 os << indent << name <<
": {\n";
51 if (!std::isdigit(next_name[0])) {
52 os << indent <<
"{\n";
55 os << indent <<
"[ # index: " << next_name <<
'\n';
96 std::vector<std::string>
get_parents(std::string
const& k);
101 auto pos = p.
key().find_last_of(
"]");
102 return pos != std::string::npos && pos == p.
key().size() - 1;
cet::exempt_ptr< ParameterBase > base_ptr
bool is_sequence_element(ParameterBase const &p)
std::vector< std::string > closingBraces_
std::string closing_braces() const
std::string indent(std::size_t const i)
std::vector< std::string > names_
std::string const & parent_names() const
MaybeDisplayParent(ParameterBase const &p, bool const showParents, Indentation &ind)
std::vector< std::string > get_parents(std::string const &k)