MCPcopy Create free account
hub / github.com/ByConity/ByConity / readStringUntilNextLine

Function readStringUntilNextLine

programs/git-import/git-import.cpp:466–484  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

464}
465
466void readStringUntilNextLine(std::string & s, ReadBuffer & buf)
467{
468 s.clear();
469 while (!buf.eof())
470 {
471 char * next_pos = find_first_symbols<'\n'>(buf.position(), buf.buffer().end());
472 s.append(buf.position(), next_pos - buf.position());
473 buf.position() = next_pos;
474
475 if (!buf.hasPendingData())
476 continue;
477
478 if (*buf.position() == '\n')
479 {
480 ++buf.position();
481 return;
482 }
483 }
484}
485
486
487/** Writes the resulting tables to files that can be imported to ClickHouse.

Callers 1

processDiffsFunction · 0.85

Calls 7

bufferMethod · 0.80
hasPendingDataMethod · 0.80
clearMethod · 0.45
eofMethod · 0.45
positionMethod · 0.45
endMethod · 0.45
appendMethod · 0.45

Tested by

no test coverage detected