mirror of
https://github.com/ClickHouse/ClickHouse.git
synced 2024-12-15 19:02:04 +00:00
97f2a2213e
* Move some code outside dbms/src folder * Fix paths
36 lines
558 B
C++
36 lines
558 B
C++
#include <Core/Types.h>
|
|
#include <Common/hex.h>
|
|
#include <Common/Exception.h>
|
|
#include <IO/HexWriteBuffer.h>
|
|
|
|
|
|
namespace DB
|
|
{
|
|
|
|
void HexWriteBuffer::nextImpl()
|
|
{
|
|
if (!offset())
|
|
return;
|
|
|
|
for (Position p = working_buffer.begin(); p != pos; ++p)
|
|
{
|
|
UInt8 byte = *p;
|
|
out.write(hexDigitUppercase(byte / 16));
|
|
out.write(hexDigitUppercase(byte % 16));
|
|
}
|
|
}
|
|
|
|
HexWriteBuffer::~HexWriteBuffer()
|
|
{
|
|
try
|
|
{
|
|
nextImpl();
|
|
}
|
|
catch (...)
|
|
{
|
|
tryLogCurrentException(__PRETTY_FUNCTION__);
|
|
}
|
|
}
|
|
|
|
}
|