| 436 | } |
| 437 | |
| 438 | bool WriteTag(ostream_wrapper& out, const std::string& str, bool verbatim) { |
| 439 | out << (verbatim ? "!<" : "!"); |
| 440 | StringCharSource buffer(str.c_str(), str.size()); |
| 441 | const RegEx& reValid = verbatim ? Exp::URI() : Exp::Tag(); |
| 442 | while (buffer) { |
| 443 | int n = reValid.Match(buffer); |
| 444 | if (n <= 0) { |
| 445 | return false; |
| 446 | } |
| 447 | |
| 448 | while (--n >= 0) { |
| 449 | out << buffer[0]; |
| 450 | ++buffer; |
| 451 | } |
| 452 | } |
| 453 | if (verbatim) { |
| 454 | out << ">"; |
| 455 | } |
| 456 | return true; |
| 457 | } |
| 458 | |
| 459 | bool WriteTagWithPrefix(ostream_wrapper& out, const std::string& prefix, |
| 460 | const std::string& tag) { |
no test coverage detected