SourcePro® API Reference Guide

 
Loading...
Searching...
No Matches
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 (const RWBodyBase &second)
 
 RWBodyBase (RWStaticCtor)
 
 RWBodyBase (void)
 
virtual ~RWBodyBase (void)
 
RWBodyBaseoperator= (const RWBodyBase &second)
 
- Protected Member Functions inherited from RWTCountingBody< RWMutexLock >
 RWTCountingBody (const RWTCountingBody< RWMutexLock > &second)
 
 RWTCountingBody (RWStaticCtor)
 
 RWTCountingBody (unsigned initCount=0)
 
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 (const RWTMonitor< RWMutexLock > &second)
 
 RWTMonitor (RWStaticCtor)
 
 RWTMonitor (void)
 
 ~RWTMonitor (void)
 
void acquire (void)
 
bool isAcquired (void) const
 
RWTMonitor< RWMutexLock > & monitor (void) const
 
RWMutexLockmutex (void)
 
RWTMonitor< RWMutexLock > & operator= (const RWTMonitor< RWMutexLock > &)
 
void release (void)
 
bool tryAcquire (void)
 

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

◆ ~RWWCharFromWStreambufInputStreamImp()

virtual RWWCharFromWStreambufInputStreamImp::~RWWCharFromWStreambufInputStreamImp ( )
virtual

Destructor.

◆ RWWCharFromWStreambufInputStreamImp()

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

◆ available()

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.

◆ close()

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.

◆ getSourceBuff() [1/2]

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.

◆ getSourceBuff() [2/2]

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.

◆ isBad()

virtual bool RWWCharFromWStreambufInputStreamImp::isBad ( ) const
virtual

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

Implements RWStreamImp.

◆ isEof()

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.

◆ isFail()

virtual bool RWWCharFromWStreambufInputStreamImp::isFail ( ) const
virtual

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

Implements RWStreamImp.

◆ isGood()

virtual bool RWWCharFromWStreambufInputStreamImp::isGood ( ) const
virtual

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

Implements RWStreamImp.

◆ make()

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.

◆ read() [1/2]

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.

◆ read() [2/2]

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.

◆ readUntil()

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.

◆ skip()

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 © 2024 Rogue Wave Software, Inc., a Perforce company. All Rights Reserved.