SourcePro® API Reference Guide

 
Loading...
Searching...
No Matches
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 (const RWCharOutputStream &handle)
 
 RWCharOutputStream (RWCharOutputStreamImp *ptr)
 
void close ()
 
void flush ()
 
bool isBad () const
 
bool isFail () const
 
bool isGood () const
 
RWCharOutputStreamoperator<< (char charValue)
 
RWCharOutputStreamoperator<< (const RWCString &string)
 
RWCharOutputStreamoperator<< (RWCharOutputStream &(*pf)(RWCharOutputStream &))
 
RWCharOutputStream operator<< (RWCharOutputStream(*pf)(RWCharOutputStream &))
 
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
 

Friends

class RWTStreamGuardImp< RWCharOutputStream, RWFilteredCharOutputStreamImp >
 

Related Symbols

(Note that these are not member symbols.)

RWCharOutputStreamrwEndl (RWCharOutputStream &stream)
 
RWCharOutputStreamrwEnds (RWCharOutputStream &stream)
 
RWCharOutputStreamrwFlush (RWCharOutputStream &stream)
 
RWCharOutputStream rwGuard (RWCharOutputStream &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 narrow character output stream implementation classes. Implements the handle idiom from the handle-body pattern.

Constructor & Destructor Documentation

◆ RWCharOutputStream() [1/2]

RWCharOutputStream::RWCharOutputStream ( RWCharOutputStreamImp * ptr)
inlineexplicit

Constructor.

◆ RWCharOutputStream() [2/2]

RWCharOutputStream::RWCharOutputStream ( const RWCharOutputStream & handle)
inline

Copy constructor.

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

Member Function Documentation

◆ close()

void RWCharOutputStream::close ( )
inline

Closes the stream.

◆ flush()

void RWCharOutputStream::flush ( )
inline

Flushes the stream.

◆ isBad()

bool RWCharOutputStream::isBad ( ) const
inline

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

◆ isFail()

bool RWCharOutputStream::isFail ( ) const
inline

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

◆ isGood()

bool RWCharOutputStream::isGood ( ) const
inline

Returns true to indicate a stream in a valid state.

◆ operator<<() [1/4]

RWCharOutputStream & RWCharOutputStream::operator<< ( char charValue)
inline

Writes a single narrow character to the stream.

Parameters
charValueThe narrow character to be written to the stream.

◆ operator<<() [2/4]

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.

◆ operator<<() [3/4]

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

Inserter executing a manipulator function.

Parameters
pfThe manipulator's function pointer.

◆ operator<<() [4/4]

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

Inserter executing a manipulator function.

Parameters
pfThe manipulator's function pointer.

◆ operator=()

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

Assignment operator. Throws no exceptions.

Parameters
handleA narrow stream handle used to initialize this handle.

◆ write() [1/3]

void RWCharOutputStream::write ( char charValue)
inline

Writes a single narrow character to the stream.

Parameters
charValueThe narrow character to be written to the stream.

◆ write() [2/3]

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.

◆ write() [3/3]

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 Symbol Documentation

◆ rwEndl()

RWCharOutputStream & rwEndl ( RWCharOutputStream & stream)
related

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

Parameters
streamA narrow character output stream.

◆ rwEnds()

RWCharOutputStream & rwEnds ( RWCharOutputStream & stream)
related

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

Parameters
streamA narrow character output stream.

◆ rwFlush()

RWCharOutputStream & rwFlush ( RWCharOutputStream & stream)
related

Manipulator that flushes a narrow character output stream.

Parameters
streamThe narrow stream to be flushed.

◆ rwGuard()

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;
RWCharOutputStream rwGuard(RWCharOutputStream &stream)

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