3 #include "boost/json.hpp" 5 #include "cetlib/canonical_string.h" 6 #include "cetlib/container_algorithms.h" 19 detail::OldToNew
const oldToNew{};
21 maybeTranslate(vector<string> names)
23 cet::transform_all(names, names.begin(), oldToNew);
29 search_translated_all(vector<string>
const& s,
string const& md)
31 return cet::search_all(s, oldToNew(md));
35 FileCatalogMetadata::FileCatalogMetadata(
37 : checkSyntax_{config().checkSyntax()}
38 ,
mdToInherit_{maybeTranslate(config().metadataFromInput())}
40 if (
auto appFam = config().applicationFamily()) {
43 if (
auto appVer = config().applicationVersion()) {
54 config().runType(rt)) {
57 if (
auto grp = config().group()) {
60 if (
auto pid = config().processID()) {
81 string checkString(
"{ ");
82 checkString += cet::canonical_string(key) +
" : " + value +
" }";
83 boost::json::error_code ec;
85 auto const n_parsed_chars = p.write_some(checkString, ec);
88 <<
"FileCatalogMetadata::addMetadata() JSON " << ec.message() <<
":\n" 89 <<
"Faulty key/value clause:\n" 90 << checkString <<
'\n' 91 << (n_parsed_chars ? string(n_parsed_chars,
'-') :
"") <<
"^\n";
94 std::lock_guard sentry{
mutex_};
95 md_.emplace_back(key, value);
105 std::lock_guard sentry{
mutex_};
109 imd_->check_values(mdFromInput);
111 for (
auto const& [key,
value] :
imd_->entries()) {
119 std::lock_guard sentry{
mutex_};
120 cet::copy_all(
md_, back_inserter(coll));
CommandLineParser * parser(0)
cet::coded_exception< errors::ErrorCodes, ExceptionDetail::translate > Exception