4 #include "boost/algorithm/string/classification.hpp" 5 #include "boost/algorithm/string/split.hpp" 18 InputTag::~InputTag() =
default;
19 InputTag::InputTag() =
default;
21 InputTag::InputTag(
string const&
label,
23 string const& processName)
29 char const* processName)
35 vector<string> tokens;
36 boost::split(tokens, s, boost::is_any_of(
":"), boost::token_compress_off);
37 auto const nwords = tokens.size();
40 "An error occurred while creating an input tag.\n")
41 <<
"The string '" << s
42 <<
"' has more than three colon-delimited tokens.\n" 43 "The supported syntax is '<module_label>:<optional instance " 44 "name>:<optional process name>'.";
99 static string const separator{
":"};
113 return !(left ==
right);
122 if (tmp.size() == 2) {
123 tag = {tmp[0], tmp[1]};
124 }
else if (tmp.size() == 3) {
125 tag = {tmp[0], tmp[1], tmp[2]};
127 ostringstream errmsg;
128 errmsg <<
"When converting to InputTag by a sequence, FHiCL entries " 129 "must follow the convention:\n\n" 130 <<
" [ label, instance ], or\n" 131 <<
" [ label, instance, process_name ].\n\n";
132 errmsg <<
"FHiCL entries provided: [ ";
133 for (
auto ca = tmp.begin(); ca != tmp.cend(); ++ca) {
135 if (ca != tmp.cend() - 1) {
140 throw length_error(errmsg.str());
152 static string const process(
"', process = '");
153 os <<
"InputTag: label = '" << tag.
label() <<
"', instance = '"
constexpr auto const & right(const_AssnsIter< L, R, D, Dir > const &a, const_AssnsIter< L, R, D, Dir > const &b)
const std::string instance
bool operator!=(debugging_allocator< X > const &, debugging_allocator< Y > const &)
void decode(std::any const &, std::string &)
std::ostream & operator<<(std::ostream &os, const GroupSelector &gs)
cet::coded_exception< errors::ErrorCodes, ExceptionDetail::translate > Exception
constexpr auto const & left(const_AssnsIter< L, R, D, Dir > const &a, const_AssnsIter< L, R, D, Dir > const &b)
void split(std::string const &s, char c, OutIter dest)
bool is_sequence(std::any const &val)
void decode(std::any const &a, InputTag &tag)