Rogue Wave banner
Previous fileTop of DocumentContentsIndex pageNext file
XML Streams Module Reference Guide
Rogue Wave web site:  Home Page  |  Main Documentation Page

RWTTransformOutputStreamImp

Module:  XML Streams   Package:  XML Streams


RWTTransformOutputStreamImp FilteredOutputStreamImp

Local Index

Members

Header File

#include <rw/xmlstreams/RWTTransformOutputStreamImp.h>

Description

The class RWTTransformOutputStreamImp implements a buffered char or byte output stream that includes a transformation. The size of the buffer is specified as a parameter to the static make() function that is used to create it. If the buffer as initialized is not large enough to contain the entire XML document, it grows as needed to be able to do so. It is more efficient, though, to allocate a buffer of sufficient size initially.

RWTTransformOutputStreamImp is a class template that is derived from one of its own template parameters.

The class is defined as

The write() method of this class gets called until the entire output stream has been written to the buffer. Then the flush() method gets called, either directly or when the destructor is called. The flush() method calls the transform() method of the transformation object passed into the constructor. The transform() method reads the output stream flushed from the buffer, applies the transformation defined by the method, and writes the result to the sink stream.

Public Typedefs

typedef OutputStream
RWOutputStream_type;

typedef typename OutputStream::element_type
element_type;

NOTE -- Be aware that characters in the stream are called "elements," which have no connection to XML "elements."

Static Public Member Functions

static OutputStream
make(const OutputStream& sinkStream, Transform transform);
static OutputStream
make(const OutputStream& sinkStream, Transform transform,
     RWSize bufSize);
static OutputStream
make(const OutputStream& sinkStream, Transform transform,
     element_type* buffer, RWSize bufSize);

Public Destructor

virtual
~RWTTransformOutputStreamImp();

Public Member Functions

virtual void
write(element_type value);
virtual void
write(const element_type* array, RWSize numElements);
virtual void
close();
virtual void
flush();

Protected Constructors

RWTTransformOutputStreamImp(const OutputStream& sinkStream,
  Transform transform);
RWTTransformOutputStreamImp(const OutputStream& sinkStream,
                         Transform transform, RWSize bufSize);
RWTTransformOutputStreamImp(const OutputStream& sinkStream, 
  Transform transform, element_type* buffer, RWSize bufSize);

Protected Member Functions

element_type*
epptr() const;
void
freeBuffer();
element_type*
pbase() const;
void
pbump(RWSize n);
element_type*
pptr() const;
void
setBuffer(RWSize bufsize);
void
setp(element_type* pbeg_arg, element_type* pend_arg);
virtual void
transform();


Previous fileTop of DocumentContentsIndex pageNext file

© Copyright Rogue Wave Software, Inc. All Rights Reserved.
Rogue Wave and SourcePro are registered trademarks of Rogue Wave Software, Inc. in the United States and other countries. All other trademarks are the property of their respective owners.
Contact Rogue Wave about documentation or support issues.