SourcePro® API Reference Guide

 
Loading...
Searching...
No Matches
RWUCharToUTF8ByteOutputStreamImp Class Reference

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

#include <rw/stream/RWUCharToUTF8ByteOutputStreamImp.h>

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

Public Member Functions

virtual ~RWUCharToUTF8ByteOutputStreamImp ()
 
virtual void close ()
 
virtual void flush ()
 
virtual bool isBad () const
 
virtual bool isFail () const
 
virtual bool isGood () const
 
virtual void write (const RWUChar *unicodeArray, RWSize numUChars)
 
virtual void write (RWUChar unicodeValue)
 
- 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

 RWUCharToUTF8ByteOutputStreamImp (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 (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 UTF-16 character stream to a UTF-8 binary stream. The UTF-16 characters are transformed as a sequence of UTF-8 bytes. UTF-8 is a variable length encoding of the Unicode Standard using 8-bit sequences, where the high bits indicate which part of the sequence a byte belongs to. Implements the body idiom from the handle-body pattern.

Constructor & Destructor Documentation

◆ ~RWUCharToUTF8ByteOutputStreamImp()

virtual RWUCharToUTF8ByteOutputStreamImp::~RWUCharToUTF8ByteOutputStreamImp ( )
virtual

Destructor.

◆ RWUCharToUTF8ByteOutputStreamImp()

RWUCharToUTF8ByteOutputStreamImp::RWUCharToUTF8ByteOutputStreamImp ( const RWByteOutputStream & sinkStream)
protected

Initializes the reference to the binary stream that will be used as the sink of bytes.

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

Member Function Documentation

◆ close()

virtual void RWUCharToUTF8ByteOutputStreamImp::close ( )
virtual

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

Reimplemented from RWOutputStreamImp.

◆ flush()

virtual void RWUCharToUTF8ByteOutputStreamImp::flush ( )
virtual

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

Implements RWOutputStreamImp.

◆ getSinkStream() [1/2]

RWByteOutputStream & RWUCharToUTF8ByteOutputStreamImp::getSinkStream ( )
inlineprotected

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

◆ getSinkStream() [2/2]

const RWByteOutputStream & RWUCharToUTF8ByteOutputStreamImp::getSinkStream ( ) const
inlineprotected

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

◆ isBad()

virtual bool RWUCharToUTF8ByteOutputStreamImp::isBad ( ) const
virtual

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

Implements RWStreamImp.

◆ isFail()

virtual bool RWUCharToUTF8ByteOutputStreamImp::isFail ( ) const
virtual

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

Implements RWStreamImp.

◆ isGood()

virtual bool RWUCharToUTF8ByteOutputStreamImp::isGood ( ) const
virtual

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

Implements RWStreamImp.

◆ make()

static RWUCharOutputStream RWUCharToUTF8ByteOutputStreamImp::make ( const RWByteOutputStream & sink)
inlinestatic

Constructs an RWUCharToUTF8ByteOutputStreamImp instance that uses sink as its sink of bytes, and returns a handle to it. Throws no exceptions.

Parameters
sinkThe binary stream that is used as the sink of bytes.

◆ write() [1/2]

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

Encodes, and 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 encoded.

Implements RWUCharOutputStreamImp.

◆ write() [2/2]

virtual void RWUCharToUTF8ByteOutputStreamImp::write ( RWUChar unicodeValue)
virtual

Encodes, and writes a single UTF-16 character to the binary stream used as the sink of bytes.

Parameters
unicodeValueThe UTF-16 character to be encoded.

Implements RWUCharOutputStreamImp.

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