zorba::transcode

Functions

bool

attach(std::basic_ios< charT, Traits > &ios, char const *charset)

Attaches a transcode::streambuf to a stream.

bool

detach(std::basic_ios< charT, Traits > &ios)

Detaches a previously attached transcode::streambuf from a stream.

bool

is_attached(std::basic_ios< charT, Traits > &ios)

Checks whether the given stream has a transcode::streambuf attached.

ZORBA_DLL_PUBLIC bool

is_necessary(char const *charset)

Checks whether it would be necessary to transcode from the given character encoding to UTF-8.

ZORBA_DLL_PUBLIC bool

is_supported(char const *charset)

Checks whether the given character set is supported for transcoding.

std::streambuf *

orig_streambuf(std::basic_ios< charT, Traits > &ios)

Gets the original streambuf of the given iostream.

Functions

attach

bool attach(std::basic_ios< charT, Traits > &ios, char const *charset)

Attaches a transcode::streambuf to a stream.

Unlike using a transcode::streambuf directly, this function will create the streambuf, attach it to the stream, and manage it for the lifetime of the stream automatically.

Parameters

ios The stream to attach the transcode::streambuf to. If the stream already has a transcode::streambuf attached to it, this function does nothing.
charset The name of the character encoding to convert from/to.

Returns

true only if a transcode::streambuf was attached.

detach

bool detach(std::basic_ios< charT, Traits > &ios)

Detaches a previously attached transcode::streambuf from a stream.

The streambuf is destroyed and the stream's original streambuf is restored.

Parameters

ios The stream to detach the transcode::streambuf from. If the stream doesn't have a transcode::streambuf attached to it, this function does nothing.

Returns

true only if a transcode::streambuf was detached.

is_attached

bool is_attached(std::basic_ios< charT, Traits > &ios)

Checks whether the given stream has a transcode::streambuf attached.

Parameters

ios The stream to check.

Returns

true only if a transcode::streambuf is attached.

is_necessary

ZORBA_DLL_PUBLIC bool is_necessary(char const *charset)

Checks whether it would be necessary to transcode from the given character encoding to UTF-8.

Parameters

charset The name of the character encoding to check.

Returns

true only if it would be necessary to transcode from the given character encoding to UTF-8.

is_supported

ZORBA_DLL_PUBLIC bool is_supported(char const *charset)

Checks whether the given character set is supported for transcoding.

Parameters

charset The name of the character encoding to check.

Returns

true only if the character encoding is supported.

orig_streambuf

std::streambuf * orig_streambuf(std::basic_ios< charT, Traits > &ios)

Gets the original streambuf of the given iostream.

Parameters

ios The stream to get the original streambuf of.

Returns

the original streambuf.