CharsetDecoder Class Referenceabstract

An abstract engine to transform a sequences of bytes in a specific charset into a LogString. More...

Inheritance diagram for CharsetDecoder:

## Public Member Functions

virtual | ~CharsetDecoder ()
| Destructor. More...
virtual log4cxx_status_t | decode (ByteBuffer &in, LogString &out)=0
| Decodes as many bytes as possible from the given input buffer, writing the results to the given output string. More...
Public Member Functions inherited from ObjectImpl
| ObjectImpl ()
virtual | ~ObjectImpl ()
void | addRef () const
void | releaseRef () const
Public Member Functions inherited from Object
virtual const helpers::Class & | getClass () const
virtual | ~Object ()
virtual bool | instanceof (const Class &clazz) const =0
virtual const void * | cast (const Class &clazz) const =0

## Static Public Member Functions

static CharsetDecoderPtr | getDefaultDecoder ()
| Get decoder for default charset. More...
static CharsetDecoderPtr | getDecoder (const LogString &charset)
| Get decoder for specified character set. More...
static CharsetDecoderPtr | getUTF8Decoder ()
| Get decoder for UTF-8. More...
static CharsetDecoderPtr | getISOLatinDecoder ()
| Get decoder for ISO-8859-1. More...
static bool | isError (log4cxx_status_t stat)
| Determins if status value indicates an invalid byte sequence. More...
Static Public Member Functions inherited from Object
static const helpers::Class & | getStaticClass ()
static const log4cxx::helpers::ClassRegistration & | registerClass ()

## Protected Member Functions

| CharsetDecoder ()
| Protected constructor. More...

## Additional Inherited Members

Protected Attributes inherited from ObjectImpl
unsigned int volatile | ref

## Detailed Description

An abstract engine to transform a sequences of bytes in a specific charset into a LogString.

## Constructor & Destructor Documentation

## CharsetDecoder()

CharsetDecoder | ( |  | ) |

protected

Protected constructor.

## ~CharsetDecoder()

virtual ~CharsetDecoder | ( |  | ) |

virtual

Destructor.

## Member Function Documentation

## decode()

virtual log4cxx_status_t decode | ( | ByteBuffer & | in,
|  | LogString & | out
| ) |  |

pure virtual

Decodes as many bytes as possible from the given input buffer, writing the results to the given output string.

Parameters

  in | input buffer.
  out | output string.

Returns
  APR_SUCCESS if not encoding errors were found.

## getDecoder()

static CharsetDecoderPtr getDecoder | ( | const LogString & | charset | ) |

static

Get decoder for specified character set.

Parameters

  charset | the following values should be recognized: "US-ASCII", "ISO-8859-1", "UTF-8", "UTF-16BE", "UTF-16LE".

Returns
  decoder

Exceptions

  IllegalArgumentException | if charset is not recognized.

## getDefaultDecoder()

static CharsetDecoderPtr getDefaultDecoder | ( |  | ) |

static

Get decoder for default charset.

## getISOLatinDecoder()

static CharsetDecoderPtr getISOLatinDecoder | ( |  | ) |

static

Get decoder for ISO-8859-1.

## getUTF8Decoder()

static CharsetDecoderPtr getUTF8Decoder | ( |  | ) |

static

Get decoder for UTF-8.

## isError()

static bool isError | ( | log4cxx_status_t | stat | ) |

inline static

Determins if status value indicates an invalid byte sequence.

The documentation for this class was generated from the following file:

- charsetdecoder.h