18#ifndef _LOG4CXX_HELPERS_CHARSETENCODER_H
19#define _LOG4CXX_HELPERS_CHARSETENCODER_H
85 static void encode(CharsetEncoderPtr& enc,
87 LogString::const_iterator& iter,
97 LogString::const_iterator& iter,
115 inline static bool isError(log4cxx_status_t stat)
An area of memory and a cursor into that memory.
Definition bytebuffer.h:42
An abstract base for classes that transform LogString codepoints to the byte sequence representation ...
Definition charsetencoder.h:38
virtual void reset()
Resets any internal state.
CharsetEncoder()
Protected constructor.
virtual ~CharsetEncoder()
Destructor.
static size_t putUTF16LECodePoint(unsigned int ch, char *dst)
Add UTF-16 little-endian bytes to dst corresponding to ch.
virtual log4cxx_status_t encode(const LogString &in, LogString::const_iterator &iter, ByteBuffer &out)=0
Encode into out codepoints of in until out is full or an invalid value is encountered.
static CharsetEncoderPtr getUTF8Encoder()
Get encoder for UTF-8.
static bool isError(log4cxx_status_t stat)
Determines if the return value from encode indicates an unconvertable character.
Definition charsetencoder.h:115
static size_t putUTF16BECodePoint(unsigned int ch, char *dst)
Add UTF-16 big-endian bytes to dst corresponding to ch.
static void encode(CharsetEncoderPtr &enc, const LogString &src, LogString::const_iterator &iter, ByteBuffer &dst)
Use enc to encode into out codepoints of src until out is full or an invalid value is encountered.
static size_t putUTF8CodePoint(unsigned int ch, char *dst)
Add UTF-8 bytes to dst corresponding to ch.
static CharsetEncoderPtr getEncoder(const LogString &charset)
Get encoder for specified character set.
virtual log4cxx_status_t encode(unsigned int codePoint, ByteBuffer &out)=0
Add onto out an encoded equivalent of codePoint.
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:102
std::basic_string< logchar > LogString
Definition logstring.h:51
#define LOG4CXX_CAST_ENTRY(Interface)
Definition object.h:154
#define DECLARE_ABSTRACT_LOG4CXX_OBJECT(object)
Definition object.h:37
#define END_LOG4CXX_CAST_MAP()
Definition object.h:148
#define BEGIN_LOG4CXX_CAST_MAP()
Definition object.h:142