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

Function readAndPrint

src/IO/examples/read_buffer.cpp:11–40  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

9#include <Examples/clickhouse_examples.h>
10
11static int readAndPrint(DB::ReadBuffer & in)
12{
13 try
14 {
15 Int64 a = {};
16 Float64 b = {};
17 String c;
18 String d;
19
20 DB::readIntText(a, in);
21 in.ignore();
22
23 DB::readFloatText(b, in);
24 in.ignore();
25
26 DB::readEscapedString(c, in);
27 in.ignore();
28
29 DB::readQuotedString(d, in);
30
31 std::cout << a << ' ' << b << ' ' << c << '\t' << '\'' << d << '\'' << std::endl;
32 std::cout << in.count() << std::endl;
33 return 0;
34 }
35 catch (const DB::Exception & e)
36 {
37 std::cerr << e.what() << ", " << e.displayText() << std::endl;
38 return 1;
39 }
40}
41
42int mainEntryExampleReadBuffer(int, char **)
43{

Callers 1

Calls 8

readEscapedStringFunction · 0.85
readQuotedStringFunction · 0.85
displayTextMethod · 0.80
readIntTextFunction · 0.70
readFloatTextFunction · 0.50
ignoreMethod · 0.45
countMethod · 0.45
whatMethod · 0.45

Tested by

no test coverage detected