Turi Create
4.0
|
#include <core/storage/fileio/cache_stream_sink.hpp>
Public Member Functions | |
cache_stream_sink (cache_id_type cache_id) | |
~cache_stream_sink () | |
Destructor. CLoses the stream. | |
std::streamsize | write (const char *c, std::streamsize bufsize) |
bool | is_open () const |
void | close () |
std::streampos | seek (std::streamoff off, std::ios_base::seekdir way) |
bool | good () const |
bool | bad () const |
bool | fail () const |
A boost::iostreams::sink concept implemented using cache_block as the underlying sink device.
Definition at line 24 of file cache_stream_sink.hpp.
|
explicit |
Construct the sink from a cache_id.
Intialize the underlying data sink, either the in memory array or the on disk cache file.
bool turi::fileio_impl::cache_stream_sink::bad | ( | ) | const |
Returns true if the stream is bad. See std::ios_base
void turi::fileio_impl::cache_stream_sink::close | ( | ) |
Closes all file handles
bool turi::fileio_impl::cache_stream_sink::fail | ( | ) | const |
Returns true if a stream operation failed. See std::ios_base
bool turi::fileio_impl::cache_stream_sink::good | ( | ) | const |
Returns true if the stream is good. See std::ios_base
bool turi::fileio_impl::cache_stream_sink::is_open | ( | ) | const |
Returns true if the file is opened
std::streampos turi::fileio_impl::cache_stream_sink::seek | ( | std::streamoff | off, |
std::ios_base::seekdir | way | ||
) |
Seeks to a different location. Will fail on compressed files.
std::streamsize turi::fileio_impl::cache_stream_sink::write | ( | const char * | c, |
std::streamsize | bufsize | ||
) |
Attempts to write bufsize bytes into the stream from the buffer. Returns the actual number of bytes written. Returns -1 on failure.