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.
|
Base interface for all asynchronous output streams. More...
#include <streams.h>
Public Types | |
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 |
Public Member Functions | |
basic_ostream () | |
Default constructor More... | |
basic_ostream (const basic_ostream &other) | |
Copy constructor More... | |
basic_ostream & | operator= (const basic_ostream &other) |
Assignment operator More... | |
basic_ostream (streams::streambuf< CharType > buffer) | |
Constructor More... | |
pplx::task< void > | close () const |
Close the stream, preventing further write operations. More... | |
pplx::task< void > | close (std::exception_ptr eptr) const |
Close the stream with exception, preventing further write operations. More... | |
pplx::task< int_type > | write (CharType ch) const |
Put a single character into the stream. More... | |
template<typename T > | |
pplx::task< size_t > | write (T value) const |
Write a single value of "blittable" type T into the stream. More... | |
pplx::task< size_t > | write (streams::streambuf< CharType > source, size_t count) const |
Write a number of characters from a given stream buffer into the stream. More... | |
pplx::task< size_t > | print (const std::basic_string< CharType > &str) const |
Write the specified string to the output stream. More... | |
template<typename T > | |
pplx::task< size_t > | print (const T &val) const |
Write a value of type T to the output stream. More... | |
template<typename T > | |
pplx::task< size_t > | print_line (const T &val) const |
Write a value of type T to the output stream and append a newline character. More... | |
pplx::task< void > | flush () const |
Flush any buffered output data. More... | |
pos_type | seek (pos_type pos) const |
Seeks to the specified write position. More... | |
pos_type | seek (off_type off, std::ios_base::seekdir way) const |
Seeks to the specified write position. More... | |
pos_type | tell () const |
Get the current write position, i.e. the offset from the beginning of the stream. More... | |
bool | can_seek () const |
can_seek More... | |
bool | is_valid () const |
Test whether the stream has been initialized with a valid stream buffer. More... | |
operator bool () const | |
Test whether the stream has been initialized or not. More... | |
bool | is_open () const |
Test whether the stream is open for writing. More... | |
concurrency::streams::streambuf< CharType > | streambuf () const |
Get the underlying stream buffer. More... | |
Protected Member Functions | |
void | set_helper (std::shared_ptr< details::basic_ostream_helper< CharType >> helper) |
Base interface for all asynchronous output streams.
|
inline |
Default constructor
|
inline |
Copy constructor
other | The source object |
|
inline |
Constructor
buffer | A stream buffer. |
|
inline |
can_seek
is used to determine whether the stream supports seeking.
true
if the stream supports seeking, false
otherwise.
|
inline |
Close the stream, preventing further write operations.
|
inline |
Close the stream with exception, preventing further write operations.
eptr | Pointer to the exception. |
|
inline |
Flush any buffered output data.
|
inline |
Test whether the stream is open for writing.
true
if the stream is open for writing, false
otherwise.
|
inline |
Test whether the stream has been initialized with a valid stream buffer.
true
if the stream has been initialized with a valid stream buffer, false
otherwise.
|
inline |
Test whether the stream has been initialized or not.
|
inline |
Assignment operator
other | The source object |
|
inline |
Write the specified string to the output stream.
str | Input string. |
|
inline |
Write a value of type T
to the output stream.
T | The data type of the object to be written to the stream |
val | Input object. |
|
inline |
Write a value of type T
to the output stream and append a newline character.
T | The data type of the object to be written to the stream |
val | Input object. |
|
inline |
Seeks to the specified write position.
pos | An offset relative to the beginning of the stream. |
|
inline |
Seeks to the specified write position.
off | An offset relative to the beginning, current write position, or the end of the stream. |
way | The starting point (beginning, current, end) for the seek. |
|
inline |
Get the underlying stream buffer.
|
inline |
Get the current write position, i.e. the offset from the beginning of the stream.
|
inline |
Put a single character into the stream.
ch | A character |
|
inline |
Write a single value of "blittable" type T into the stream.
value | A value of type T. |
This is not a replacement for a proper binary serialization solution, but it may form the foundation for one. Writing data bit-wise to a stream is a primitive operation of binary serialization. Currently, no attention is paid to byte order. All data is written in the platform's native byte order, which means little-endian on all platforms that have been tested. This function is only available for streams using a single-byte character size.
|
inline |
Write a number of characters from a given stream buffer into the stream.
source | A source stream buffer. |
count | The number of characters to write. |