2005/5/9

     
 

class Encoding

artefaktur
Modules   Namespace List   Class Hierarchy   Alphabetical List   Compound List   Namespace Members   Compound Members   Related Pages  

acdk::locale::Encoding Class Reference

#include <Encoding.h>

Inheritance diagram for acdk::locale::Encoding:

acdk::lang::Object acdk::lang::ObjectBase acdk::lang::dmi::StdDispatch acdk::locale::AsciiEncoding acdk::locale::AsciiUtfEncoding acdk::locale::ByteAsciiEncoding acdk::locale::CEscapeEncoding acdk::locale::IsoEncoding acdk::locale::UCS2Encoding acdk::locale::UTF8Encoding acdk::net::URLEncoding List of all members.

Detailed Description

Class to encode/decode strings.


Public Member Functions

virtual REncoder getEncoder (CodingErrorAction onMalformed=ReportCodingError, CodingErrorAction onUnmappable=ReplaceCodingError)=0
virtual RDecoder getDecoder (CodingErrorAction onMalformed=ReportCodingError, CodingErrorAction onUnmappable=ReplaceCodingError)=0
RString getName ()
 name of this encoding

virtual float averageBytesPerChar ()=0
 return the average bytes used to encode one character

virtual float maxBytesPerChar ()=0
 return the maximum count of bytes use to encode one character


Static Public Member Functions

REncoding getEncoding () throw ( RIllegalCharsetNameException )
 return the standard encoding This will use the system property user.encoding to determine the encoding.

void setEncoding (IN(REncoding) encoding)
 set the standard encoding

REncoding getEncoding (IN(RString) name) throw ( RIllegalCharsetNameException )
 retrive encoding by name

REncoding findEncoding (IN(RString) name)
 same as getEncoding, but does not throw an exception if encoding was not found

REncoding getCEscapeEncoding ()
 see CEscapeEncoding

REncoding getAsciiEncoding ()
 see AsciiEncoding

REncoding getUnicodeEscapeEncoding ()
 see AsciiUtfEncoding::getAsciiUtfEncoding

REncoding getUnicodeCEscapeEncoding ()
 see AsciiUtfEncoding::getAsciiUtfCEscapeEncoding()

RStringArray getAvailableEncodings ()
 returns all available encodings

void registerEncoding (IN(RString) name, EncodingCreator creator)
 register known Encodings


Protected Member Functions

 Encoding (IN(RString) name)

Protected Attributes

RString _name


Constructor & Destructor Documentation

acdk::locale::Encoding::Encoding IN(RString name  )  [inline, protected]
 


Member Function Documentation

virtual float acdk::locale::Encoding::averageBytesPerChar  )  [pure virtual]
 

return the average bytes used to encode one character

Implemented in acdk::locale::AsciiEncoding, acdk::locale::AsciiUtfEncoding, acdk::locale::ByteAsciiEncoding, acdk::locale::CEscapeEncoding, acdk::locale::IsoEncoding, acdk::locale::UCS2Encoding, acdk::locale::UTF8Encoding, and acdk::net::URLEncoding.

REncoding acdk::locale::Encoding::findEncoding IN(RString name  )  [static]
 

same as getEncoding, but does not throw an exception if encoding was not found

REncoding acdk::locale::Encoding::getAsciiEncoding  )  [static]
 

see AsciiEncoding

Reimplemented in acdk::locale::AsciiEncoding.

RStringArray acdk::locale::Encoding::getAvailableEncodings  )  [static]
 

returns all available encodings

Reimplemented in acdk::locale::IsoEncoding.

REncoding acdk::locale::Encoding::getCEscapeEncoding  )  [static]
 

see CEscapeEncoding

virtual RDecoder acdk::locale::Encoding::getDecoder CodingErrorAction  onMalformed = ReportCodingError,
CodingErrorAction  onUnmappable = ReplaceCodingError
[pure virtual]
 

Implemented in acdk::locale::AsciiEncoding, acdk::locale::AsciiUtfEncoding, acdk::locale::ByteAsciiEncoding, acdk::locale::CEscapeEncoding, acdk::locale::IsoEncoding, acdk::locale::UCS2Encoding, acdk::locale::UTF8Encoding, and acdk::net::URLEncoding.

virtual REncoder acdk::locale::Encoding::getEncoder CodingErrorAction  onMalformed = ReportCodingError,
CodingErrorAction  onUnmappable = ReplaceCodingError
[pure virtual]
 

Implemented in acdk::locale::AsciiEncoding, acdk::locale::AsciiUtfEncoding, acdk::locale::ByteAsciiEncoding, acdk::locale::CEscapeEncoding, acdk::locale::IsoEncoding, acdk::locale::UCS2Encoding, acdk::locale::UTF8Encoding, and acdk::net::URLEncoding.

REncoding acdk::locale::Encoding::getEncoding IN(RString name  )  throw ( RIllegalCharsetNameException ) [static]
 

retrive encoding by name

REncoding acdk::locale::Encoding::getEncoding  )  throw ( RIllegalCharsetNameException ) [static]
 

return the standard encoding This will use the system property user.encoding to determine the encoding.

if this is not set returns ASCII

Exceptions:
IllegalCharsetNameException if user.encoding contains unknown encoding

RString acdk::locale::Encoding::getName  )  [inline, virtual]
 

name of this encoding

Reimplemented from acdk::lang::Object.

REncoding acdk::locale::Encoding::getUnicodeCEscapeEncoding  )  [static]
 

see AsciiUtfEncoding::getAsciiUtfCEscapeEncoding()

REncoding acdk::locale::Encoding::getUnicodeEscapeEncoding  )  [static]
 

see AsciiUtfEncoding::getAsciiUtfEncoding

virtual float acdk::locale::Encoding::maxBytesPerChar  )  [pure virtual]
 

return the maximum count of bytes use to encode one character

Implemented in acdk::locale::AsciiEncoding, acdk::locale::AsciiUtfEncoding, acdk::locale::ByteAsciiEncoding, acdk::locale::CEscapeEncoding, acdk::locale::IsoEncoding, acdk::locale::UCS2Encoding, acdk::locale::UTF8Encoding, and acdk::net::URLEncoding.

void acdk::locale::Encoding::registerEncoding IN(RString name,
EncodingCreator  creator
[static]
 

register known Encodings

void acdk::locale::Encoding::setEncoding IN(REncoding encoding  )  [static]
 

set the standard encoding


Member Data Documentation

RString acdk::locale::Encoding::_name [protected]