SourcePro® API Reference Guide

 
List of all members | Public Member Functions | Related Functions
RWCharOutputStream Class Reference

Handle class for all narrow character output stream implementation classes. More...

#include <rw/stream/RWCharOutputStream.h>

Inheritance diagram for RWCharOutputStream:
RWHandleBase RWCharArrayOutputStream

Public Member Functions

 RWCharOutputStream (RWCharOutputStreamImp *ptr)
 
 RWCharOutputStream (const RWCharOutputStream &handle)
 
void close ()
 
void flush ()
 
bool isBad () const
 
bool isFail () const
 
bool isGood () const
 
RWCharOutputStreamoperator<< (RWCharOutputStream &(*pf)(RWCharOutputStream &))
 
RWCharOutputStream operator<< (RWCharOutputStream(*pf)(RWCharOutputStream &))
 
RWCharOutputStreamoperator<< (char charValue)
 
RWCharOutputStreamoperator<< (const RWCString &string)
 
RWCharOutputStreamoperator= (const RWCharOutputStream &handle)
 
void write (char charValue)
 
void write (const char *charArray, RWSize numChars)
 
void write (const RWCString &string)
 
- Public Member Functions inherited from RWHandleBase
bool isValid (void) const
 
bool operator!= (const RWHandleBase &second) const
 
bool operator< (const RWHandleBase &second) const
 
bool operator== (const RWHandleBase &second) const
 

Related Functions

(Note that these are not member functions.)

RWCharOutputStreamrwEndl (RWCharOutputStream &stream)
 
RWCharOutputStreamrwEnds (RWCharOutputStream &stream)
 
RWCharOutputStreamrwFlush (RWCharOutputStream &stream)
 
RWCharOutputStream rwGuard (RWCharOutputStream &stream)
 

Additional Inherited Members

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

Detailed Description

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

Constructor & Destructor Documentation

RWCharOutputStream::RWCharOutputStream ( RWCharOutputStreamImp ptr)
inlineexplicit

Constructor.

RWCharOutputStream::RWCharOutputStream ( const RWCharOutputStream handle)
inline

Copy constructor.

Parameters
handleA narrow stream handle used to initialize the newly created handle.

Member Function Documentation

void RWCharOutputStream::close ( )
inline

Closes the stream.

void RWCharOutputStream::flush ( void  )
inline

Flushes the stream.

bool RWCharOutputStream::isBad ( ) const
inline

Returns true to indicate a loss of integrity resulting from an output operation.

bool RWCharOutputStream::isFail ( ) const
inline

Returns true to indicate that an output operation failed to generate the desired data.

bool RWCharOutputStream::isGood ( ) const
inline

Returns true to indicate a stream in a valid state.

RWCharOutputStream& RWCharOutputStream::operator<< ( RWCharOutputStream &(*)(RWCharOutputStream &)  pf)
inline

Inserter executing a manipulator function.

Parameters
pfThe manipulator's function pointer.
RWCharOutputStream RWCharOutputStream::operator<< ( RWCharOutputStream(*)(RWCharOutputStream &)  pf)
inline

Inserter executing a manipulator function.

Parameters
pfThe manipulator's function pointer.
RWCharOutputStream& RWCharOutputStream::operator<< ( char  charValue)
inline

Writes a single narrow character to the stream.

Parameters
charValueThe narrow character to be written to the stream.
RWCharOutputStream& RWCharOutputStream::operator<< ( const RWCString string)
inline

Writes a narrow string to the stream.

Parameters
stringThe narrow string object to be written to the stream.
RWCharOutputStream& RWCharOutputStream::operator= ( const RWCharOutputStream handle)
inline

Assignment operator. Throws no exceptions.

Parameters
handleA narrow stream handle used to initialize this handle.
void RWCharOutputStream::write ( char  charValue)
inline

Writes a single narrow character to the stream.

Parameters
charValueThe narrow character to be written to the stream.
void RWCharOutputStream::write ( const char *  charArray,
RWSize  numChars 
)
inline

Writes an array of narrow characters to the stream.

Parameters
charArrayA pointer to the first element of the array.
numCharsThe number of narrow characters to be written to the stream.
void RWCharOutputStream::write ( const RWCString string)

Writes a single narrow string to the stream.

Parameters
stringThe narrow string object to be written to the stream.

Friends And Related Function Documentation

RWCharOutputStream & rwEndl ( RWCharOutputStream stream)
related

Manipulator that writes an end of line control character to the stream.

Parameters
streamA narrow character output stream.
RWCharOutputStream & rwEnds ( RWCharOutputStream stream)
related

Manipulator that writes an end of string character to the stream.

Parameters
streamA narrow character output stream.
RWCharOutputStream & rwFlush ( RWCharOutputStream stream)
related

Manipulator that flushes a narrow character output stream.

Parameters
streamThe narrow stream to be flushed.
RWCharOutputStream rwGuard ( RWCharOutputStream stream)
related
Header File
#include <rw/stream/RWGuardedCharOutputStreamImp.h>

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

Parameters
streamA narrow character output stream

A rwGuard() manipulator creates a temporary guarded stream that locks the internal mutex of the preceding synchronized stream. In this way, any insertions 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:
ostr << rwGuard << data1 << data2 << data3;

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