1 #ifndef fhiclcpp_types_detail_MaybeDisplayParent_h 2 #define fhiclcpp_types_detail_MaybeDisplayParent_h 4 #include "cetlib/exempt_ptr.h" 16 using base_ptr = cet::exempt_ptr<ParameterBase>;
21 bool const showParents,
27 std::ostringstream os;
31 for (
auto it =
names_.begin(),
e =
names_.end() - 1; it !=
e; ++it) {
32 std::string
const& name = *it;
33 std::string
const& next_name = *std::next(it);
40 if (!std::isdigit(name[0])) {
41 if (std::isdigit(next_name[0])) {
42 os << indent << name <<
": [ # index: " << next_name <<
'\n';
45 os << indent << name <<
": {\n";
49 if (!std::isdigit(next_name[0])) {
50 os << indent <<
"{\n";
53 os << indent <<
"[ # index: " << next_name <<
'\n';
94 std::vector<std::string>
get_parents(std::string
const& k);
99 auto pos = p.
key().find_last_of(
"]");
100 return pos != std::string::npos && pos == p.
key().size() - 1;
cet::exempt_ptr< ParameterBase > base_ptr
bool is_sequence_element(ParameterBase const &p)
decltype(auto) constexpr size(T &&obj)
ADL-aware version of std::size.
std::vector< std::string > closingBraces_
std::string closing_braces() const
std::string indent(std::size_t const i)
std::string const & key() const
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)