18#ifndef _LOG4CXX_HELPERS_CHARSETENCODER_H
19#define _LOG4CXX_HELPERS_CHARSETENCODER_H
82 static void encode(CharsetEncoderPtr& enc,
84 LogString::const_iterator& iter,
97 LogString::const_iterator& iter,
A byte buffer.
Definition: bytebuffer.h:34
An engine to transform LogStrings into bytes for the specific character set.
Definition: charsetencoder.h:38
virtual void reset()
Resets any internal state.
CharsetEncoder()
Protected constructor.
virtual ~CharsetEncoder()
Destructor.
virtual log4cxx_status_t encode(const LogString &in, LogString::const_iterator &iter, ByteBuffer &out)=0
Encodes as many characters from the input string as possible to the output buffer.
static CharsetEncoderPtr getUTF8Encoder()
Get encoder for UTF-8.
virtual void flush(ByteBuffer &out)
Flushes the encoder.
static bool isError(log4cxx_status_t stat)
Determines if the return value from encode indicates an unconvertable character.
Definition: charsetencoder.h:114
static void encode(CharsetEncoderPtr &enc, const LogString &src, LogString::const_iterator &iter, ByteBuffer &dst)
Encodes a string replacing unmappable characters with escape sequences.
static CharsetEncoderPtr getEncoder(const LogString &charset)
Get encoder for specified character set.
static CharsetEncoderPtr getDefaultEncoder()
Get encoder for default charset.
static bool isTriviallyCopyable(const LogString &src, const CharsetEncoderPtr &enc)
Is the data of src unchanged by enc.
base class for java-like objects.
Definition: object.h:106
#define LOG4CXX_EXPORT
Definition: log4cxx.h:101
#define LOG4CXX_PTR_DEF(T)
Definition: log4cxx.h:64
#define LOG4CXX_NS
Definition: log4cxx.h:104
std::basic_string< logchar > LogString
Definition: logstring.h:60
int log4cxx_status_t
Definition: log4cxx.h:113
#define LOG4CXX_CAST_ENTRY(Interface)
Definition: object.h:158
#define DECLARE_ABSTRACT_LOG4CXX_OBJECT(object)
Definition: object.h:39
#define END_LOG4CXX_CAST_MAP()
Definition: object.h:152
#define BEGIN_LOG4CXX_CAST_MAP()
Definition: object.h:146