Specifies the default character encoding scheme for conversions between narrow character strings and UTF-16 strings. More...
#include <rw/i18n/RWUConversionContext.h>
Public Member Functions | |
RWUConversionContext (const char *encoding=RWUConverterBase::getDefaultEncodingName()) | |
~RWUConversionContext () | |
Public Member Functions inherited from RWUToUnicodeConversionContext | |
RWUToUnicodeConversionContext (const char *encoding=RWUConverterBase::getDefaultEncodingName()) | |
~RWUToUnicodeConversionContext () | |
RWUToUnicodeConverter & | getConverter () |
Public Member Functions inherited from RWUFromUnicodeConversionContext | |
RWUFromUnicodeConversionContext (const char *encoding=RWUConverterBase::getDefaultEncodingName()) | |
~RWUFromUnicodeConversionContext () | |
RWUFromUnicodeConverter & | getConverter () |
Additional Inherited Members | |
Static Public Member Functions inherited from RWUToUnicodeConversionContext | |
static RWUToUnicodeConversionContext & | getContext () |
Static Public Member Functions inherited from RWUFromUnicodeConversionContext | |
static RWUFromUnicodeConversionContext & | getContext () |
RWUConversionContext specifies the default character encoding scheme to use for subsequent implicit conversions between narrow character strings and UTF-16 encoded Unicode strings.
RWUConversionContext combines the functionality provided by the RWUToUnicodeConversionContext and RWUFromUnicodeConversionContext to provide a single convenient means for specifying the encoding for conversions to and from Unicode.
RWUConversionContext uses the resource acquisition is initialization idiom to manage two internal, per-thread stacks of RWUFromUnicodeConversionContext instances and RWUToUnicodeConversionContext.
Program output:
|
inline |
Constructs an RWUConversionContext for the specified encoding. The conversion context specifies the default implicit conversion to use when automatically converting a sequence of bytes into an RWUString, an RWUString into a sequence of bytes, or both. The encoding name is encoded in US-ASCII, and must specify one of the names or aliases currently recognized by the Internationalization Module (see RWUAvailableEncodingList and RWUEncodingAliasList).
The specified conversion context remains in effect until another conversion of the same direction is specified, or until the conversion context instance goes out of scope and is destroyed.
RWUException | Thrown to indicate that a converter could not be constructed for the specified encoding. The exception carries one of the following status codes: |
|
inline |
Destructor. Destroys self and restores the conversion context that was in effect prior to the construction of this instance.
Copyright © 2021 Rogue Wave Software, Inc., a Perforce company. All Rights Reserved. |