14 std::string
const UNKNOWN_SRC{
"-:1"};
15 std::regex
const reSequenceElement{R
"(.*\[(\d+)\])"}; 18 allowed_info(std::string
const& src_info)
20 return !src_info.empty() && src_info != UNKNOWN_SRC;
23 constexpr
auto size_t_max = std::numeric_limits<std::size_t>::max();
30 std::string
const& cached_info)
32 if (!allowed_info(curr_info))
34 std::string
const tag =
" # ";
35 std::string
const printed_info =
36 curr_info == cached_info ?
"\"\"" : curr_info;
37 return tag + printed_info;
43 std::string
const printed_info = allowed_info(info) ? info :
"";
44 return "#SRC|" + printed_info +
"|";
59 if (std::regex_match(key, m, reSequenceElement) &&
60 std::stoul(m[1]) != sz - 1) {
74 result = key +
": " + result;
86 result = key +
": " + result;
103 std::string
const str = std::any_cast<
ps_atom_t>(a);
104 return str == std::string(9,
'\0') ?
"@nil" : str;
115 "An error occurred while converting a name to a sequence " 117 <<
"The name '" << name <<
"' does not correspond to a sequence element.";
119 auto const b = name.find_last_of(
"[");
120 assert(b != std::string::npos);
121 auto const e = name.find_last_of(
"]");
122 assert(
e == name.length() - 1);
123 auto const start = b + 1;
125 return std::stoull(name.substr(start,
e - start));
std::string printed_suffix(std::string const &key, std::size_t const sz)
std::string print_annotated_info(std::string const &curr_info, std::string const &cached_info)
bool is_sequence_element(std::string const &key)
std::string opening_brace()
std::string printed_prefix(std::string const &key)
std::string print_prefix_annotated_info(std::string const &curr_info)
std::string printed_prefix(std::string const &key)
std::size_t index_for_sequence_element(std::string const &name)
std::string value(std::any const &)
std::string printed_prefix(std::string const &key)
cet::coded_exception< error, detail::translate > exception