SourcePro® API Reference Guide

Product Documentation:
   SourcePro
Documentation Home
List of all members | Public Member Functions | Static Public Member Functions | Protected Member Functions
RWWCharFromWStreambufInputStreamImp Class Reference

Concrete class connecting a wide character stream to an iostreams wide character buffer. More...

#include <rw/stream/RWWCharFromWStreambufInputStreamImp.h>

Inheritance diagram for RWWCharFromWStreambufInputStreamImp:
RWWCharInputStreamImp RWInputStreamImp RWStreamImp RWBodyBase RWTCountingBody< RWMutexLock > RWTMonitor< RWMutexLock >

Public Member Functions

virtual ~RWWCharFromWStreambufInputStreamImp ()
 
virtual RWSize available () const
 
virtual void close ()
 
virtual bool isBad () const
 
virtual bool isEof () const
 
virtual bool isFail () const
 
virtual bool isGood () const
 
virtual wchar_t read ()
 
virtual RWSize read (wchar_t *wcharArray, RWSize numWChars)
 
virtual RWSize readUntil (wchar_t *wcharArray, RWSize maxSize, wchar_t delim)
 
virtual RWSize skip (RWSize numUnits)
 
- Public Member Functions inherited from RWWCharInputStreamImp
virtual ~RWWCharInputStreamImp ()
 
virtual RWWCharInputStream acquire ()
 
virtual void release ()
 
- Public Member Functions inherited from RWInputStreamImp
virtual ~RWInputStreamImp ()
 
- Public Member Functions inherited from RWStreamImp
virtual ~RWStreamImp ()
 

Static Public Member Functions

static RWWCharInputStream make (std::wstreambuf &source)
 

Protected Member Functions

 RWWCharFromWStreambufInputStreamImp (std::wstreambuf &sourceBuff)
 
std::wstreambuf & getSourceBuff ()
 
const std::wstreambuf & getSourceBuff () const
 
- Protected Member Functions inherited from RWWCharInputStreamImp
 RWWCharInputStreamImp ()
 
- Protected Member Functions inherited from RWInputStreamImp
 RWInputStreamImp ()
 
- Protected Member Functions inherited from RWStreamImp
 RWStreamImp ()
 
- Protected Member Functions inherited from RWBodyBase
 RWBodyBase (void)
 
 RWBodyBase (RWStaticCtor)
 
 RWBodyBase (const RWBodyBase &second)
 
virtual ~RWBodyBase (void)
 
RWBodyBaseoperator= (const RWBodyBase &second)
 
- Protected Member Functions inherited from RWTCountingBody< RWMutexLock >
 RWTCountingBody (unsigned initCount=0)
 
 RWTCountingBody (RWStaticCtor)
 
 RWTCountingBody (const RWTCountingBody< RWMutexLock > &second)
 
RWTCountingBody< RWMutexLock > & operator= (const RWTCountingBody< RWMutexLock > &second)
 
 ~RWTCountingBody (void)
 
unsigned addReference (void)
 
unsigned references (void) const
 
unsigned removeReference (void)
 
- Protected Member Functions inherited from RWTMonitor< RWMutexLock >
 RWTMonitor ()
 
 RWTMonitor (RWStaticCtor)
 
 RWTMonitor (const RWTMonitor< RWMutexLock > &second)
 
 ~RWTMonitor ()
 
void acquire ()
 
bool isAcquired () const
 
RWTMonitor< RWMutexLock > & monitor () const
 
RWMutexLockmutex ()
 
RWTMonitor< RWMutexLock > & operator= (const RWTMonitor< RWMutexLock > &)
 
void release ()
 
bool tryAcquire ()
 

Additional Inherited Members

- Protected Types inherited from RWTCountingBody< RWMutexLock >
typedef RWTLockGuard< RWTMonitor< RWMutexLock > > LockGuard
 
typedef RWTTryLockGuard< RWTMonitor< RWMutexLock > > TryLockGuard
 
typedef RWTUnlockGuard< RWTMonitor< RWMutexLock > > UnlockGuard
 
- Protected Types inherited from RWTMonitor< RWMutexLock >
typedef RWTLockGuard< RWTMonitor< RWMutexLock > > LockGuard
 
typedef RWTTryLockGuard< RWTMonitor< RWMutexLock > > TryLockGuard
 
typedef RWTUnlockGuard< RWTMonitor< RWMutexLock > > UnlockGuard
 

Detailed Description

Concrete class connecting a wide character stream to an iostreams wide character buffer. The iostreams buffer is used as the source for the wide characters read from the wide character stream. Implements the body idiom from the handle-body pattern.

Constructor & Destructor Documentation

