1#include <string>
2
3#include <iostream>
4#include <fstream>
5
6#include <Core/Types.h>
7#include <IO/WriteHelpers.h>
8#include <IO/WriteBufferFromOStream.h>
9
10
11int main(int, char **)
12{
13 try
14 {
15 DB::Int64 a = -123456;
16 DB::Float64 b = 123.456;
17 DB::String c = "вася пе\tтя";
18 DB::String d = "'xyz\\";
19
20 std::ofstream s("test");
21 DB::WriteBufferFromOStream out(s);
22
23 for (int i = 0; i < 1000000; ++i)
24 {
25 DB::writeIntText(a, out);
26 DB::writeChar(' ', out);
27
28 DB::writeFloatText(b, out);
29 DB::writeChar(' ', out);
30
31 DB::writeEscapedString(c, out);
32 DB::writeChar('\t', out);
33
34 DB::writeQuotedString(d, out);
35 DB::writeChar('\n', out);
36 }
37 }
38 catch (const DB::Exception & e)
39 {
40 std::cerr << e.what() << ", " << e.displayText() << std::endl;
41 return 1;
42 }
43
44 return 0;
45}
46