Sourceforge.net - The VCF's Project Host
   The VCF Website Home   |   Online Discussion Forums   |   Sourceforge.net Project Page   

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)=0
 converts a unicode string to an ansi string.
virtual UnicodeString::AnsiChar convertToAnsiChar (const UnicodeString::UniChar &c)=0
 Transforms a single Unicode character to an ansi character.
virtual UnicodeString convertToUnicodeString (const UnicodeString &str)=0
 Convert one unicode string into the code page type of this codec.
virtual UnicodeString convertToUnicodeString (const UnicodeString::AnsiChar *str, UnicodeString::size_type stringLength)=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 TextCodecgetCodec (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

virtual UnicodeString::AnsiChar VCF::TextCodec::convertToAnsiChar const UnicodeString::UniChar c  )  [pure virtual]
 

Transforms a single Unicode character to an ansi character.

virtual uint32 VCF::TextCodec::convertToAnsiString const UnicodeString str,
UnicodeString::AnsiChar ansiStrBuffer,
const uint32 ansiStrBufferLength
[pure virtual]
 

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.

virtual UnicodeString VCF::TextCodec::convertToUnicodeString const UnicodeString::AnsiChar str,
UnicodeString::size_type  stringLength
[pure virtual]
 

Converts an ansi string to a unicode string.

virtual UnicodeString VCF::TextCodec::convertToUnicodeString const UnicodeString str  )  [pure virtual]
 

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:
UnicodeString the name of the code to find
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

std::map<String,TextCodec*> VCF::TextCodec::registeredCodecsMap [static, protected]
 


The documentation for this class was generated from the following file:
   Comments or Suggestions?    License Information