virtual RWWCharFromWStreambufInputStreamImp::~RWWCharFromWStreambufInputStreamImp ( )
virtual

Destructor.

RWWCharFromWStreambufInputStreamImp::RWWCharFromWStreambufInputStreamImp ( std::wstreambuf &  sourceBuff)
inlineprotected

Initializes the reference to the iostreams std::wstreambuf, that will be used as the source of wide characters.

Parameters
sourceBuffThe iostreams std::wstreambuf that will serve as the source of wide characters.

Member Function Documentation

virtual RWSize RWWCharFromWStreambufInputStreamImp::available ( ) const
virtual

Returns the number of wide characters that can be read from the iostreams std::wstreambuf used as the source of wide characters without blocking.

Implements RWInputStreamImp.

virtual void RWWCharFromWStreambufInputStreamImp::close ( )
virtual

This function does nothing. The user is responsible for closing the iostreams std::wstreambuf used as the source of wide characters if necessary. Throws no exceptions.

Implements RWStreamImp.

std::wstreambuf& RWWCharFromWStreambufInputStreamImp::getSourceBuff ( )
inlineprotected

Returns a reference to the iostreams std::wstreambuf, which is used as the source of wide characters. Throws no exceptions.

const std::wstreambuf& RWWCharFromWStreambufInputStreamImp::getSourceBuff ( ) const
inlineprotected

Returns a reference to the iostreams std::wstreambuf, which is used as the source of wide characters. Throws no exceptions.

virtual bool RWWCharFromWStreambufInputStreamImp::isBad ( ) const
virtual

Returns true if the last operation performed on the iostreams std::wstreambuf failed. Throws no exceptions.

Implements RWStreamImp.

virtual bool RWWCharFromWStreambufInputStreamImp::isEof ( ) const
virtual

Returns true if there are no wide characters available from the iostreams std::wstreambuf used as the source of wide characters. Throws no exceptions.

Implements RWInputStreamImp.

virtual bool RWWCharFromWStreambufInputStreamImp::isFail ( ) const
virtual

Returns true if the last operation performed on the iostreams std::wstreambuf failed. Throws no exceptions.

Implements RWStreamImp.

virtual bool RWWCharFromWStreambufInputStreamImp::isGood ( ) const
virtual

Returns true if the last operation performed on the iostreams std::wstreambuf succeeded. Throws no exceptions.

Implements RWStreamImp.

static RWWCharInputStream RWWCharFromWStreambufInputStreamImp::make ( std::wstreambuf &  source)
inlinestatic

Constructs an RWWCharFromWStreambufInputStreamImp instance that uses source as its source of wide characters, and returns a handle to it. Throws no exceptions.

Parameters
sourceThe iostreams std::wstreambuf that is used as the source of wide characters.
virtual wchar_t RWWCharFromWStreambufInputStreamImp::read ( )
virtual

Reads a single wide character from the iostreams std::wstreambuf used as the source of wide characters.

Implements RWWCharInputStreamImp.

virtual RWSize RWWCharFromWStreambufInputStreamImp::read ( wchar_t *  wcharArray,
RWSize  numWChars 
)
virtual

Reads an array of wide characters from the iostreams std::wstreambuf used as the source of wide characters. The array must be pre-allocated to contain at least numWChars elements. The function returns the actual number of wide characters extracted from the iostreams std::wstreambuf.

Parameters
wcharArrayA pointer to the first element of the array.
numWCharsThe number of wide characters to be read from the stream.

Implements RWWCharInputStreamImp.

virtual RWSize RWWCharFromWStreambufInputStreamImp::readUntil ( wchar_t *  wcharArray,
RWSize  maxSize,
wchar_t  delim 
)
virtual

Reads wide characters from the iostreams std::wstreambuf used as the source of wide characters until the last wide character read is equal to delim, or maxSize wide characters have been read, or the end of the input sequence is reached. The wide characters read are stored in wcharArray. The function returns the actual number of wide characters inserted into wcharArray. If the last wide character extracted is equal to delim, then it is not stored in wcharArray.

Parameters
wcharArrayA pointer to the array receiving the wide characters extracted from the iostreams std::wstreambuf.
maxSizeThe maximum number of wide characters to be read.
delimThe wide character used as a delimiter.

Implements RWWCharInputStreamImp.

virtual RWSize RWWCharFromWStreambufInputStreamImp::skip ( RWSize  numUnits)
virtual

Skips numUnits wide characters from the input sequence if possible. The function returns the actual number of wide characters skipped, which can be any value between 0 and numUnits.

Parameters
numUnitsThe number of wide characters to be skipped.

Implements RWInputStreamImp.

Copyright © 2021 Rogue Wave Software, Inc., a Perforce company. All Rights Reserved.