mirror of
https://github.com/ClickHouse/ClickHouse.git
synced 2024-12-18 20:32:43 +00:00
97f2a2213e
* Move some code outside dbms/src folder * Fix paths
29 lines
611 B
C++
29 lines
611 B
C++
#pragma once
|
|
|
|
#include <IO/WriteBuffer.h>
|
|
|
|
|
|
/// Since HexWriteBuffer is often created in the inner loop, we'll make its buffer size small.
|
|
#define DBMS_HEX_WRITE_BUFFER_SIZE 32
|
|
|
|
|
|
namespace DB
|
|
{
|
|
|
|
/** Everything that is written into it, translates to HEX (in capital letters) and writes to another WriteBuffer.
|
|
*/
|
|
class HexWriteBuffer final : public WriteBuffer
|
|
{
|
|
protected:
|
|
char buf[DBMS_HEX_WRITE_BUFFER_SIZE]; //-V730
|
|
WriteBuffer & out;
|
|
|
|
void nextImpl() override;
|
|
|
|
public:
|
|
HexWriteBuffer(WriteBuffer & out_) : WriteBuffer(buf, sizeof(buf)), out(out_) {}
|
|
~HexWriteBuffer() override;
|
|
};
|
|
|
|
}
|