2 #include "cetlib/container_algorithms.h" 56 <<
"The supplied value of the parameter:\n" 57 <<
" " << s.
key() <<
'\n' 58 <<
"does not represent a sequence.\n";
62 std::size_t
const nElems =
64 return std::regex_match(k, r);
77 auto const& name = dp.
name();
79 std::regex const r{pattern};
82 return std::regex_search(k, r);
94 using key_set = std::set<std::string>;
97 removeIgnorableKeys(key_set
const& ignorable,
98 std::vector<std::string>& extra,
99 std::vector<cet::exempt_ptr<ParameterBase>>& missing)
101 for (
auto const& key : ignorable) {
107 auto it = cet::find_in_all(extra, subkey);
108 if (it != extra.cend()) {
109 auto match = [&subkey](std::string
const& key) {
110 return key.find(subkey) == 0ul;
112 auto const end = std::find_if_not(it, extra.end(), match);
113 extra.erase(it,
end);
119 std::remove_if(missing.begin(), missing.end(), [&subkey](
auto p) {
120 return p->key() == subkey;
123 missing.erase(mit, missing.end());
128 show_parents(std::string
const& k)
130 std::size_t
const freq =
131 std::count(k.begin(), k.end(),
'.') + std::count(k.begin(), k.end(),
'[');
137 std::vector<cet::exempt_ptr<ParameterBase>>
const& missingParams)
139 if (missingParams.empty())
142 std::string
const prefix{
" - " + std::string(3,
' ')};
144 std::ostringstream oss;
145 oss <<
"Missing parameters:\n";
146 for (
auto p : missingParams) {
160 std::vector<std::string>
const& extraKeys)
162 if (extraKeys.empty())
165 std::ostringstream oss;
166 oss <<
"Unsupported parameters:\n\n";
167 for (
auto const& key : extraKeys) {
168 oss <<
" + " << std::setw(30) <<
std::left << key <<
" [ " 184 if (!errmsg.empty()) {
void prepare_elements_for_validation(std::size_t const n)
void enter_sequence(SequenceBase &p) override
std::set< std::string > ignorableKeys_
std::vector< std::string > userKeys_
std::string optional_parameter_message(bool const with_comment=true)
bool is_key_to_sequence(std::string const &key) const
auto vector(Vector const &v)
Returns a manipulator which will print the specified array.
std::string strip_first_containing_name(std::string const &key)
void walk_over(tt::maybe_const_t< ParameterBase, C > &)
ParameterSet const & pset_
void delegated_parameter(DelegateBase &) override
bool has_key(std::string const &key) const
std::vector< cet::exempt_ptr< ParameterBase > > missingParameters_
void set_value(fhicl::ParameterSet const &ps, bool trimParents)
static std::string regex_safe(std::string const &key)
constexpr auto const & left(const_AssnsIter< L, R, D, Dir > const &a, const_AssnsIter< L, R, D, Dir > const &b)
std::string get_src_info(std::string const &key) const
std::vector< evd::details::RawDigitInfo_t >::const_iterator end(RawDigitCacheDataClass const &cache)
void after_action(ParameterBase &p) override
bool before_action(ParameterBase &p) override
cet::coded_exception< error, detail::translate > exception