MCPcopy Create free account
hub / github.com/ClickHouse/ClickHouse / writeCSVString

Function writeCSVString

src/IO/WriteHelpers.h:623–647  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

621 */
622template <char quote = '"'>
623void 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
649template <char quote = '"'>
650void writeCSVString(const String & s, WriteBuffer & buf)

Callers 6

writeLineMethod · 0.85
serializeTextCSVMethod · 0.85
serializeTextCSVMethod · 0.85
serializeTextCSVMethod · 0.85
serializeTextCSVMethod · 0.85

Calls 4

writeCharFunction · 0.85
writeMethod · 0.45
dataMethod · 0.45
sizeMethod · 0.45

Tested by

no test coverage detected