3 #include "boost/algorithm/string/classification.hpp" 4 #include "boost/algorithm/string/split.hpp" 5 #include "boost/any.hpp" 18 std::vector<std::string> tokens;
20 boost::split(tokens, s, boost::is_any_of(
":"), boost::token_compress_off);
22 int nwords = tokens.size();
25 <<
"Input tag " << s <<
" has " << nwords <<
" tokens";
42 static std::string
const separator(
":");
43 std::string result =
label_;
56 static std::string
const process(
", process = ");
57 ost <<
"InputTag: label = " << tag.
label()
59 << (tag.
process().empty() ? std::string() : (process + tag.
process()));
68 std::vector<std::string>
tmp;
71 tag = {tmp.at(0), tmp.at(1)};
72 else if (tmp.size() == 3)
73 tag = {tmp.at(0), tmp.at(1), tmp.at(2)};
75 std::ostringstream errmsg;
76 errmsg <<
"When converting to InputTag by a sequence, FHiCL entries " 77 "must follow the convention:\n\n" 78 <<
" [ label, instance ], or\n" 79 <<
" [ label, instance, process_name ].\n\n";
80 errmsg <<
"FHiCL entries provided: [ ";
81 for (
auto ca = tmp.begin(); ca != tmp.cend(); ++ca) {
83 if (ca != tmp.cend() - 1) {
88 throw std::length_error(errmsg.str());
std::ostream & operator<<(std::ostream &os, EDAnalyzer::Table< T > const &t)
void decode(boost::any const &, std::string &)
bool is_sequence(boost::any const &val)
void decode(boost::any const &a, InputTag &tag)
cet::coded_exception< errors::ErrorCodes, ExceptionDetail::translate > Exception