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

Function parse_arg

plugins/experimental/txn_box/plugin/src/Config.cc:129–142  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

127};
128
129swoc::Rv<swoc::TextView>
130parse_arg(TextView &key)
131{
132 TextView arg{key};
133 TextView name{arg.take_prefix_at(ARG_PREFIX)};
134 if (name.size() == key.size()) { // no arg prefix, it's just the name.
135 return {};
136 }
137 if (arg.empty() || arg.back() != ARG_SUFFIX) {
138 return Errata(S_ERROR, R"(Argument for "{}" is not properly terminated with '{}'.)", name, ARG_SUFFIX);
139 }
140 key = name;
141 return arg.remove_suffix(1);
142}
143
144/* ------------------------------------------------------------------------------------ */
145Config::Config() : _arena(_cfg_storage_required + 2048)

Callers 4

loadMethod · 0.85
validateMethod · 0.85
load_directiveMethod · 0.85
loadMethod · 0.85

Calls 5

ErrataClass · 0.85
take_prefix_atMethod · 0.80
sizeMethod · 0.45
emptyMethod · 0.45
remove_suffixMethod · 0.45

Tested by

no test coverage detected