NDDEM
Public Types | Public Member Functions | Private Member Functions | Private Attributes | List of all members
BasicIStreamWrapper< StreamType > Class Template Reference

Wrapper of std::basic_istream into RapidJSON's Stream concept. More...

#include <istreamwrapper.h>

Public Types

typedef StreamType::char_type Ch
 

Public Member Functions

 BasicIStreamWrapper (StreamType &stream)
 Constructor. More...
 
 BasicIStreamWrapper (StreamType &stream, char *buffer, size_t bufferSize)
 Constructor. More...
 
Ch Peek () const
 
Ch Take ()
 
size_t Tell () const
 
void Put (Ch)
 
void Flush ()
 
ChPutBegin ()
 
size_t PutEnd (Ch *)
 
const ChPeek4 () const
 

Private Member Functions

 BasicIStreamWrapper ()
 
 BasicIStreamWrapper (const BasicIStreamWrapper &)
 
BasicIStreamWrapperoperator= (const BasicIStreamWrapper &)
 
void Read ()
 

Private Attributes

StreamType & stream_
 
Ch peekBuffer_ [4]
 
Chbuffer_
 
size_t bufferSize_
 
ChbufferLast_
 
Chcurrent_
 
size_t readCount_
 
size_t count_
 Number of characters read. More...
 
bool eof_
 

Detailed Description

template<typename StreamType>
class BasicIStreamWrapper< StreamType >

Wrapper of std::basic_istream into RapidJSON's Stream concept.

The classes can be wrapped including but not limited to:

Template Parameters
StreamTypeClass derived from std::basic_istream.

Member Typedef Documentation

◆ Ch

template<typename StreamType >
typedef StreamType::char_type BasicIStreamWrapper< StreamType >::Ch

Constructor & Destructor Documentation

◆ BasicIStreamWrapper() [1/4]

template<typename StreamType >
BasicIStreamWrapper< StreamType >::BasicIStreamWrapper ( StreamType &  stream)
inline

Constructor.

Parameters
streamstream opened for read.

◆ BasicIStreamWrapper() [2/4]

template<typename StreamType >
BasicIStreamWrapper< StreamType >::BasicIStreamWrapper ( StreamType &  stream,
char *  buffer,
size_t  bufferSize 
)
inline

Constructor.

Parameters
streamstream opened for read.
bufferuser-supplied buffer.
bufferSizesize of buffer in bytes. Must >=4 bytes.

◆ BasicIStreamWrapper() [3/4]

template<typename StreamType >
BasicIStreamWrapper< StreamType >::BasicIStreamWrapper ( )
private

◆ BasicIStreamWrapper() [4/4]

template<typename StreamType >
BasicIStreamWrapper< StreamType >::BasicIStreamWrapper ( const BasicIStreamWrapper< StreamType > &  )
private

Member Function Documentation

◆ Flush()

template<typename StreamType >
void BasicIStreamWrapper< StreamType >::Flush ( )
inline

◆ operator=()

template<typename StreamType >
BasicIStreamWrapper& BasicIStreamWrapper< StreamType >::operator= ( const BasicIStreamWrapper< StreamType > &  )
private

◆ Peek()

template<typename StreamType >
Ch BasicIStreamWrapper< StreamType >::Peek ( ) const
inline

◆ Peek4()

template<typename StreamType >
const Ch* BasicIStreamWrapper< StreamType >::Peek4 ( ) const
inline

◆ Put()

template<typename StreamType >
void BasicIStreamWrapper< StreamType >::Put ( Ch  )
inline

◆ PutBegin()

template<typename StreamType >
Ch* BasicIStreamWrapper< StreamType >::PutBegin ( )
inline

◆ PutEnd()

template<typename StreamType >
size_t BasicIStreamWrapper< StreamType >::PutEnd ( Ch )
inline

◆ Read()

template<typename StreamType >
void BasicIStreamWrapper< StreamType >::Read ( )
inlineprivate

◆ Take()

template<typename StreamType >
Ch BasicIStreamWrapper< StreamType >::Take ( )
inline

◆ Tell()

template<typename StreamType >
size_t BasicIStreamWrapper< StreamType >::Tell ( ) const
inline

Member Data Documentation

◆ buffer_

template<typename StreamType >
Ch * BasicIStreamWrapper< StreamType >::buffer_
private

◆ bufferLast_

template<typename StreamType >
Ch* BasicIStreamWrapper< StreamType >::bufferLast_
private

◆ bufferSize_

template<typename StreamType >
size_t BasicIStreamWrapper< StreamType >::bufferSize_
private

◆ count_

template<typename StreamType >
size_t BasicIStreamWrapper< StreamType >::count_
private

Number of characters read.

◆ current_

template<typename StreamType >
Ch* BasicIStreamWrapper< StreamType >::current_
private

◆ eof_

template<typename StreamType >
bool BasicIStreamWrapper< StreamType >::eof_
private

◆ peekBuffer_

template<typename StreamType >
Ch BasicIStreamWrapper< StreamType >::peekBuffer_[4]
private

◆ readCount_

template<typename StreamType >
size_t BasicIStreamWrapper< StreamType >::readCount_
private

◆ stream_

template<typename StreamType >
StreamType& BasicIStreamWrapper< StreamType >::stream_
private

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