class Poco::InputStreamConverter

Overview

This stream converts all characters read from the underlying istream from one character encoding into another. Moreā€¦

#include <StreamConverter.h>

class InputStreamConverter:
    public Poco::StreamConverterIOS,
    public istream
{
public:
    // construction

    InputStreamConverter(
        std::istream& istr,
        const TextEncoding& inEncoding,
        const TextEncoding& outEncoding,
        int defaultChar = '?'
        );
};

Inherited Members

public:
    // methods

    StreamConverterBuf*
    rdbuf();

    int
    errors() const;

protected:
    // fields

    StreamConverterBuf _buf;

Detailed Documentation

This stream converts all characters read from the underlying istream from one character encoding into another.

If a character cannot be represented in outEncoding, defaultChar is used instead. If a byte sequence read from the underlying stream is not valid in inEncoding, defaultChar is used instead and the encoding error count is incremented.

Construction

InputStreamConverter(
    std::istream& istr,
    const TextEncoding& inEncoding,
    const TextEncoding& outEncoding,
    int defaultChar = '?'
    )

Creates the InputStreamConverter and connects it to the given input stream.