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.
Public Member Functions | List of all members
Concurrency::streams::stdio_istream< CharType > Class Template Reference

stdio_istream represents an async istream derived from a standard synchronous stream, as defined by the "std" namespace. It is constructed from a reference to a standard stream, which must be valid for the lifetime of the asynchronous stream. More...

#include <interopstream.h>

Inheritance diagram for Concurrency::streams::stdio_istream< CharType >:
Concurrency::streams::basic_istream< CharType >

Public Member Functions

template<typename AlterCharType >
 stdio_istream (std::basic_istream< AlterCharType > &stream)
 Constructor More...
 
 stdio_istream (const stdio_istream &other)
 Copy constructor More...
 
stdio_istreamoperator= (const stdio_istream &other)
 Assignment operator More...
 
- Public Member Functions inherited from Concurrency::streams::basic_istream< CharType >
 basic_istream ()
 Default constructor More...
 
 basic_istream (streams::streambuf< CharType > buffer)
 Constructor More...
 
 basic_istream (const basic_istream &other)
 Copy constructor More...
 
basic_istreamoperator= (const basic_istream &other)
 Assignment operator More...
 
pplx::task< void > close () const
 Close the stream, preventing further read operations. More...
 
pplx::task< void > close (std::exception_ptr eptr) const
 Close the stream with exception, preventing further read operations. More...
 
bool is_eof () const
 Tests whether last read cause the stream reach EOF. More...
 
pplx::task< int_type > read () const
 Get the next character and return it as an int_type. Advance the read position. More...
 
template<typename T >
pplx::task< T > read () const
 Read a single value of "blittable" type T from the stream. More...
 
pplx::task< size_t > read (streams::streambuf< CharType > target, size_t count) const
 Reads up to count characters and place into the provided buffer. More...
 
pplx::task< int_type > peek () const
 Get the next character and return it as an int_type. Do not advance the read position. More...
 
pplx::task< size_t > read_to_delim (streams::streambuf< CharType > target, int_type delim) const
 Read characters until a delimiter or EOF is found, and place them into the target. Proceed past the delimiter, but don't include it in the target buffer. More...
 
pplx::task< size_t > read_line (streams::streambuf< CharType > target) const
 Read until reaching a newline character. The newline is not included in the target. More...
 
pplx::task< size_t > read_to_end (streams::streambuf< CharType > target) const
 Read until reaching the end of the stream. 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 is used to determine whether the stream supports seeking. 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...
 
template<typename T >
pplx::task< T > extract () const
 Read a value of type T from the stream. More...
 

Additional Inherited Members

- Public Types inherited from Concurrency::streams::basic_istream< CharType >
typedef char_traits< CharType > traits
 
typedef char_traits< CharType >::int_type int_type
 
typedef traits::pos_type pos_type
 
typedef traits::off_type off_type
 

Detailed Description

template<typename CharType>
class Concurrency::streams::stdio_istream< CharType >

stdio_istream represents an async istream derived from a standard synchronous stream, as defined by the "std" namespace. It is constructed from a reference to a standard stream, which must be valid for the lifetime of the asynchronous stream.

Template Parameters
CharTypeThe data type of the basic element of the stdio_istream.

Since std streams are not reference-counted, great care must be taken by an application to make sure that the std stream does not get destroyed until all uses of the asynchronous stream are done and have been serviced.

Constructor & Destructor Documentation

template<typename CharType >
template<typename AlterCharType >
Concurrency::streams::stdio_istream< CharType >::stdio_istream ( std::basic_istream< AlterCharType > &  stream)
inline

Constructor

Template Parameters
AlterCharTypeThe data type of the basic element of the source istream
Parameters
streamThe synchronous stream that this is using for its I/O
template<typename CharType >
Concurrency::streams::stdio_istream< CharType >::stdio_istream ( const stdio_istream< CharType > &  other)
inline

Copy constructor

Parameters
otherThe source object

Member Function Documentation

template<typename CharType >
stdio_istream& Concurrency::streams::stdio_istream< CharType >::operator= ( const stdio_istream< CharType > &  other)
inline

Assignment operator

Parameters
otherThe source object
Returns
A reference to the input stream object that contains the result of the assignment.

The documentation for this class was generated from the following file: