Inherits FilteredInputStreamImp.
template<class InputStream, class FilteredInputStreamImp, class Transform>
class RWTTransformInputStreamImp< InputStream, FilteredInputStreamImp, Transform >
The class RWTTransformInputStreamImp implements a buffered char
or byte
input character 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.
RWTTransformInputStreamImp is a class template that is derived from one of its own template parameters.
The class is defined as
template <class InputStream, class FilteredInputStreamImp,
class Transform>
}
When the read() or readUntil() is first called on this class, the transform() method of the transformation object passed into the constructor gets called. The transform() method reads from the source, applies the transformation defined by the method, and stores the result in the buffer. Once the buffer contains the entire transformed document, the call to read() or readUntil() is completed by reading from the buffer.
template<class InputStream , class FilteredInputStreamImp , class Transform >
Initializes the reference to the input stream used as the source of elements, and the internal buffer, whose capacity is set equal to RW_STREAM_BUFFER_SIZE.
The parameter sourceStream represents the input stream that serves as the source of elements.
The parameter transform represents the transformation object and must provide a public interface of:
transform(basic_istream<
element_type, char_traits<element_type> >&,
template<class InputStream , class FilteredInputStreamImp , class Transform >
Initializes the reference to the input stream used as the source of elements, and the internal buffer, whose capacity is set to bufSize.
The parameter sourceStream represents the input stream that serves as the source of elements.
The parameter transform represents the transformation object and must provide a public interface of:
transform(basic_istream<
element_type, char_traits<element_type> >&,
The parameter bufSize represents the buffer capacity in number of elements.
template<class InputStream , class FilteredInputStreamImp , class Transform >
Initializes the reference to the input stream used as the source of elements, and the internal buffer, which is initialized using a pre-allocated element's array of size bufSize.
The parameter sourceStream represents the input stream that serves as the source of elements.
The parameter transform represents the transformation object and must provide a public interface of:
transform(basic_istream<
element_type, char_traits<element_type> >&,
The parameter buffer represents a pre-allocated buffer of size bufSize to be used internally by the constructed RWTTransformInputStreamImp object.
template<class InputStream , class FilteredInputStreamImp , class Transform >
static InputStream RWTTransformInputStreamImp< InputStream, FilteredInputStreamImp, Transform >::make |
( |
const InputStream & | sourceStream, |
|
|
Transform | transform ) |
|
inlinestatic |
Constructs an RWTTransformInputStreamImp instance that uses sourceStream as its source of elements, and returns a handle to it. The internal buffer is initialized to be of size RW_STREAM_BUFFER_SIZE. The buffer grows as needed to contain the entire XML document.
The parameter sourceStream represents the input stream that serves as the source of elements.
The parameter transform represents the transformation object and must provide a public interface of:
transform(basic_istream<
element_type, char_traits<element_type> >&,
template<class InputStream , class FilteredInputStreamImp , class Transform >
Constructs an RWTTransformInputStreamImp instance that uses sourceStream as its source 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 sourceStream represents the input stream that serves as the source of elements.
The parameter transform represents the transformation object and must provide a public interface of:
transform(basic_istream<
element_type, char_traits<element_type> >&,
The parameter buffer represents a pre-allocated buffer of size bufSize to be used internally by the constructed RWTTransformInputStreamImp object.
template<class InputStream , class FilteredInputStreamImp , class Transform >
static InputStream RWTTransformInputStreamImp< InputStream, FilteredInputStreamImp, Transform >::make |
( |
const InputStream & | sourceStream, |
|
|
Transform | transform, |
|
|
RWSize | bufSize ) |
|
inlinestatic |
Constructs an RWTTransformInputStreamImp instance that uses sourceStream as its source 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 sourceStream represents the input stream that serves as the source of elements.
The parameter transform represents the transformation object and must provide a public interface of:
transform(basic_istream<
element_type, char_traits<element_type> >&,
The parameter bufSize represents the initial buffer capacity in number of elements.
template<class InputStream , class FilteredInputStreamImp , class Transform >
Reads elements until the last element read is equivalent to delim, maxSize elements have been read, or the end of the input sequence is reached. The elements read are stored in array. The function returns the actual number of elements read from the stream.
The parameter array represents a pointer to the beginning of the element array holding the elements extracted from the stream.
The parameter maxSize represents the maximum number of elements to be read.
The parameter delim represents the element value used as the delimiter.