2011-11-28 19:27:51 +00:00
|
|
|
#pragma once
|
|
|
|
|
2017-04-01 09:19:00 +00:00
|
|
|
#include <IO/WriteBuffer.h>
|
2011-11-28 19:27:51 +00:00
|
|
|
|
|
|
|
|
2017-05-28 14:29:40 +00:00
|
|
|
/// Since HexWriteBuffer is often created in the inner loop, we'll make its buffer size small.
|
2011-11-29 17:23:30 +00:00
|
|
|
#define DBMS_HEX_WRITE_BUFFER_SIZE 32
|
|
|
|
|
|
|
|
|
2011-11-28 19:27:51 +00:00
|
|
|
namespace DB
|
|
|
|
{
|
|
|
|
|
2017-05-28 14:29:40 +00:00
|
|
|
/** Everything that is written into it, translates to HEX (in capital letters) and writes to another WriteBuffer.
|
2011-11-28 19:27:51 +00:00
|
|
|
*/
|
2017-06-01 13:41:58 +00:00
|
|
|
class HexWriteBuffer final : public WriteBuffer
|
2011-11-28 19:27:51 +00:00
|
|
|
{
|
|
|
|
protected:
|
2019-04-22 16:07:09 +00:00
|
|
|
char buf[DBMS_HEX_WRITE_BUFFER_SIZE]; //-V730
|
2017-04-01 07:20:54 +00:00
|
|
|
WriteBuffer & out;
|
2016-08-19 01:54:23 +00:00
|
|
|
|
2017-06-01 13:41:58 +00:00
|
|
|
void nextImpl() override;
|
2011-11-28 19:27:51 +00:00
|
|
|
|
|
|
|
public:
|
2017-04-01 07:20:54 +00:00
|
|
|
HexWriteBuffer(WriteBuffer & out_) : WriteBuffer(buf, sizeof(buf)), out(out_) {}
|
2017-06-01 13:41:58 +00:00
|
|
|
~HexWriteBuffer() override;
|
2011-11-28 19:27:51 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
}
|