6 #ifndef FILEIO_GENERAL_FSTREAM_SINK_HPP 7 #define FILEIO_GENERAL_FSTREAM_SINK_HPP 11 #include <boost/iostreams/stream.hpp> 12 #include <core/storage/fileio/union_fstream.hpp> 13 #include <core/storage/fileio/fileio_constants.hpp> 14 #include <boost/iostreams/filter/gzip.hpp> 16 namespace fileio_impl {
29 std::shared_ptr<union_fstream> out_file;
31 std::shared_ptr<boost::iostreams::gzip_compressor> compressor;
34 std::shared_ptr<std::ostream> underlying_stream;
37 bool is_gzip_compressed =
false;
40 std::string sanitized_filename;
43 typedef char char_type;
44 struct category:
public boost::iostreams::sink_tag,
45 boost::iostreams::closable_tag,
46 boost::iostreams::multichar_tag,
47 boost::iostreams::optimally_buffered_tag {};
82 inline std::streamsize optimal_buffer_size()
const {
95 std::streamsize
write(
const char* c, std::streamsize bufsize);
128 void open_file(std::string file,
bool gzip_compressed);
std::streamsize write(const char *c, std::streamsize bufsize)
~general_fstream_sink()
Destructor. Closes the file.
size_t get_bytes_written() const
general_fstream_sink(std::string file)
size_t FILEIO_WRITER_BUFFER_SIZE