2011-10-15 23:40:56 +00:00
|
|
|
#pragma once
|
2010-06-01 13:35:09 +00:00
|
|
|
|
2023-08-09 00:19:02 +00:00
|
|
|
#include <iosfwd>
|
2010-06-01 13:35:09 +00:00
|
|
|
|
2017-04-01 09:19:00 +00:00
|
|
|
#include <IO/WriteBuffer.h>
|
|
|
|
#include <IO/BufferWithOwnMemory.h>
|
2010-06-01 13:35:09 +00:00
|
|
|
|
|
|
|
|
|
|
|
namespace DB
|
|
|
|
{
|
|
|
|
|
2011-06-27 18:22:14 +00:00
|
|
|
class WriteBufferFromOStream : public BufferWithOwnMemory<WriteBuffer>
|
2010-06-01 13:35:09 +00:00
|
|
|
{
|
2011-06-26 21:30:59 +00:00
|
|
|
public:
|
2022-03-13 11:59:20 +00:00
|
|
|
explicit WriteBufferFromOStream(
|
2018-06-14 21:20:39 +00:00
|
|
|
std::ostream & ostr_,
|
|
|
|
size_t size = DBMS_DEFAULT_BUFFER_SIZE,
|
|
|
|
char * existing_memory = nullptr,
|
2018-07-09 20:36:58 +00:00
|
|
|
size_t alignment = 0);
|
|
|
|
|
2021-11-10 22:58:56 +00:00
|
|
|
protected:
|
2022-03-13 11:59:20 +00:00
|
|
|
explicit WriteBufferFromOStream(size_t size = DBMS_DEFAULT_BUFFER_SIZE, char * existing_memory = nullptr, size_t alignment = 0);
|
2021-11-10 22:58:56 +00:00
|
|
|
|
|
|
|
void nextImpl() override;
|
|
|
|
|
|
|
|
std::ostream * ostr{};
|
2010-06-01 13:35:09 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
}
|