SourcePro® API Reference Guide

 
List of all members | Public Member Functions | Static Public Member Functions | Protected Member Functions
RWUCharToByteOutputStreamImp Class Reference

Concrete class connecting a UTF-16 character stream to an output binary stream. More...

#include <rw/stream/RWUCharToByteOutputStreamImp.h>

Inheritance diagram for RWUCharToByteOutputStreamImp:
RWUCharOutputStreamImp RWOutputStreamImp RWStreamImp RWBodyBase RWTCountingBody< RWMutexLock > RWTMonitor< RWMutexLock >

Public Member Functions

virtual ~RWUCharToByteOutputStreamImp ()
 
virtual void close ()
 
virtual void flush ()
 
virtual bool isBad () const
 
virtual bool isFail () const
 
virtual bool isGood () const
 
virtual void write (RWUChar unicodeValue)
 
virtual void write (const RWUChar *unicodeArray, RWSize numUChars)
 
- Public Member Functions inherited from RWUCharOutputStreamImp
virtual ~RWUCharOutputStreamImp ()
 
virtual RWUCharOutputStream acquire ()
 
virtual void release ()
 
- Public Member Functions inherited from RWOutputStreamImp
virtual ~RWOutputStreamImp ()
 
- Public Member Functions inherited from RWStreamImp
virtual ~RWStreamImp ()
 

Static Public Member Functions

static RWUCharOutputStream make (const RWByteOutputStream &sink)
 

Protected Member Functions

 RWUCharToByteOutputStreamImp (const RWByteOutputStream &sinkStream)
 
RWByteOutputStreamgetSinkStream ()
 
const RWByteOutputStreamgetSinkStream () const
 
- Protected Member Functions inherited from RWUCharOutputStreamImp
 RWUCharOutputStreamImp ()
 
- Protected Member Functions inherited from RWOutputStreamImp
 RWOutputStreamImp ()
 
- 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 Unicode character stream to a binary stream. The UTF-16 characters are written as a sequence of bytes using the byte ordering (little endian, or big endian) supported by the system on which the code is executed. The UTF-16 character U+FEFF is inserted in the stream as first character to let input streams figure out the byte ordering used when generating the output byte sequence. Implements the body idiom from the handle-body pattern.

Constructor & Destructor Documentation

virtual RWUCharToByteOutputStreamImp::~RWUCharToByteOutputStreamImp ( )
virtual

Destructor.

RWUCharToByteOutputStreamImp::RWUCharToByteOutputStreamImp ( const RWByteOutputStream sinkStream)
protected

Initializes the reference to the binary stream that will be used as the sink of bytes, and writes the stream header (U+FEFF).

Parameters
sinkStreamThe binary stream that will serve as the sink of bytes.

Member Function Documentation

virtual void RWUCharToByteOutputStreamImp::close ( )
virtual

This function is forwarded to the binary stream used as the sink of bytes.

Reimplemented from RWOutputStreamImp.

virtual void RWUCharToByteOutputStreamImp::flush ( )
virtual

This function is forwarded to the binary stream used as the sink of bytes.

Implements RWOutputStreamImp.

RWByteOutputStream& RWUCharToByteOutputStreamImp::getSinkStream ( )
inlineprotected

Returns a reference to the binary stream that is used as the sink of bytes. Throw no exceptions.

const RWByteOutputStream& RWUCharToByteOutputStreamImp::getSinkStream ( ) const
inlineprotected

Returns a reference to the binary stream that is used as the sink of bytes. Throw no exceptions.

virtual bool RWUCharToByteOutputStreamImp::isBad ( ) const
virtual

This function is forwarded to the binary stream used as the sink of bytes. Throws no exceptions.

Implements RWStreamImp.

virtual bool RWUCharToByteOutputStreamImp::isFail ( ) const
virtual

This function is forwarded to the binary stream used as the sink of bytes. Throws no exceptions.

Implements RWStreamImp.

virtual bool RWUCharToByteOutputStreamImp::isGood ( ) const
virtual

This function is forwarded to the binary stream used as the sink of bytes. Throws no exceptions.

Implements RWStreamImp.

static RWUCharOutputStream RWUCharToByteOutputStreamImp::make ( const RWByteOutputStream sink)
inlinestatic

Constructs an RWUCharToByteOutputStreamImp instance that uses sink as its sink of bytes, and returns a handle to it.

Parameters
sinkThe binary stream that is used as the sink of bytes.
virtual void RWUCharToByteOutputStreamImp::write ( RWUChar  unicodeValue)
virtual

Writes a single UTF-16 character to the binary stream used as the sink of bytes.

Parameters
unicodeValueThe UTF-16 character to be written.

Implements RWUCharOutputStreamImp.

virtual void RWUCharToByteOutputStreamImp::write ( const RWUChar unicodeArray,
RWSize  numUChars 
)
virtual

Writes an array of UTF-16 characters to the stream used as the sink of bytes.

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

Implements RWUCharOutputStreamImp.

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