| 621 | */ |
| 622 | template <char quote = '"'> |
| 623 | void writeCSVString(const char * begin, const char * end, WriteBuffer & buf) |
| 624 | { |
| 625 | writeChar(quote, buf); |
| 626 | |
| 627 | const char * pos = begin; |
| 628 | while (true) |
| 629 | { |
| 630 | const char * next_pos = find_first_symbols<quote>(pos, end); |
| 631 | |
| 632 | if (next_pos == end) |
| 633 | { |
| 634 | buf.write(pos, end - pos); |
| 635 | break; |
| 636 | } |
| 637 | |
| 638 | /// Quotation. |
| 639 | ++next_pos; |
| 640 | buf.write(pos, next_pos - pos); |
| 641 | writeChar(quote, buf); |
| 642 | |
| 643 | pos = next_pos; |
| 644 | } |
| 645 | |
| 646 | writeChar(quote, buf); |
| 647 | } |
| 648 | |
| 649 | template <char quote = '"'> |
| 650 | void writeCSVString(const String & s, WriteBuffer & buf) |
no test coverage detected