Reference-counted stream buffer. More...
#include <astreambuf.h>
has_size
will determine whether the result of size
can be relied on. More... in_avail
returns the number of characters that are immediately available to be consumed without blocking. May be used in conjunction with <cref="::sbumpc method"/> to read data without incurring the overhead of using tasks. More... Reference-counted stream buffer.
streambuf.
streambuf.
Constructor.
Default constructor.
Converter Constructor.
streambuf
. Destructor
Gets a pointer to the next already allocated contiguous block of data.
true
if the operation succeeded, false
otherwise.A return of false does not necessarily indicate that a subsequent read operation would fail, only that there is no block to return immediately or that the stream buffer does not support the operation. The stream buffer may not de-allocate the block until ::release method is called. If the end of the stream is reached, the function will return true
, a null pointer, and a count of zero; a subsequent read will not succeed.
Implements Concurrency::streams::details::basic_streambuf< _CharType >.
Allocates a contiguous memory block and returns it.
std::ios_base::in
)
const
Gets the stream buffer size, if one has been set.
An implementation that does not support buffering will always return 0.
Implements Concurrency::streams::details::basic_streambuf< _CharType >.
Reads a single character from the stream and advances the read position.
Implements Concurrency::streams::details::basic_streambuf< _CharType >.
can_read
is used to determine whether a stream buffer will support read operations (get).
Implements Concurrency::streams::details::basic_streambuf< _CharType >.
can_seek
is used to determine whether a stream buffer supports seeking.
Implements Concurrency::streams::details::basic_streambuf< _CharType >.
can_write
is used to determine whether a stream buffer will support write operations (put).
Implements Concurrency::streams::details::basic_streambuf< _CharType >.
(std::ios_base::in | std::ios_base::out)
)
Closes the stream buffer, preventing further read or write operations.
Implements Concurrency::streams::details::basic_streambuf< _CharType >.
Closes the stream buffer with an exception.
Implements Concurrency::streams::details::basic_streambuf< _CharType >.
Submits a block already allocated by the stream buffer.
Constructs an input stream head for this stream buffer.
basic_istream
.Constructs an output stream for this stream buffer.
Retrieves the stream buffer exception_ptr if it has been set.
nullptr
will be returnedImplements Concurrency::streams::details::basic_streambuf< _CharType >.
Reads a single character from the stream without advancing the read position.
Implements Concurrency::streams::details::basic_streambuf< _CharType >.
Reads up to a given number of characters from the stream.
Implements Concurrency::streams::details::basic_streambuf< _CharType >.
Gets the current read or write position in the stream.
Some streams may have separate write and read cursors. For such streams, the direction parameter defines whether to move the read or the write cursor.
Implements Concurrency::streams::details::basic_streambuf< _CharType >.
has_size
is used to determine whether a stream buffer supports size().
size
API is supported, false otherwise.Implements Concurrency::streams::details::basic_streambuf< _CharType >.
For any input stream, in_avail
returns the number of characters that are immediately available to be consumed without blocking. May be used in conjunction with <cref="::sbumpc method"/> to read data without incurring the overhead of using tasks.
Implements Concurrency::streams::details::basic_streambuf< _CharType >.
is_eof
is used to determine whether a read head has reached the end of the buffer.
Implements Concurrency::streams::details::basic_streambuf< _CharType >.
Checks if the stream buffer is open.
No separation is made between open for reading and open for writing.
Implements Concurrency::streams::details::basic_streambuf< _CharType >.
Advances the read position, then returns the next character without advancing again.
Implements Concurrency::streams::details::basic_streambuf< _CharType >.
Checks if the stream buffer has been initialized or not.
Writes a single character to the stream.
Implements Concurrency::streams::details::basic_streambuf< _CharType >.
Writes a number of characters to the stream.
Implements Concurrency::streams::details::basic_streambuf< _CharType >.
Writes a number of characters to the stream. Note: callers must make sure the data to be written is valid until the returned task completes.
Implements Concurrency::streams::details::basic_streambuf< _CharType >.
Releases a block of data acquired using ::acquire method. This frees the stream buffer to de-allocate the memory, if it so desires. Move the read position ahead by the count.
Implements Concurrency::streams::details::basic_streambuf< _CharType >.
Reads a single character from the stream and advances the read position.
-1
if the read fails. -2
if an asynchronous read is requiredThis is a synchronous operation, but is guaranteed to never block.
Implements Concurrency::streams::details::basic_streambuf< _CharType >.
Copies up to a given number of characters from the stream, synchronously.
This is a synchronous operation, but is guaranteed to never block.
Implements Concurrency::streams::details::basic_streambuf< _CharType >.
Seeks to a position given by a relative offset.
Some streams may have separate write and read cursors. For such streams, the mode parameter defines whether to move the read or the write cursor.
Seeks to the given position.
Some streams may have separate write and read cursors. For such streams, the direction parameter defines whether to move the read or the write cursor.
std::ios_base::in
Sets the stream buffer implementation to buffer or not buffer.
An implementation that does not support buffering will silently ignore calls to this function and it will not have any effect on what is returned by subsequent calls to ::buffer_size method.
Implements Concurrency::streams::details::basic_streambuf< _CharType >.
Reads a single character from the stream without advancing the read position.
This is a synchronous operation, but is guaranteed to never block.
Implements Concurrency::streams::details::basic_streambuf< _CharType >.
Gets the total number of characters in the stream buffer, if known. Calls to has_size
will determine whether the result of size
can be relied on.
Implements Concurrency::streams::details::basic_streambuf< _CharType >.
For output streams, flush any internally buffered data to the underlying medium.
true
if the flush succeeds, false
if notImplements Concurrency::streams::details::basic_streambuf< _CharType >.
Retreats the read position, then returns the current character without advancing.
Implements Concurrency::streams::details::basic_streambuf< _CharType >.