VCF::TextCodec Class Reference
The TextCode class represents a way of transforming an ansi or unicode string into another form of unicode.
More...
#include <vcf/FoundationKit/TextCodec.h>
List of all members.
|
Public Member Functions |
| virtual | ~TextCodec () |
| virtual uint32 | convertToAnsiString (const UnicodeString &str, UnicodeString::AnsiChar *ansiStrBuffer, const uint32 &ansiStrBufferLength, const UnicodeString::LanguageEncoding &encoding)=0 |
| | converts a unicode string to an ansi string.
|
| virtual UnicodeString::AnsiChar | convertToAnsiChar (const UnicodeString::UniChar &c, const UnicodeString::LanguageEncoding &encoding)=0 |
| | Transforms a single Unicode character to an ansi character.
|
| virtual UnicodeString | convertToUnicodeString (const UnicodeString &str, const UnicodeString::LanguageEncoding &encoding)=0 |
| | Convert one unicode string into the code page type of this codec.
|
| virtual UnicodeString | convertToUnicodeString (const UnicodeString::AnsiChar *str, UnicodeString::size_type stringLength, const UnicodeString::LanguageEncoding &encoding)=0 |
| | Converts an ansi string to a unicode string.
|
| virtual String | getName ()=0 |
Static Public Member Functions |
| static void | registerCodec (TextCodec *codec) |
| | This is a static function to be called in order to register a custom implementation of the TextCodec class with the system's collection of codecs.
|
| static TextCodec * | getCodec (const String &codecName) |
| | A static method to retreive a registered codec, by name, from the system's collection of codecs.
|
| static void | internal_freeAllRegisteredCodecs () |
Static Protected Attributes |
| static std::map< String, TextCodec * > | registeredCodecsMap |
Detailed Description
The TextCode class represents a way of transforming an ansi or unicode string into another form of unicode.
It represents the logic required to make this transformation as specified in a code page, i.e. translating an ansi string into UTF16.
Constructor & Destructor Documentation
| virtual VCF::TextCodec::~TextCodec |
( |
|
) |
[inline, virtual] |
|
Member Function Documentation
|
|
Transforms a single Unicode character to an ansi character.
|
|
|
converts a unicode string to an ansi string.
The function will transform ansiStrBufferLength bytes of ansiStrBuffer to an ansii string. Null termination of the buffer passed into this function is not performed. - Parameters:
-
| UnicodeString | the string to convert from |
| UnicodeString::AnsiChar* | the caller allocated buffer to put the newly transformed ansi string data into. If this is NULL, then the ansiStrBufferLength parameter is to be ignored, and the function should return the number of characters that would need to be allocated by the caller to successfully hold all of the ansi string. |
| uint32 | the length of the ansiStrBuffer. The codec will put no more than this number of characters into the ansiStrBuffer. |
- Returns:
- uint32 the number of characters in the ansi string. Will be less than or equal to ansiStrBufferLength.
|
|
|
Converts an ansi string to a unicode string.
|
|
|
Convert one unicode string into the code page type of this codec.
|
| static TextCodec* VCF::TextCodec::getCodec |
( |
const String & |
codecName |
) |
[static] |
|
|
|
A static method to retreive a registered codec, by name, from the system's collection of codecs.
- Parameters:
-
- Returns:
- TextCodec a codec that is associated with the codecName argument, or NULL if no matching codec by that name can be found.
|
| virtual String VCF::TextCodec::getName |
( |
|
) |
[pure virtual] |
|
| static void VCF::TextCodec::internal_freeAllRegisteredCodecs |
( |
|
) |
[static] |
|
| static void VCF::TextCodec::registerCodec |
( |
TextCodec * |
codec |
) |
[static] |
|
|
|
This is a static function to be called in order to register a custom implementation of the TextCodec class with the system's collection of codecs.
The collection of codec's is a map that is keyed by the name of the codec. |
Member Data Documentation
The documentation for this class was generated from the following file: