SourcePro® API Reference Guide

 
Loading...
Searching...
No Matches
RWWCharInputStream Class Reference

Handle class for all the wide character input stream implementation classes. More...

#include <rw/stream/RWWCharInputStream.h>

Inheritance diagram for RWWCharInputStream:
RWHandleBase

Public Member Functions

 RWWCharInputStream (const RWWCharInputStream &handle)
 
 RWWCharInputStream (RWWCharInputStreamImp *ptr)
 
RWSize available () const
 
void close ()
 
bool isBad () const
 
bool isEof () const
 
bool isFail () const
 
bool isGood () const
 
RWWCharInputStreamoperator= (const RWWCharInputStream &handle)
 
RWWCharInputStreamoperator>> (RWWCharInputStream &(*pf)(RWWCharInputStream &))
 
RWWCharInputStream operator>> (RWWCharInputStream(*pf)(RWWCharInputStream &))
 
RWWCharInputStreamoperator>> (wchar_t &wcharValue)
 
wchar_t read ()
 
RWSize read (wchar_t *wcharArray, RWSize numWChars)
 
RWSize readUntil (wchar_t *wcharArray, RWSize maxSize, wchar_t delim)
 
RWSize skip (RWSize numUnits)
 
- Public Member Functions inherited from RWHandleBase
bool isValid (void) const
 
bool operator!= (const RWHandleBase &second) const
 
bool operator== (const RWHandleBase &second) const
 

Friends

class RWTStreamGuardImp< RWWCharInputStream, RWFilteredWCharInputStreamImp >
 

Related Symbols

(Note that these are not member symbols.)

RWWCharInputStreamrwDisc (RWWCharInputStream &stream)
 
RWWCharInputStream rwGuard (RWWCharInputStream &stream)
 

Additional Inherited Members

- Protected Member Functions inherited from RWHandleBase
 RWHandleBase (const RWHandleBase &second)
 
 RWHandleBase (RWBodyBase *body)
 
 RWHandleBase (RWStaticCtor)
 
 RWHandleBase (void)
 
 ~RWHandleBase (void)
 
RWBodyBasebody (void) const
 
RWHandleBaseoperator= (const RWHandleBase &second)
 

Detailed Description

Handle class for all the wide character input stream implementation classes. Implements the handle idiom from the handle-body pattern.

Constructor & Destructor Documentation

◆ RWWCharInputStream() [1/2]

RWWCharInputStream::RWWCharInputStream ( RWWCharInputStreamImp * ptr)
inlineexplicit

Constructor.

◆ RWWCharInputStream() [2/2]

RWWCharInputStream::RWWCharInputStream ( const RWWCharInputStream & handle)
inline

Copy constructor.

Parameters
handleA wide character stream handle used to initialize the newly created handle.

Member Function Documentation

◆ available()

RWSize RWWCharInputStream::available ( ) const
inline

Returns the number of wide characters that can be read from the stream without blocking. Throws no exceptions.

◆ close()

void RWWCharInputStream::close ( )
inline

Closes the stream.

◆ isBad()

bool RWWCharInputStream::isBad ( ) const
inline

Returns true to indicate a loss of integrity resulting from an input operation, such as an irrecoverable read error from a file. Throws no exceptions.

◆ isEof()

bool RWWCharInputStream::isEof ( ) const
inline

Returns true to indicate that an input operation reached the end of an input sequence. Throws no exceptions.

◆ isFail()

bool RWWCharInputStream::isFail ( ) const
inline

Returns true to indicate that an input operation failed to read the expected data. Throws no exceptions.

◆ isGood()

bool RWWCharInputStream::isGood ( ) const
inline

Returns true to indicate a stream in a valid state. Throws no exceptions.

◆ operator=()

RWWCharInputStream & RWWCharInputStream::operator= ( const RWWCharInputStream & handle)
inline

Assignment operator. Throws no exceptions.

Parameters
handleA wide character stream handle used to initialize this handle.

◆ operator>>() [1/3]

RWWCharInputStream & RWWCharInputStream::operator>> ( RWWCharInputStream &(* pf )(RWWCharInputStream &))
inline

Extractor executing a manipulator function.

Parameters
pfThe manipulator's function pointer.

◆ operator>>() [2/3]

RWWCharInputStream RWWCharInputStream::operator>> ( RWWCharInputStream(* pf )(RWWCharInputStream &))
inline

Extractor executing a manipulator function.

Parameters
pfThe manipulator's function pointer.

◆ operator>>() [3/3]

RWWCharInputStream & RWWCharInputStream::operator>> ( wchar_t & wcharValue)
inline

Reads a single wide character from the stream.

Parameters
wcharValueThe wide character to be read from the stream.

◆ read() [1/2]

wchar_t RWWCharInputStream::read ( )
inline

Reads a single wide character from the stream.

◆ read() [2/2]

RWSize RWWCharInputStream::read ( wchar_t * wcharArray,
RWSize numWChars )
inline

Reads an array of wide characters from the stream. The array must be pre-allocated to contain at least numWChars elements. The function returns the actual number of wide characters extracted from the stream.

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

◆ readUntil()

RWSize RWWCharInputStream::readUntil ( wchar_t * wcharArray,
RWSize maxSize,
wchar_t delim )
inline

Reads wide characters from the stream 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 read from the stream.

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

◆ skip()

RWSize RWWCharInputStream::skip ( RWSize numUnits)
inline

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.

Friends And Related Symbol Documentation

◆ rwDisc()

RWWCharInputStream & rwDisc ( RWWCharInputStream & stream)
related

Manipulator that discards a narrow character from a stream input sequence.

Parameters
streamThe wide character stream.

◆ rwGuard()

RWWCharInputStream rwGuard ( RWWCharInputStream & stream)
related
Header File
#include <rw/stream/RWGuardedWCharInputStreamImp.h>

Manipulator that is used to guard a series of extraction operations.

Parameters
streamA wide character input stream.

A rwGuard() manipulator creates a temporary guarded stream that locks the internal mutex of the preceding synchronized stream. In this way, any extractions following the manipulator within the statement will be atomic, that is, uninterrupted by any other threads. Note that if the preceding stream is not a synchronized stream, the rwGuard() manipulator has no effect.

// Lock the stream for the duration of all three insertions:
instr >> rwGuard >> data1 >> data2 >> data3;
RWWCharInputStream rwGuard(RWWCharInputStream &stream)

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