SourcePro C++ 12.0 |
SourcePro® C++ API Reference Guide |
SourcePro C++ Documentation Home |
Implements a buffer that can be used with any kind of output stream. More...
#include <rw/xmlstreams/RWTParsedTransformOutputStreamImp.h>
Public Types | |
typedef OutputStream | RWOutputStream_type |
typedef OutputStream::element_type | element_type |
typedef RWCString | string_type |
Public Member Functions | |
virtual | ~RWTParsedTransformOutputStreamImp () |
virtual void | write (element_type value) |
virtual void | write (const element_type *array, RWSize numElements) |
virtual void | close () |
virtual void | flush () |
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) |
Protected Member Functions | |
RWTParsedTransformOutputStreamImp (const OutputStream &sinkStream, Transform transform) | |
RWTParsedTransformOutputStreamImp (const OutputStream &sinkStream, Transform transform, RWSize bufSize) | |
RWTParsedTransformOutputStreamImp (const OutputStream &sinkStream, Transform transform, element_type *buffer, RWSize bufSize) | |
element_type * | pbase () const |
element_type * | pptr () const |
element_type * | epptr () const |
void | setp (element_type *pbeg_arg, element_type *pend_arg) |
void | pbump (RWSize n) |
void | freeBuffer () |
void | setBuffer (RWSize bufsize) |
RWXmlStreamElement * | readNextElement (element_type *ptr, element_type *&next, const RWXmlStreamElement &parent) |
element_type * | readToken (element_type *ptr, string_type &token) |
element_type * | readToClose (element_type *ptr, string_type &token) |
element_type * | readWholeName (element_type *ptr, string_type &token) |
element_type * | readAttribute (element_type *ptr, string_type &token) |
element_type * | readAttributeValue (element_type *ptr, string_type &token) |
element_type * | readAttributes (element_type *ptr, RWXmlStreamElement &element) |
element_type * | readValue (element_type *ptr, RWXmlStreamElement &element) |
The class RWTParsedTransformOutputStreamImp implements a buffer that can be used with any kind of output stream. 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.
RWTParsedTransformOutputStreamImp is a class template that is derived from one of its own template parameters.
The class is defined as
template <class OutputStream, class FilteredOutputStreamImp, class Transform, class Traits> class RWTParsedTransformOutputStreamImp : public FilteredOutputStreamImp { ...}
typedef OutputStream::element_type RWTParsedTransformOutputStreamImp< OutputStream, FilteredOutputStreamImp, Transform, Traits >::element_type |
A typedef for the type of element to be written to RWOutputStream_type.
typedef OutputStream RWTParsedTransformOutputStreamImp< OutputStream, FilteredOutputStreamImp, Transform, Traits >::RWOutputStream_type |
A typedef for the template parameter OutputStream
which will be used as the sink for elements.
typedef RWCString RWTParsedTransformOutputStreamImp< OutputStream, FilteredOutputStreamImp, Transform, Traits >::string_type |
A typedef for a string of elements.
virtual RWTParsedTransformOutputStreamImp< OutputStream, FilteredOutputStreamImp, Transform, Traits >::~RWTParsedTransformOutputStreamImp | ( | ) | [virtual] |
Virtual destructor. Throws no exceptions.
RWTParsedTransformOutputStreamImp< OutputStream, FilteredOutputStreamImp, Transform, Traits >::RWTParsedTransformOutputStreamImp | ( | const OutputStream & | sinkStream, | |
Transform | transform | |||
) | [protected] |
Initializes the reference to the output stream used as the sink of elements, as well as the internal buffer, whose capacity is set to RW_STREAM_BUFFER_SIZE, defined as 512
bytes.
The parameter sinkStream is the output stream that serves as the sink of elements.
The parameter transform is the transformation object and must provide a public interface of transform(RWXmlStreamElement&).
RWTParsedTransformOutputStreamImp< OutputStream, FilteredOutputStreamImp, Transform, Traits >::RWTParsedTransformOutputStreamImp | ( | const OutputStream & | sinkStream, | |
Transform | transform, | |||
RWSize | bufSize | |||
) | [protected] |
Initializes the reference to the output stream used as the sink of elements, and the internal buffer capacity, which is set to bufSize.
sinkStream is the output stream that serves as the sink of elements.
transform is the transformation object and must provide a public interface of transform(RWXmlStreamElement&).
bufSize the buffer capacity in number of elements
RWTParsedTransformOutputStreamImp< OutputStream, FilteredOutputStreamImp, Transform, Traits >::RWTParsedTransformOutputStreamImp | ( | const OutputStream & | sinkStream, | |
Transform | transform, | |||
element_type * | buffer, | |||
RWSize | bufSize | |||
) | [protected] |
Initializes the reference to the output stream used as the sink of elements, and the internal buffer, which is initialized using a pre-allocated element's array of size bufSize.
The parameter sinkStream is the output stream that serves as the sink of elements.
The parameter transform is the transformation object and must provide a public interface of transform(RWXmlStreamElement&).
The parameter buffer a pre-allocated buffer of size bufSize to be used internally by the constructed RWTParsedTransformOutputStreamImp object
The parameter bufSize is the buffer capacity in number of elements.
virtual void RWTParsedTransformOutputStreamImp< OutputStream, FilteredOutputStreamImp, Transform, Traits >::close | ( | ) | [virtual] |
element_type* RWTParsedTransformOutputStreamImp< OutputStream, FilteredOutputStreamImp, Transform, Traits >::epptr | ( | ) | const [inline, protected] |
Returns a pointer one position past the last element in the output sequence. Throws no exceptions.
virtual void RWTParsedTransformOutputStreamImp< OutputStream, FilteredOutputStreamImp, Transform, Traits >::flush | ( | ) | [virtual] |
Flushes the buffer by forwarding its content to the next processing stream.
void RWTParsedTransformOutputStreamImp< OutputStream, FilteredOutputStreamImp, Transform, Traits >::freeBuffer | ( | ) | [protected] |
Frees the memory allocated to the internal buffer, if necessary. Throws no exceptions.
static OutputStream RWTParsedTransformOutputStreamImp< OutputStream, FilteredOutputStreamImp, Transform, Traits >::make | ( | const OutputStream & | sinkStream, | |
Transform | transform, | |||
element_type * | buffer, | |||
RWSize | bufSize | |||
) | [inline, static] |
Constructs an RWTParsedTransformOutputStreamImp instance that uses sinkStream as its sink of elements, and returns a handle to it. The internal buffer is initialized using a pre-allocated element's array of size bufSize. The buffer grows as needed to contain the entire XML document.
The parameter sinkStream is the output stream that serves as the sink of elements.
The parameter transform is the transformation object and must provide a public interface of transform(RWXmlStreamElement&).
The parameter buffer is a pre-allocated buffer of size bufSize to be used internally by the constructed RWTParsedTransformOutputStreamImp object.
The parameter bufSize is the buffer capacity in number of elements
static OutputStream RWTParsedTransformOutputStreamImp< OutputStream, FilteredOutputStreamImp, Transform, Traits >::make | ( | const OutputStream & | sinkStream, | |
Transform | transform, | |||
RWSize | bufSize | |||
) | [inline, static] |
Constructs an RWTParsedTransformOutputStreamImp instance that uses sinkStream as its sink of elements, and returns a handle to it. The internal buffer is initialized to be of size bufSize. The buffer grows as needed to contain the entire XML document.
The parameter sinkStream is the output stream that serves as the sink of elements.
The parameter transform is the transformation object and must provide a public interface of transform(RWXmlStreamElement&).
The parameter bufSize the buffer capacity in number of elements
static OutputStream RWTParsedTransformOutputStreamImp< OutputStream, FilteredOutputStreamImp, Transform, Traits >::make | ( | const OutputStream & | sinkStream, | |
Transform | transform | |||
) | [inline, static] |
Constructs an RWTParsedTransformOutputStreamImp instance that uses sinkStream as its sink of elements, and returns a handle to it. The internal buffer is initialized to be of size RW_STREAM_BUFFER_SIZE, which is defined as 512
bytes. The buffer grows as needed to contain the entire XML document.
The parameter sinkStream is the output stream that serves as the sink of elements.
The parameter transform is the transformation object and must provide a public interface of transform(RWXmlStreamElement&).
element_type* RWTParsedTransformOutputStreamImp< OutputStream, FilteredOutputStreamImp, Transform, Traits >::pbase | ( | ) | const [inline, protected] |
Returns a pointer to the first element in the buffer. Throws no exceptions.
void RWTParsedTransformOutputStreamImp< OutputStream, FilteredOutputStreamImp, Transform, Traits >::pbump | ( | RWSize | n | ) | [inline, protected] |
Moves the output buffer array pointer n positions forward. The array position now pointed to is the one returned by pptr(). Throws no exceptions.
element_type* RWTParsedTransformOutputStreamImp< OutputStream, FilteredOutputStreamImp, Transform, Traits >::pptr | ( | ) | const [inline, protected] |
Returns a pointer to the current position in the buffer. Throws no exceptions.
element_type* RWTParsedTransformOutputStreamImp< OutputStream, FilteredOutputStreamImp, Transform, Traits >::readAttribute | ( | element_type * | ptr, | |
string_type & | token | |||
) | [protected] |
Reads the entire attribute (name and value). The parameter ptr points to the current read position. The parameter token contains the attribute string, or RWCString() if no attribute is available. Returns the subsequent read position.
element_type* RWTParsedTransformOutputStreamImp< OutputStream, FilteredOutputStreamImp, Transform, Traits >::readAttributes | ( | element_type * | ptr, | |
RWXmlStreamElement & | element | |||
) | [protected] |
Reads all the attributes in an element. The parameter ptr points to the current read position. The parameter element will have the attributes added to it. Returns the subsequent read position.
element_type* RWTParsedTransformOutputStreamImp< OutputStream, FilteredOutputStreamImp, Transform, Traits >::readAttributeValue | ( | element_type * | ptr, | |
string_type & | token | |||
) | [protected] |
Reads an attribute value. The parameter ptr points to the current read position. The parameter token contains the without quotes, or RWCString() if no value is available. Returns the subsequent read position.
RWXmlStreamElement* RWTParsedTransformOutputStreamImp< OutputStream, FilteredOutputStreamImp, Transform, Traits >::readNextElement | ( | element_type * | ptr, | |
element_type *& | next, | |||
const RWXmlStreamElement & | parent | |||
) | [protected] |
Reads the next XML element. The parameter ptr points to the current read position. The parameter next contains the subsequent read position. The parameter parent holds the current element (the parent of the one to read). Returns the parsed element.
element_type* RWTParsedTransformOutputStreamImp< OutputStream, FilteredOutputStreamImp, Transform, Traits >::readToClose | ( | element_type * | ptr, | |
string_type & | token | |||
) | [protected] |
Reads past the closing tag of the current element. The parameter ptr points to the current read position. The parameter token contains any data read before the closing tag. Returns the subsequent read position.
element_type* RWTParsedTransformOutputStreamImp< OutputStream, FilteredOutputStreamImp, Transform, Traits >::readToken | ( | element_type * | ptr, | |
string_type & | token | |||
) | [protected] |
Reads a token. The parameter ptr points to the current read position. The parameter token is returned with the token. Returns the subsequent read position.
element_type* RWTParsedTransformOutputStreamImp< OutputStream, FilteredOutputStreamImp, Transform, Traits >::readValue | ( | element_type * | ptr, | |
RWXmlStreamElement & | element | |||
) | [protected] |
Reads all values in an element. The parameter ptr points to the current read position. The parameter element will have the value added to it, including the nested elements. Returns the subsequent read position.
element_type* RWTParsedTransformOutputStreamImp< OutputStream, FilteredOutputStreamImp, Transform, Traits >::readWholeName | ( | element_type * | ptr, | |
string_type & | token | |||
) | [protected] |
Reads everything to the next >
character. The parameter ptr points to the current read position. The parameter token contains any data read before the >
character. Returns the subsequent read position.
void RWTParsedTransformOutputStreamImp< OutputStream, FilteredOutputStreamImp, Transform, Traits >::setBuffer | ( | RWSize | bufsize | ) | [protected] |
Sets the buffer size to bufsize elements.
void RWTParsedTransformOutputStreamImp< OutputStream, FilteredOutputStreamImp, Transform, Traits >::setp | ( | element_type * | pbeg_arg, | |
element_type * | pend_arg | |||
) | [inline, protected] |
Sets the buffer's pointers. Assigns the first parameter value to pbeg_
and pnext_
, and the second parameter value to pend_
. These data members represent the beginning of the buffer array, the current position in the array, and the end of the array.
virtual void RWTParsedTransformOutputStreamImp< OutputStream, FilteredOutputStreamImp, Transform, Traits >::write | ( | const element_type * | array, | |
RWSize | numElements | |||
) | [virtual] |
Writes a character array of size numElements to the stream. The parameter array is a pointer to the first element in the array.
virtual void RWTParsedTransformOutputStreamImp< OutputStream, FilteredOutputStreamImp, Transform, Traits >::write | ( | element_type | value | ) | [virtual] |
Writes a single element to the stream. The parameter value is the element to be written to the stream.
© 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.