SourcePro C++ 12.0 |
SourcePro® C++ API Reference Guide |
SourcePro C++ Documentation Home |
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>
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) |
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.
// 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;
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:
int
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.
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:
int
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.
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:
int
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
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:
int
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.
© 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.