Main Page | Modules | Namespace List | Class Hierarchy | Class List | Directories | File List | Namespace Members | Class Members | File Members | Related Pages

CP_US_ASCIITextEncoder Class Reference
[TextHandling]

CP_TextEncoder class to provide text encoded in the US ASCII encoding. More...

Inheritance diagram for CP_US_ASCIITextEncoder:

CP_TextEncoder CP_NoCopy List of all members.

Public Member Functions

Constructor / Destructor
 CP_US_ASCIITextEncoder (bool inUseCompositeChars=false)
 Constructor.
virtual ~CP_US_ASCIITextEncoder ()
 Destructor.
Cloning
virtual CP_TextEncoderClone () const
Getters
virtual UInt32 GetEncodingType () const
Converters
virtual UInt32 FromUTF16 (const CPUniChar *inSrcChars, UInt32 inSrcLength, char *inDestChars, UInt32 inDestLength) const

Static Public Member Functions

static const CP_US_ASCIITextEncoderSharedTextEncoder ()
 Accessor for shared text encoder object.
static CP_MutexSharedTextEncoderMutex ()
 Get Mutex for synchronizing access to shared text encoder object.

Protected Attributes

UInt32 fTextFormat
bool fUseCompositeCharacters
UInt32 fConvertToUTF16Flags
UInt32 fConvertFromUTF16Flags
const CPUniCharfEncoding
TextToUnicodeInfo fTextToUnicodeInfo
UnicodeToTextInfo fUnicodeToTextInfo

Detailed Description


Constructor & Destructor Documentation

CP_US_ASCIITextEncoder::CP_US_ASCIITextEncoder bool  inUseCompositeCharacters = false  ) 
 

Constructor.

Parameters:
inuseCompositeChars Flag used to indicate if composite characters are to be used in the conversion.
Exceptions:
none 

CP_US_ASCIITextEncoder::~CP_US_ASCIITextEncoder  )  [virtual]
 


Member Function Documentation

const CP_US_ASCIITextEncoder * CP_US_ASCIITextEncoder::SharedTextEncoder  )  [static]
 

Returns the shared instance of a CP_US_ASCIITextEncoder.

Note:
If you're running multi-threaded, you'll have to lock access to the shared encoder object while using it. Use the mutex provided by CP_US_ASCIITextEncoder::SharedTextEncoderMutex, or lock access using the convenience macro CP_US_ASCIITextEncoder.
Exceptions:
none 
Returns:
const CP_US_ASCIITextEncoder* The shared text encoder instance.
See also:
CP_LockSharedTextEncoder, CP_US_ASCIITextEncoder::SharedTextEncoderMutex

CP_Mutex & CP_US_ASCIITextEncoder::SharedTextEncoderMutex  )  [static]
 

Exceptions:
none 
Returns:
CP_Mutex& Mutex to use for synchronizing usage of shared text encoder object.

CP_TextEncoder * CP_US_ASCIITextEncoder::Clone  )  const [virtual]
 

Returns a new text encoder object of the same type as this object.

Exceptions:
none 
Returns:
CP_TextEncoder * const The new text encoder object.

Implements CP_TextEncoder.

virtual UInt32 CP_US_ASCIITextEncoder::GetEncodingType  )  const [virtual]
 

Reimplemented from CP_TextEncoder.

UInt32 CP_US_ASCIITextEncoder::FromUTF16 const CPUniChar inSrcChars,
UInt32  inSrcLength,
char *  inDestChars,
UInt32  inDestLength
const [virtual]
 

Windows - Converts the passed in string from UTF16 encoding to the encoders type.

Parameters:
inSrcChars The UTF16 string to be converted.
inSrcLength Number of characters in source string to use.
inDestChars char buffer to receive the result.
inDestLength Length of the buffer to place the results in. This is the maximum number of characters that will be copied. If the buffer is to SInt16 for the conversion, some characters will be lost.
Exceptions:
none 
Returns:
UInt32 The length of the converted string.

Reimplemented from CP_TextEncoder.

UInt32 CP_TextEncoder::ToUTF16 const char *  inSrcChars,
UInt32  inSrcLength,
CPUniChar inDestChars,
UInt32  inDestLength
const [virtual, inherited]
 

