Main Page
Related Pages
Modules
Namespaces
Classes
Files
Examples
File List
File Members
fhiclcpp
fhiclcpp
types
detail
MaybeDisplayParent.cc
Go to the documentation of this file.
1
#include "
fhiclcpp/types/detail/MaybeDisplayParent.h
"
2
#include "
cetlib/split_by_regex.h
"
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>
14
MaybeDisplayParent::get_parents
(
std::string
const
&
k
)
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
}
string
std::string string
Definition:
nybbler.cc:12
cet::split_by_regex
std::vector< std::string > split_by_regex(std::string const &str, std::regex const &reDelimSet)
Definition:
split_by_regex.cc:8
wirecell.dfp.graph.key
def key(type, name=None)
Definition:
graph.py:13
split_by_regex.h
muoncounters.k
k
Definition:
muoncounters.py:27
fhicl::detail
Definition:
coding.h:43
fhicl::detail::MaybeDisplayParent::get_parents
std::vector< std::string > get_parents(std::string const &k)
Definition:
MaybeDisplayParent.cc:14
MaybeDisplayParent.h
Generated by
1.8.11