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

CP_TextEncoder.h File Reference


Defines

#define CP_LockSharedTextEncoder(lock, TextEncoderClass)   CP_MutexLock lock(TextEncoderClass::SharedTextEncoderMutex());
 Lock a shared text encoder.

Enumerations

enum  { kCP_ErrorOnInvalidCharacters = 0x1000, kCP_MapStrictChars = 0x2000, kCP_TextIsLeftToRight = 0x3000, kCP_TextIsRightToLeft = 0x4000 }
enum  {
  kCP_EncodingInvalidId = (long)0xFFFFFFFF, kCP_EncodingMacRoman = 0, kCP_EncodingWindowsLatin1 = 0x0500, kCP_EncodingISOLatin1 = 0x0201,
  kCP_EncodingNextStepLatin = 0x0B01, kCP_EncodingASCII = 0x0600, kCP_EncodingUnicode = 0x0100, kCP_EncodingUTF8 = 0x08000100,
  kCP_EncodingNonLossyASCII = 0x0BFF
}

Define Documentation

#define CP_LockSharedTextEncoder lock,
TextEncoderClass   )     CP_MutexLock lock(TextEncoderClass::SharedTextEncoderMutex());
 

This convenience macro will lock a mutex regulating access to the shared text encoder of the specified class until the end of the current code block.
Example:

	if ( needToConvert )
	{
		CP_LockSharedTextEncoder(lock, CP_UTF8TextEncoder);
		convert(CP_UTF8TextEncoder::SharedTextEncoder());
	}
	
Here, the shared UTF8 text encoder is locked within the if block.

Parameters:
lock The name of the lock variable. Pass a name that's unique within the current code block.
TextEncoderClass The encoder class whose shared encoder object should be mutex-locked.


Enumeration Type Documentation

anonymous enum
 

Flags used in the conversion process

Enumeration values:
kCP_ErrorOnInvalidCharacters  Posts an error when an invalid character is encountered
kCP_MapStrictChars  Maps strct characters.
kCP_TextIsLeftToRight  Text is formatted left to right.
kCP_TextIsRightToLeft  Text if formatted right to left.

anonymous enum
 

Encoding type - defines for all platforms to return the type of encoder that match the defines used for CFStringBuiltInEncodings.

Enumeration values:
kCP_EncodingInvalidId 
kCP_EncodingMacRoman 
kCP_EncodingWindowsLatin1  ANSI codepage 1252
kCP_EncodingISOLatin1  ISO 8859-1
kCP_EncodingNextStepLatin  NextStep encoding
kCP_EncodingASCII  0..127 (in creating CFString, values greater than 0x7F are treated as corresponding Unicode value)
kCP_EncodingUnicode  kTextEncodingUnicodeDefault + kTextEncodingDefaultFormat (aka kUnicode16BitFormat)
kCP_EncodingUTF8  kTextEncodingUnicodeDefault + kUnicodeUTF8Format
kCP_EncodingNonLossyASCII  7bit Unicode variants used by YellowBox & Java


Generated on Tue Sep 20 20:21:29 2005 for CPLAT_MacOS by  doxygen 1.4.0