Converts the passed in string to UTF16 encoding.

Parameters:
inSrcChars The string to be converted.
inSrcLength Number of characters in source string to use.
inDestChars CPUniChar buffer to receive the result.
inDestLength Length of the buffer to place the results in. This is the maximum number of characters that will be copied. If the buffer is to SInt16 for the conversion, some characters will be lost.
Exceptions:
none 
Returns:
UInt32 The length of the converted string.

Reimplemented in CP_MacRomanTextEncoder, and CP_UTF8TextEncoder.

void CP_TextEncoder::SetConvertToUTF16Flags UInt32  inFlags = 0  )  [inherited]
 

Sets up the flags and various data members based on the passed in flags which are used to determine features and how errors are handled in the conversion.

Parameters:
inFlags Flags used to determine how the conversion takes place, and error handling.
Exceptions:
none 
Returns:
void

void CP_TextEncoder::SetConvertFromUTF16Flags UInt32  inFlags = 0  )  [inherited]
 

Sets up the flags and various data members based on the passed in flags which are used to determine features and how errors are handled in the conversion.

Parameters:
inFlags Flags used to determine how the conversion takes place, and error handling.
Exceptions:
none 
Returns:
void

UInt32 CP_TextEncoder::GetDestLength const char *  inSrcChars,
UInt32  inSrcLength
const [virtual, inherited]
 

Returns the approximate length that the converted passed in string will occupy. You can use this before converting the text to get an approximate size of the converted text to know how much memory to allocate for the buffer to hold the converted text. The returned length is only an approximation, as no actual conversion takes place.

Parameters:
inSrcChars Character string containing the characters to be converted.
inSrcLength The number of characters from the source buffer to convert.
Exceptions:
none 
Returns:
UInt32 The approximate length of the conversion.

Reimplemented in CP_MacRomanTextEncoder, and CP_UTF8TextEncoder.

UInt32 CP_TextEncoder::GetDestLength const CPUniChar inSrcChars,
UInt32  inSrcLength
const [virtual, inherited]
 

Returns the approximate length that the converted passed in string will occupy. You can use this before converting the text to get an approximate size of the converted text to know how much memory to allocate for the buffer to hold the converted text. The returned length is only an approximation, as no actual conversion takes place.

Parameters:
inSrcChars CPUniChar * string containing the characters to be converted.
inSrcLength The number of characters from the source buffer to convert.
Exceptions:
none 
Returns:
UInt32 The approximate length of the conversion.

Reimplemented in CP_MacRomanTextEncoder.

const CPUniChar* CP_TextEncoder::GetEncoding  )  const [inherited]
 

Return the name of this encoder as a CPUniChar * string.

bool CP_TextEncoder::HasTextEncodingConverter  )  const [protected, inherited]
 

UnicodeToTexUnicode info structure used on the Mac.

SInt32 CP_TextEncoder::GetTECVersion  )  const [protected, inherited]
 

MacOS - Returns the version of the TextEncoding Converter installed on the MacOS.

Exceptions:
none 
Returns:
SInt32 The Text Encoding Converter installed.


Member Data Documentation

UInt32 CP_TextEncoder::fTextFormat [protected, inherited]
 

bool CP_TextEncoder::fUseCompositeCharacters [protected, inherited]
 

Format of the text.

UInt32 CP_TextEncoder::fConvertToUTF16Flags [protected, inherited]
 

Flag to indicate if we are using composite characters.

UInt32 CP_TextEncoder::fConvertFromUTF16Flags [protected, inherited]
 

Flag used in converting to UTF16.

const CPUniChar* CP_TextEncoder::fEncoding [protected, inherited]
 

Flag used in converting from UTF16.

TextToUnicodeInfo CP_TextEncoder::fTextToUnicodeInfo [mutable, protected, inherited]
 

The encoding being used, expressed as a CPUniChar *string.

UnicodeToTextInfo CP_TextEncoder::fUnicodeToTextInfo [mutable, protected, inherited]
 

TextToUnicode info structure used on the Mac.


The documentation for this class was generated from the following files:
Generated on Sat Sep 17 20:02:24 2005 for CPLAT by  doxygen 1.4.0