C++ Rest SDK
The C++ REST SDK is a Microsoft project for cloud-based client-server communication in native code using a modern asynchronous C++ API design. This project aims to help C++ developers connect to and interact with services.
|
The basic_stdio_buffer class serves to support interoperability with STL stream buffers. Sitting atop a std::streambuf, which does all the I/O, instances of this class may read and write data to standard iostreams. The class itself should not be used in application code, it is used by the stream definitions farther down in the header file. More...
#include <interopstream.h>
Public Member Functions | |
virtual | ~basic_stdio_buffer () |
Destructor More... | |
Public Member Functions inherited from Concurrency::streams::details::streambuf_state_manager< _CharType > | |
virtual bool | can_read () const |
can_read is used to determine whether a stream buffer will support read operations (get). More... | |
virtual bool | can_write () const |
can_write is used to determine whether a stream buffer will support write operations (put). More... | |
virtual bool | is_open () const |
Checks if the stream buffer is open. More... | |
virtual pplx::task< void > | close (std::ios_base::openmode mode=std::ios_base::in|std::ios_base::out) |
Closes the stream buffer, preventing further read or write operations. More... | |
virtual pplx::task< void > | close (std::ios_base::openmode mode, std::exception_ptr eptr) |
Closes the stream buffer with an exception. More... | |
virtual bool | is_eof () const |
is_eof is used to determine whether a read head has reached the end of the buffer. More... | |
virtual pplx::task< int_type > | putc (_CharType ch) |
Writes a single character to the stream. More... | |
virtual pplx::task< size_t > | putn (const _CharType *ptr, size_t count) |
Writes a number of characters to the stream. More... | |
virtual pplx::task< size_t > | putn_nocopy (const _CharType *ptr, size_t count) |
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. More... | |
virtual pplx::task< int_type > | bumpc () |
Reads a single character from the stream and advances the read position. More... | |
virtual int_type | sbumpc () |
Reads a single character from the stream and advances the read position. More... | |
virtual pplx::task< int_type > | getc () |
Reads a single character from the stream without advancing the read position. More... | |
virtual int_type | sgetc () |
Reads a single character from the stream without advancing the read position. More... | |
virtual pplx::task< int_type > | nextc () |
Advances the read position, then returns the next character without advancing again. More... | |
virtual pplx::task< int_type > | ungetc () |
Retreats the read position, then returns the current character without advancing. More... | |
virtual pplx::task< size_t > | getn (_Out_writes_(count) _CharType *ptr, _In_ size_t count) |
Reads up to a given number of characters from the stream. More... | |
virtual size_t | scopy (_Out_writes_(count) _CharType *ptr, _In_ size_t count) |
Copies up to a given number of characters from the stream, synchronously. More... | |
virtual pplx::task< void > | sync () |
For output streams, flush any internally buffered data to the underlying medium. More... | |
virtual std::exception_ptr | exception () const |
Retrieves the stream buffer exception_ptr if it has been set. More... | |
_CharType * | alloc (size_t count) |
Allocates a contiguous memory block and returns it. More... | |
void | commit (size_t count) |
Submits a block already allocated by the stream buffer. More... | |
virtual utility::size64_t | size () const |
Gets the size of the stream, if known. Calls to has_size will determine whether the result of size can be relied on. More... | |
virtual bool | acquire (_Out_writes_(count) _CharType *&ptr, _In_ size_t &count)=0 |
virtual void | release (_Out_writes_(count) _CharType *ptr, _In_ size_t count)=0 |
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. More... | |
Public Member Functions inherited from Concurrency::streams::details::basic_streambuf< _CharType > | |
virtual | ~basic_streambuf () |
Virtual constructor for stream buffers. More... | |
virtual _CharType * | alloc (_In_ size_t count)=0 |
Allocates a contiguous memory block and returns it. More... | |
virtual void | commit (_In_ size_t count)=0 |
Submits a block already allocated by the stream buffer. More... | |
virtual bool | acquire (_Out_ _CharType *&ptr, _Out_ size_t &count)=0 |
Gets a pointer to the next already allocated contiguous block of data. More... | |
Friends | |
template<typename CharType > | |
class | concurrency::streams::stdio_ostream |
template<typename CharType > | |
class | concurrency::streams::stdio_istream |
Additional Inherited Members | |
Public Types inherited from Concurrency::streams::details::streambuf_state_manager< _CharType > | |
typedef details::basic_streambuf< _CharType >::traits | traits |
typedef details::basic_streambuf< _CharType >::int_type | int_type |
typedef details::basic_streambuf< _CharType >::pos_type | pos_type |
typedef details::basic_streambuf< _CharType >::off_type | off_type |
Public Types inherited from Concurrency::streams::details::basic_streambuf< _CharType > | |
typedef _CharType | char_type |
typedef ::concurrency::streams::char_traits< _CharType > | traits |
typedef traits::int_type | int_type |
typedef traits::pos_type | pos_type |
typedef traits::off_type | off_type |
Protected Member Functions inherited from Concurrency::streams::details::streambuf_state_manager< _CharType > | |
virtual pplx::task< size_t > | _putn (const _CharType *ptr, size_t count, bool) |
virtual pplx::task< size_t > | _getn (_Out_writes_(count) _CharType *ptr, _In_ size_t count)=0 |
virtual size_t | _scopy (_Out_writes_(count) _CharType *ptr, _In_ size_t count)=0 |
virtual pplx::task< void > | _close_read () |
The real read head close operation, implementation should override it if there is any resource to be released. More... | |
virtual pplx::task< void > | _close_write () |
The real write head close operation, implementation should override it if there is any resource to be released. More... | |
streambuf_state_manager (std::ios_base::openmode mode) | |
Protected Attributes inherited from Concurrency::streams::details::streambuf_state_manager< _CharType > | |
std::exception_ptr | m_currentException |
bool | m_stream_can_read |
bool | m_stream_can_write |
bool | m_stream_read_eof |
bool | m_alloced |
The basic_stdio_buffer class serves to support interoperability with STL stream buffers. Sitting atop a std::streambuf, which does all the I/O, instances of this class may read and write data to standard iostreams. The class itself should not be used in application code, it is used by the stream definitions farther down in the header file.
|
inlinevirtual |
Destructor