ClickHouse/dbms/include/DB/IO/copyData.h

27 lines
738 B
C++
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

#pragma once
#include <atomic>
#include <DB/IO/ReadBuffer.h>
#include <DB/IO/WriteBuffer.h>
namespace DB
{
/** Копирует данные из ReadBuffer в WriteBuffer, все что есть.
*/
void copyData(ReadBuffer & from, WriteBuffer & to);
/** Копирует bytes байт из ReadBuffer в WriteBuffer. Если нет bytes байт, то кидает исключение.
*/
void copyData(ReadBuffer & from, WriteBuffer & to, size_t bytes);
/** То же самое, с условием на остановку.
*/
void copyData(ReadBuffer & from, WriteBuffer & to, std::atomic<bool> & is_cancelled);
void copyData(ReadBuffer & from, WriteBuffer & to, size_t bytes, std::atomic<bool> & is_cancelled);
}