| 457 | } |
| 458 | |
| 459 | bool 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 | |
| 491 | bool WriteBinary(ostream_wrapper& out, const Binary& binary) { |
| 492 | WriteDoubleQuotedString(out, EncodeBase64(binary.data(), binary.size()), |
no test coverage detected