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

Function WriteTagWithPrefix

lib/yamlcpp/src/emitterutils.cpp:459–489  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

457}
458
459bool WriteTagWithPrefix(ostream_wrapper& out, const std::string& prefix,
460 const std::string& tag) {
461 out << "!";
462 StringCharSource prefixBuffer(prefix.c_str(), prefix.size());
463 while (prefixBuffer) {
464 int n = Exp::URI().Match(prefixBuffer);
465 if (n <= 0) {
466 return false;
467 }
468
469 while (--n >= 0) {
470 out << prefixBuffer[0];
471 ++prefixBuffer;
472 }
473 }
474
475 out << "!";
476 StringCharSource tagBuffer(tag.c_str(), tag.size());
477 while (tagBuffer) {
478 int n = Exp::Tag().Match(tagBuffer);
479 if (n <= 0) {
480 return false;
481 }
482
483 while (--n >= 0) {
484 out << tagBuffer[0];
485 ++tagBuffer;
486 }
487 }
488 return true;
489}
490
491bool WriteBinary(ostream_wrapper& out, const Binary& binary) {
492 WriteDoubleQuotedString(out, EncodeBase64(binary.data(), binary.size()),

Callers 1

emitter.cppFile · 0.85

Calls 4

TagClass · 0.70
c_strMethod · 0.45
sizeMethod · 0.45
MatchMethod · 0.45

Tested by

no test coverage detected