rwlogo
SourcePro C++ 12.0

SourcePro® C++ API Reference Guide



   SourcePro C++
Documentation Home

RWTParsedTransformObjectInputStreamImp< Transform > Class Template Reference
[XML Streams]

Constructs an XML input stream that applies a generic transformation to the XML document before reading it from the source. More...

#include <rw/xmlstreams/RWTParsedTransformObjectInputStreamImp.h>

Inheritance diagram for RWTParsedTransformObjectInputStreamImp< Transform >:
RWXmlObjectInputStreamImp RWObjectInputStreamImp RWXmlObjectStreamCommon RWFilteredDataInputStreamImp RWDataInputStreamImp RWInputStreamImp RWStreamImp RWBodyBase RWTCountingBody< RWMutexLock > RWTMonitor< RWMutexLock >

List of all members.

Static Public Member Functions

static RWObjectInputStream make (std::istream &source, Transform transform, bool escape=true)
static RWObjectInputStream make (std::istream &source, Transform transform, std::ios *&formatter, bool escape=true)

Protected Member Functions

 RWTParsedTransformObjectInputStreamImp (std::istream &istr, Transform transform, bool escape)
 RWTParsedTransformObjectInputStreamImp (std::istream &istr, Transform transform, std::ios *&formatter, bool escape)

Detailed Description

template<class Transform>
class RWTParsedTransformObjectInputStreamImp< Transform >

This class uses RWXmlObjectInputStreamImp and RWTParsedTransformInputStreamImp to construct an XML input stream that applies a generic transformation to the XML document before reading it from the source.

Examples

 // Open an fstream to serve as our source
 ifstream s("foo.xml");
 
 // Create a transformation object, which must have a
 // transform(const RWXmlElementImp&,ostream&) interface
 MyTransform t;
 
 // Create an XML data stream that uses the fstream
 RWObjectInputStream in =
  RWTParsedTransformObjectInputStreamImp<MyTransform>::make(s,t);
 
 // Read an integer from XML data stream.
 int i;
 in >> i;

Constructor & Destructor Documentation

template<class Transform >
RWTParsedTransformObjectInputStreamImp< Transform >::RWTParsedTransformObjectInputStreamImp ( std::istream &  istr,
Transform  transform,
bool  escape 
) [inline, protected]

Used by the make() function and potentially by derived classes to initialize the source data stream and to insert into the stream a transformation of the XML document based on the transformation object transform.

The parameter istr is a handle to the initialized stream.

The parameter transform is a transformation object that must supply a public interface function transform(istream&,ostream&).

The parameter escape sets whether primitive element values will be unescaped. By default, this parameter is set to true.

template<class Transform >
RWTParsedTransformObjectInputStreamImp< Transform >::RWTParsedTransformObjectInputStreamImp ( std::istream &  istr,
Transform  transform,
std::ios *&  formatter,
bool  escape 
) [inline, protected]

Used by the make() function and potentially by derived classes to initialize the source data stream and to insert into the stream a transformation of the XML document based on the transformation object transform.

The parameter istr is a handle to the initialized stream.

The parameter transform is a transformation object that must supply a public interface function transform(istream&,ostream&).

The parameter escape sets whether primitive element values will be unescaped. By default, this parameter is set to true.

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 RWObjectInputStream RWTParsedTransformObjectInputStreamImp< Transform >::make ( std::istream &  source,
Transform  transform,
std::ios *&  formatter,
bool  escape = true 
) [inline, static]

Constructs an RWTParsedTransformObjectInputStreamImp instance that uses source as its source of bytes, and returns a handle to it. The XML input stream includes a transformation of the XML document based on the transformation object transform.

The parameter escape sets whether primitive element values will be unescaped. By default, this parameter is set to true.

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 =
 RWTParsedTransformObjectInputStreamImp<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 RWObjectInputStream RWTParsedTransformObjectInputStreamImp< Transform >::make ( std::istream &  source,
Transform  transform,
bool  escape = true 
) [inline, static]

Constructs an RWTParsedTransformObjectInputStreamImp instance that uses source as its source of bytes, and returns a handle to it. The XML input stream includes a transformation of the XML document based on the transformation object transform.

The parameter escape sets whether primitive element values will be unescaped. By default, this parameter is set to true.

 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.