MCPcopy Create free account
hub / github.com/apache/trafficserver / parse_pair

Method parse_pair

plugins/experimental/txn_box/plugin/src/query.cc:599–623  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

597}
598
599swoc::Errata
600Mod_query_filter::Case::parse_pair(Config &cfg, YAML::Node node, PairExpr &pair)
601{
602 if (!node.IsMap()) {
603 return Errata(S_ERROR, "Element at {} is not an object as required.", node.Mark());
604 }
605
606 if (auto knode = node[PAIR_NAME]; knode) {
607 auto &&[expr, errata]{cfg.parse_expr(knode)};
608 if (!errata.is_ok()) {
609 errata.note("While parsing expression for {}.", PAIR_NAME);
610 }
611 pair._name = std::move(expr);
612 }
613
614 if (auto vnode = node[PAIR_VALUE]; vnode) {
615 auto &&[expr, errata]{cfg.parse_expr(vnode)};
616 if (!errata.is_ok()) {
617 errata.note("While parsing expression for {}.", PAIR_VALUE);
618 }
619 pair._value = std::move(expr);
620 }
621
622 return {};
623}
624
625Errata
626Mod_query_filter::Case::pre_load(Config &cfg, YAML::Node cmp_node)

Callers 1

pre_loadMethod · 0.95

Calls 5

ErrataClass · 0.85
parse_exprMethod · 0.80
MarkMethod · 0.45
is_okMethod · 0.45
noteMethod · 0.45

Tested by

no test coverage detected