MaybeDisplayParent.cc
Go to the documentation of this file.
3 
4 #include <regex>
5 
6 namespace {
7  std::regex const re_dot{"\\."};
8  std::regex const re_index{"\\[(\\d+)\\]"};
9 }
10 
11 namespace fhicl::detail {
12 
13  std::vector<std::string>
15  {
16  std::vector<std::string> parents;
17  for (auto const& key : cet::split_by_regex(k, re_dot))
18  for (auto const& token :
19  cet::split_by_regex(std::regex_replace(key, re_index, ",$1"), ","))
20  parents.push_back(token);
21 
22  // Skip first key, which is something like "<some_label>" in the context
23  // whenever this function is called.
24  return std::vector<std::string>(parents.begin() + 1, parents.end());
25  }
26 }
std::string string
Definition: nybbler.cc:12
std::vector< std::string > split_by_regex(std::string const &str, std::regex const &reDelimSet)
def key(type, name=None)
Definition: graph.py:13
std::vector< std::string > get_parents(std::string const &k)