MCPcopy Create free account
hub / github.com/catboost/catboost / DoWrite

Method DoWrite

tools/archiver/main.cpp:74–109  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

72 }
73
74 void DoWrite(const void* data, size_t len) override {
75 const char* b = (const char*)data;
76
77 while (len) {
78 const unsigned char c = *b;
79 char buf[12];
80 char* tmp = buf;
81
82 if (Count_ % Columns == 0) {
83 *tmp++ = ' ';
84 *tmp++ = ' ';
85 *tmp++ = ' ';
86 *tmp++ = ' ';
87 }
88
89 if (Count_ && Count_ % Columns != 0) {
90 *tmp++ = ',';
91 *tmp++ = ' ';
92 }
93
94 *tmp++ = '0';
95 *tmp++ = 'x';
96 tmp = HexEncode(&c, 1, tmp);
97
98 if ((Count_ % Columns) == (Columns - 1)) {
99 *tmp++ = ',';
100 *tmp++ = '\n';
101 }
102
103 Slave_->Write(buf, tmp - buf);
104
105 --len;
106 ++b;
107 ++Count_;
108 }
109 }
110
111 private:
112 // width in source chars

Callers

nothing calls this directly

Calls 2

HexEncodeFunction · 0.50
WriteMethod · 0.45

Tested by

no test coverage detected