Sese Framework
x.y.z
A cross-platform framework
|
流缓存类 更多...
#include <BufferedStream.h>
Public 类型 | |
using | Ptr = std::shared_ptr<BufferedStream> |
Public 类型 继承自 sese::io::Stream | |
typedef std::shared_ptr< Stream > | Ptr |
Public 类型 继承自 sese::io::InputStream | |
typedef std::shared_ptr< InputStream > | Ptr |
Public 类型 继承自 sese::io::OutputStream | |
typedef std::shared_ptr< OutputStream > | Ptr |
Public 成员函数 | |
BufferedStream (const Stream::Ptr &source, size_t buffer_size=STREAM_BYTE_STREAM_SIZE_FACTOR) | |
~BufferedStream () noexcept override | |
int64_t | read (void *buffer, size_t length) override |
void | clear () noexcept |
清空当前读取标志位 | |
int64_t | write (const void *buffer, size_t length) override |
int64_t | flush () noexcept |
将当前缓存曲内容全部刷新至流中,并且重置当前写入标志位 | |
void | reset (const Stream::Ptr &source) noexcept |
size_t | getPosition () const |
size_t | getLength () const |
size_t | getCapacity () const |
Public 成员函数 继承自 sese::Noncopyable | |
Noncopyable ()=default | |
virtual | ~Noncopyable ()=default |
Noncopyable (const Noncopyable &)=delete | |
删除拷贝相关构造函数 | |
Noncopyable & | operator= (const Noncopyable &)=delete |
删除拷贝相关构造函数 | |
Public 成员函数 继承自 sese::io::InputStream | |
virtual | ~InputStream () noexcept=default |
Public 成员函数 继承自 sese::io::OutputStream | |
virtual | ~OutputStream () noexcept=default |
int64_t | write (const std::string_view &buffer) |
int64_t | write (const text::StringView &buffer) |
template<typename T > | |
int64_t | write (std::vector< T > &buffer) |
template<typename T , size_t N> | |
int64_t | write (std::array< T, N > &buffer) |
Private 成员函数 | |
int64_t | preRead () |
Private 属性 | |
Stream::Ptr | source |
源流指针 | |
void * | buffer = nullptr |
缓存指针 | |
size_t | pos |
已操作的数据大小 | |
size_t | len |
可供操作的数据大小 | |
size_t | cap |
缓存容量 | |
流缓存类
using sese::io::BufferedStream::Ptr = std::shared_ptr<BufferedStream> |
|
explicit |
|
noexcept |
|
noexcept |
|
inlinenodiscard |
引用了 cap.
|
inlinenodiscard |
引用了 len.
|
inlinenodiscard |
引用了 pos.
|
inlineprivate |
|
overridevirtual |
|
noexcept |
重置输出源,这会导致原有数据被清除
source |
|
overridevirtual |
|
private |
缓存指针
被这些函数引用 BufferedStream(), flush(), preRead(), read(), write() , 以及 ~BufferedStream().
|
private |
缓存容量
被这些函数引用 BufferedStream(), getCapacity(), preRead(), read() , 以及 write().
|
private |
可供操作的数据大小
被这些函数引用 BufferedStream(), clear(), flush(), getLength(), preRead(), read() , 以及 write().
|
private |
已操作的数据大小
被这些函数引用 BufferedStream(), clear(), flush(), getPosition(), preRead(), read() , 以及 write().
|
private |
源流指针
被这些函数引用 BufferedStream(), flush(), preRead(), read() , 以及 write().