Classes | |
| class | auto_attach |
| A transcode::auto_attach is a class that attaches a transcode::streambuf to a stream and automatically detaches it when the auto_attach object is destroyed. More... | |
| class | stream |
| A transcode::stream is used to wrap a C++ standard I/O stream with a transcode::streambuf so that transcoding and the management of the streambuf happens automatically. More... | |
| class | streambuf |
| A transcode::streambuf is-a std::streambuf for transcoding character encodings from/to UTF-8 on-the-fly. More... | |
Functions | |
| template<typename charT , typename Traits > | |
| void | attach (std::basic_ios< charT, Traits > &ios, char const *charset) |
| Attaches a transcode::streambuf to a stream. More... | |
| template<typename charT , typename Traits > | |
| void | detach (std::basic_ios< charT, Traits > &ios) |
| Detaches a previously attached transcode::streambuf from a stream. More... | |
| template<typename charT , typename Traits > | |
| bool | is_attached (std::basic_ios< charT, Traits > &ios) |
| Checks whether the given stream has a transcode::streambuf attached. More... | |
| 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. More... | |
| ZORBA_DLL_PUBLIC bool | is_supported (char const *charset) |
| Checks whether the given character set is supported for transcoding. More... | |
| template<typename charT , typename Traits > | |
| std::streambuf * | orig_streambuf (std::basic_ios< charT, Traits > &ios) |
| Gets the original streambuf of the given iostream. More... | |
|
inline |
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.
| 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. |
Definition at line 150 of file transcode_stream.h.
References zorba::internal::transcode::alloc_streambuf(), zorba::internal::transcode::get_streambuf_index(), and zorba::internal::stream_callback().
Referenced by zorba::transcode::auto_attach< StreamType >::auto_attach().
|
inline |
Detaches a previously attached transcode::streambuf from a stream.
The streambuf is destroyed and the stream's original streambuf is restored.
| 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. |
Definition at line 171 of file transcode_stream.h.
References zorba::internal::dealloc_streambuf(), and zorba::internal::transcode::get_streambuf_index().
Referenced by zorba::transcode::auto_attach< StreamType >::~auto_attach().
|
inline |
Checks whether the given stream has a transcode::streambuf attached.
| ios | The stream to check. |
true only if a transcode::streambuf is attached. Definition at line 187 of file transcode_stream.h.
References zorba::internal::transcode::get_streambuf_index().
| ZORBA_DLL_PUBLIC bool zorba::transcode::is_necessary | ( | char const * | charset | ) |
Checks whether it would be necessary to transcode from the given character encoding to UTF-8.
| charset | The name of the character encoding to check. |
true only if it would be necessary to transcode from the given character encoding to UTF-8. | ZORBA_DLL_PUBLIC bool zorba::transcode::is_supported | ( | char const * | charset | ) |
Checks whether the given character set is supported for transcoding.
| charset | The name of the character encoding to check. |
true only if the character encoding is supported.
|
inline |
Gets the original streambuf of the given iostream.
| ios | The stream to get the original streambuf of. |
Definition at line 198 of file transcode_stream.h.