Sese Framework
2.3.0
A cross-platform framework
|
Output stream wrapping class, UTF-8 under Windows requires special handling. More...
#include <BaseStreamReader.h>
Public Types | |
using | Ptr = std::shared_ptr<BaseStreamReader<T>> |
Public Member Functions | |
BaseStreamReader (const Stream::Ptr &source) | |
Constructor. | |
bool | read (T &ch) |
Read a character. | |
std::basic_string< T > | readLine () |
Read a line. | |
const ByteBuilder::Ptr & | getBuffer () noexcept |
Private Member Functions | |
int64_t | preRead () |
Cache ahead-of-time data. | |
Private Attributes | |
Stream::Ptr | sourceStream |
ByteBuilder::Ptr | bufferStream |
Output stream wrapping class, UTF-8 under Windows requires special handling.
using sese::io::BaseStreamReader< T >::Ptr = std::shared_ptr<BaseStreamReader<T>> |
|
inlineexplicit |
Constructor.
source | Stream to be wrapped |
References sese::io::BaseStreamReader< T >::bufferStream, and sese::io::BaseStreamReader< T >::sourceStream.
|
inlinenoexcept |
Used to cache ahead-of-time data
References sese::io::BaseStreamReader< T >::bufferStream.
|
inlineprivate |
Cache ahead-of-time data.
This method is used to cache the data of the source stream in advance. It is used to improve the performance of the readLine method.
References sese::io::BaseStreamReader< T >::bufferStream, sese::io::BaseStreamReader< T >::sourceStream, STREAM_BYTE_STREAM_SIZE_FACTOR, and STRING_BUFFER_SIZE_FACTOR.
Referenced by sese::io::BaseStreamReader< T >::read(), and sese::io::BaseStreamReader< T >::readLine().
|
inline |
Read a character.
ch | Character container |
Cache missed, trying to read from the source
The source has been read
References sese::io::BaseStreamReader< T >::bufferStream, and sese::io::BaseStreamReader< T >::preRead().
Referenced by sese::io::BaseStreamReader< T >::readLine().
|
inline |
Read a line.
References sese::io::BaseStreamReader< T >::bufferStream, sese::io::BaseStreamReader< T >::preRead(), and sese::io::BaseStreamReader< T >::read().
|
private |
|
private |