rwlogo
SourcePro C++ 12.0

SourcePro® C++ API Reference Guide



   SourcePro C++
Documentation Home

RWTParsedTransformObjectOutputStreamImp< Transform > Class Template Reference
[XML Streams]

Constructs an XML stream that includes a generic transformation of the XML document before writing it out to the sink. More...

#include <rw/xmlstreams/RWTParsedTransformObjectOutputStreamImp.h>

Inheritance diagram for RWTParsedTransformObjectOutputStreamImp< Transform >:
RWXmlObjectOutputStreamImp RWObjectOutputStreamImp RWXmlObjectStreamCommon RWFilteredDataOutputStreamImp RWDataOutputStreamImp RWOutputStreamImp RWStreamImp RWBodyBase RWTCountingBody< RWMutexLock > RWTMonitor< RWMutexLock >

List of all members.

Static Public Member Functions

static RWObjectOutputStream make (std::ostream &sink, Transform transform, const RWCString &rootElementType=nestedObjectTag, bool escape=true)
static RWObjectOutputStream make (std::ostream &sink, Transform transform, std::ios *&formatter, const RWCString &rootElementType=nestedObjectTag, bool escape=true)

Protected Member Functions

 RWTParsedTransformObjectOutputStreamImp (std::ostream &ostr, Transform transform, const RWCString &rootElementType, bool escape)
 RWTParsedTransformObjectOutputStreamImp (std::ostream &ostr, Transform transform, std::ios *&formatter, const RWCString &rootElementType, bool escape)

Detailed Description

template<class Transform>
class RWTParsedTransformObjectOutputStreamImp< Transform >

This class uses RWXmlObjectOutputStreamImp and RWTParsedTransformOutputStreamImp to construct an XML stream that includes a generic transformation of the XML document before writing it out to the sink.

Examples

 // Create a strstream to serve as our sink
 ostrstream s;
 
 // Create a transformation object
 MyTransform t;
 
 // Create an XML data stream that uses the strstream
 RWObjectOutputStream out =
 RWTParsedTransformObjectOutputStreamImp\<MyTransform\>::make(s,t);
 
 // Write integer value `1' to XML data stream
 out << 1;

Constructor & Destructor Documentation

template<class Transform >
RWTParsedTransformObjectOutputStreamImp< Transform >::RWTParsedTransformObjectOutputStreamImp ( std::ostream &  ostr,
Transform  transform,
const RWCString rootElementType,
bool  escape 
) [inline, protected]

Used by the make() function and potentially by derived classes to initialize an output stream and to insert a transformation of the serialized object data based on the transformation object transform.

The parameter ostr is a handle to the initialized stream.

The parameter transform is a transformation object.

The parameter rootElementType must be one of the following:

The value passed indicates the root element of the generated document. The default setting is nestedObjectTag.

The parameter escape sets whether primitive values will be escaped. The default is set to true.

Throws no exceptions.

template<class Transform >
RWTParsedTransformObjectOutputStreamImp< Transform >::RWTParsedTransformObjectOutputStreamImp ( std::ostream &  ostr,
Transform  transform,
std::ios *&  formatter,
const RWCString rootElementType,
bool  escape 
) [inline, protected]

Used by the make() function and potentially by derived classes to initialize an output stream and to insert a transformation of the serialized object data based on the transformation object transform.

The parameter ostr is a handle to the initialized stream.

The parameter transform is a transformation object.

The parameter rootElementType must be one of the following:

The value passed indicates the root element of the generated document. The default setting is nestedObjectTag.

The parameter escape sets whether primitive values will be escaped. The default is set to true.

Throws no exceptions.

This constructor also takes a pointer reference to an std::ios formatting object.

An empty formatting object pointer is created before the XML stream is created and is passed to this constructor through the make() function. This constructor, in creating the underlying element stream for the XML stream, creates a formatting object for the stream and places the address of that object in the pointer reference. The calling application can then use this formatting object to manipulate data formats in the XML stream. See the corresponding make() function description for an example.


Member Function Documentation

template<class Transform >
static RWObjectOutputStream RWTParsedTransformObjectOutputStreamImp< Transform >::make ( std::ostream &  sink,
Transform  transform,
std::ios *&  formatter,
const RWCString rootElementType = nestedObjectTag,
bool  escape = true 
) [inline, static]

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

The parameter transform is a transformation object

The parameter rootElementType must be one of the following:

The value passed indicates the root element of the generated document. The default setting is nestedObjectTag.

The parameter escape sets whether primitive values will be escaped. The default is set to true.

Throws no exceptions.

This function also takes a pointer reference to an std::ios formatting object. An empty formatting object pointer is created before the XML stream is created and is passed through this make() function to the constructor:

 std::ios* formatter;            // uninitialized pointer
 RWObjectOutputStream xostr =
 RWTParsedTransformObjectOutputStreamImp<MyTransform>

The constructor, in creating the underlying character stream for the XML stream, creates a formatting object for the stream and places the address of that object in the pointer reference. The calling application can then use this formatting object to manipulate data formats in the XML stream.

formatter->precision(15); // manipulate data format

template<class Transform >
static RWObjectOutputStream RWTParsedTransformObjectOutputStreamImp< Transform >::make ( std::ostream &  sink,
Transform  transform,
const RWCString rootElementType = nestedObjectTag,
bool  escape = true 
) [inline, static]

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

The parameter transform is a transformation object

The parameter rootElementType must be one of the following:

The value passed indicates the root element of the generated document. The default setting is nestedObjectTag.

The parameter escape sets whether primitive values will be escaped. The default is set to true.

Throws no exceptions.

 All Classes Functions Variables Typedefs Enumerations Enumerator Friends

© 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.