class Poco::OutputStreamConverter

Overview

This stream converts all characters written to the underlying ostream from one character encoding into another. Moreā€¦

#include <StreamConverter.h>

class OutputStreamConverter:
    public Poco::StreamConverterIOS,
    public ostream
{
public:
    // construction

    OutputStreamConverter(
        std::ostream& ostr,
        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 written to the underlying ostream from one character encoding into another.

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

Construction

OutputStreamConverter(
    std::ostream& ostr,
    const TextEncoding& inEncoding,
    const TextEncoding& outEncoding,
    int defaultChar = '?'
    )

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