Apache Log4cxx  Version 1.6.0
Loading...
Searching...
No Matches
log4cxx::helpers::CharsetDecoder Class Referenceabstract

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

#include <charsetdecoder.h>

Inheritance diagram for log4cxx::helpers::CharsetDecoder:
log4cxx::helpers::Object

Public Member Functions

virtual ~CharsetDecoder ()
 Destructor.
virtual log4cxx_status_t decode (ByteBuffer &in, LogString &out)=0
 Decodes as many bytes as possible from in, appending the result onto out.
log4cxx_status_t decode (const char *in, size_t maxByteCount, LogString &out)
 Decodes up to maxByteCount bytes from in, appending the result onto out.
Public Member Functions inherited from log4cxx::helpers::Object
virtual ~Object ()
virtual const helpers::ClassgetClass () const =0
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.
static CharsetDecoderPtr getDecoder (const LogString &charset)
 Get decoder for specified character set.
static CharsetDecoderPtr getUTF8Decoder ()
 Get decoder for UTF-8.
static CharsetDecoderPtr getISOLatinDecoder ()
 Get decoder for ISO-8859-1.
static bool isError (log4cxx_status_t stat)
 Determins if status value indicates an invalid byte sequence.

Protected Member Functions

 CharsetDecoder ()
 Protected constructor.

Detailed Description

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

Constructor & Destructor Documentation

◆ CharsetDecoder()

log4cxx::helpers::CharsetDecoder::CharsetDecoder ( )
protected

Protected constructor.

◆ ~CharsetDecoder()

virtual log4cxx::helpers::CharsetDecoder::~CharsetDecoder ( )
virtual

Destructor.

Member Function Documentation

◆ decode() [1/2]

virtual log4cxx_status_t log4cxx::helpers::CharsetDecoder::decode ( ByteBuffer & in,
LogString & out )
pure virtual

Decodes as many bytes as possible from in, appending the result onto out.

Parameters
ina null terminated string.
outthe string onto which characters are appended.
Returns
APR_SUCCESS if not encoding errors were found.

◆ decode() [2/2]

log4cxx_status_t log4cxx::helpers::CharsetDecoder::decode ( const char * in,
size_t maxByteCount,
LogString & out )

Decodes up to maxByteCount bytes from in, appending the result onto out.

Parameters
ina null terminated string.
maxByteCountthe limit on the size of in.
outthe string onto which characters are appended.
Returns
APR_SUCCESS if not encoding errors were found.

◆ getDecoder()

CharsetDecoderPtr log4cxx::helpers::CharsetDecoder::getDecoder ( const LogString & charset)
static

Get decoder for specified character set.

Parameters
charsetthe following values should be recognized: "US-ASCII", "ISO-8859-1", "UTF-8", "UTF-16BE", "UTF-16LE".
Returns
decoder
Exceptions
IllegalArgumentExceptionif charset is not recognized.

◆ getDefaultDecoder()

CharsetDecoderPtr log4cxx::helpers::CharsetDecoder::getDefaultDecoder ( )
static

Get decoder for default charset.

◆ getISOLatinDecoder()

CharsetDecoderPtr log4cxx::helpers::CharsetDecoder::getISOLatinDecoder ( )
static

Get decoder for ISO-8859-1.

◆ getUTF8Decoder()

CharsetDecoderPtr log4cxx::helpers::CharsetDecoder::getUTF8Decoder ( )
static

Get decoder for UTF-8.

◆ isError()

bool log4cxx::helpers::CharsetDecoder::isError ( log4cxx_status_t stat)
inlinestatic

Determins if status value indicates an invalid byte sequence.


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