SourcePro® API Reference Guide

 
Loading...
Searching...
No Matches
RWUCharInputStream Class Reference

Handle class for all the UTF-16 character input stream implementation classes. More...

#include <rw/stream/RWUCharInputStream.h>

Inheritance diagram for RWUCharInputStream:
RWHandleBase

Public Member Functions

 RWUCharInputStream (const RWUCharInputStream &handle)
 
 RWUCharInputStream (RWUCharInputStreamImp *body)
 
RWSize available () const
 
void close ()
 
bool isBad () const
 
bool isEof () const
 
bool isFail () const
 
bool isGood () const
 
RWUCharInputStreamoperator= (const RWUCharInputStream &handle)
 
RWUCharInputStreamoperator>> (RWUChar &unicodeValue)
 
RWUCharInputStreamoperator>> (RWUCharInputStream &(*pf)(RWUCharInputStream &))
 
RWUCharInputStream operator>> (RWUCharInputStream(*pf)(RWUCharInputStream &))
 
RWUChar read ()
 
RWSize read (RWUChar *unicodeArray, RWSize numUChars)
 
RWSize readUntil (RWUChar *unicodeArray, RWSize maxSize, RWUChar 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< RWUCharInputStream, RWFilteredUCharInputStreamImp >
 

Related Symbols

(Note that these are not member symbols.)

RWUCharInputStreamrwDisc (RWUCharInputStream &stream)
 
RWUCharInputStream rwGuard (RWUCharInputStream &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 UTF-16 character input stream implementation classes. Implements the handle idiom from the handle-body pattern.

Constructor & Destructor Documentation

◆ RWUCharInputStream() [1/2]

RWUCharInputStream::RWUCharInputStream ( RWUCharInputStreamImp * body)
inlineexplicit

Constructor.

◆ RWUCharInputStream() [2/2]

RWUCharInputStream::RWUCharInputStream ( const RWUCharInputStream & handle)
inline

Copy constructor.

Parameters
handleA UTF-16 character stream handle used to initialize the newly created handle.

Member Function Documentation

◆ available()

RWSize RWUCharInputStream::available ( ) const
inline

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

◆ close()

void RWUCharInputStream::close ( )
inline

Close the stream.

◆ isBad()

bool RWUCharInputStream::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 RWUCharInputStream::isEof ( ) const
inline

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

◆ isFail()

bool RWUCharInputStream::isFail ( ) const
inline

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

◆ isGood()

bool RWUCharInputStream::isGood ( ) const
inline

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

◆ operator=()

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

Assignment operator. Throws no exceptions.

Parameters
handleA UTF-16 character stream handle used to initialize this handle.

◆ operator>>() [1/3]

RWUCharInputStream & RWUCharInputStream::operator>> ( RWUChar & unicodeValue)
inline

Reads a single UTF-16 character from the stream.

Parameters
unicodeValueThe UTF-16 character to be read from the stream.

◆ operator>>() [2/3]

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

Extractor executing a manipulator function.

Parameters
pfThe manipulator's function pointer.

◆ operator>>() [3/3]

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

Extractor executing a manipulator function.

Parameters
pfThe manipulator's function pointer.

◆ read() [1/2]

RWUChar RWUCharInputStream::read ( )
inline

Reads a single UTF-16 character from the stream.

◆ read() [2/2]

RWSize RWUCharInputStream::read ( RWUChar * unicodeArray,
RWSize numUChars )
inline

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

Parameters
unicodeArrayA pointer to the first element of the array.
numUCharsThe number of UTF-16 characters to be read from the stream.

◆ readUntil()

RWSize RWUCharInputStream::readUntil ( RWUChar * unicodeArray,
RWSize maxSize,
RWUChar delim )
inline

Reads UTF-16 characters from the stream until the last UTF-16 character read is equal to delim, or maxSize UTF-16 characters have been read, or the end of the input sequence is reached. The UTF-16 characters read are stored in unicodeArray. The function returns the actual number of UTF-16 characters read from the stream.

Parameters
unicodeArrayA pointer to the array receiving the UTF-16 characters extracted from the stream.
maxSizeThe maximum number of UTF-16 characters to be read.
delimThe UTF-16 character used as a delimiter.

◆ skip()

RWSize RWUCharInputStream::skip ( RWSize numUnits)
inline

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

Parameters
numUnitsThe number of UTF-16 characters to be skipped.

Friends And Related Symbol Documentation

◆ rwDisc()

RWUCharInputStream & rwDisc ( RWUCharInputStream & stream)
related

Manipulator that discards a UTF-16 character from a stream input sequence.

Parameters
streamThe UTF-16 character stream.

◆ rwGuard()

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

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

Parameters
streamA UTF-16 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.

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

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