Regina 7.3 Calculation Engine
Public Member Functions | List of all members
regina::i18n::IConvStream Class Reference

An output stream that converts between character encodings. More...

#include <utilities/i18nutils.h>

Inheritance diagram for regina::i18n::IConvStream:

Public Member Functions

 IConvStream (std::ostream &dest, const char *srcCode, const char *destCode)
 Creates a new IConvStream; see the class notes for details. More...
 
 IConvStream (const IConvStream &)=delete
 
IConvStreamoperator= (const IConvStream &)=delete
 

Detailed Description

An output stream that converts between character encodings.

The iconv library does all the work behind the scenes.

An IConvStream acts as a wrapper around some other destination output stream (for instance, std::cout). To use an IConvStream:

This class will still work if iconv is not supported on the build machine, though in this case it will simply pass data straight through to the destination output stream without any conversion.

Python
Not present.
Author
Parts of this code are modified from the cxxtools library (http://www.tntnet.org/cxxutils.html), which is copyright (c) 2003 by Tommi Maekitalo, and covered by the GNU Lesser General Public License.

Constructor & Destructor Documentation

◆ IConvStream()

regina::i18n::IConvStream::IConvStream ( std::ostream &  dest,
const char *  srcCode,
const char *  destCode 
)
inline

Creates a new IConvStream; see the class notes for details.

If the given encodings are invalid, this stream will still forward data to the given output stream but no conversion will take place.

See the iconv documentation for information on what encodings are supported. For the GNU C library implementation, valid encodings can be found by running iconv --list.

Precondition
The destination output stream is already open.
Parameters
destthe destination output stream.
srcCodethe character encoding for data that is to be written into this IConvStream.
destCodethe character encoding for the translated data that will subsequently be written to the destination output stream.

The documentation for this class was generated from the following file:

Copyright © 1999-2023, The Regina development team
This software is released under the GNU General Public License, with some additional permissions; see the source code for details.
For further information, or to submit a bug or other problem, please contact Ben Burton (bab@maths.uq.edu.au).