7 #include <boost/iostreams/stream.hpp> 8 #include <core/storage/fileio/read_caching_device.hpp> 9 #include <core/storage/fileio/s3_filesys.hpp> 13 #ifndef TC_DISABLE_REMOTEFS 24 typedef char char_type;
25 struct category :
public boost::iostreams::device_tag,
26 public boost::iostreams::multichar_tag,
27 public boost::iostreams::closable_tag,
28 public boost::iostreams::bidirectional_seekable {};
32 std::string remote_fname;
33 std::shared_ptr<fileio::s3::S3FileSystem> m_s3fs;
34 std::shared_ptr<fileio::s3::Stream> m_write_stream;
35 std::shared_ptr<fileio::s3::SeekStream> m_read_stream;
36 size_t m_filesize = (size_t)(-1);
43 s3_device(
const std::string& filename,
const bool write =
false);
48 void close(std::ios_base::openmode mode = std::ios_base::openmode());
53 std::streamsize read(
char* strm_ptr, std::streamsize n);
55 std::streamsize write(
const char* strm_ptr, std::streamsize n);
62 std::streampos
seek(std::streamoff off, std::ios_base::seekdir way,
63 std::ios_base::openmode);
72 std::shared_ptr<std::istream> get_underlying_stream();
73 std::string m_filename;
76 typedef boost::iostreams::stream<read_caching_device<s3_device>> s3_fstream;
79 #endif // End ifndef TC_DISABLE_REMOTEFS std::streamsize optimal_buffer_size() const
std::streampos seek(std::streamoff off, std::ios_base::seekdir way, std::ios_base::openmode)