Apache Log4cxx  Version 1.8.0
Loading...
Searching...
No Matches
log4cxx::helpers::Transcoder Class Reference

Methods for converting between external and internal strings. More...

#include <transcoder.h>

Public Types

enum  { LOSSCHAR = 0x3F }

Static Public Member Functions

static void decodeUTF8 (const std::string &src, LogString &dst)
 Append the UTF-8 characters in src onto dst.
static void encodeUTF8 (const LogString &src, std::string &dst)
 Append \src onto dst as a UTF-8 string.
static char * encodeUTF8 (const LogString &src, log4cxx::helpers::Pool &p)
 Converts the LogString to a UTF-8 string.
static void encodeUTF8 (unsigned int sv, ByteBuffer &dst)
 Append the code point sv to dst as UTF-8.
static void encodeUTF16LE (unsigned int sv, ByteBuffer &dst)
 Append the code point sv to dst as UTF-16LE.
static void encodeUTF16BE (unsigned int sv, ByteBuffer &dst)
 Append the code point sv to dst as UTF-16BE.
static unsigned int decode (const std::string &str, std::string::const_iterator &iter)
 Increment iter past the next code point in str.
static void encode (unsigned int ch, std::string &dst)
 Append the UTF8 equivalent to ch onto dst.
static void decode (const std::string &src, LogString &dst)
 Append the LogString equivalent of src onto dst.
static void encode (const LogString &src, std::string &dst)
 Append the UTF8 equivalent of src onto dst.
static char * encode (const LogString &src, log4cxx::helpers::Pool &p)
static void decode (const std::wstring &src, LogString &dst)
 Append the LogString equivalent of src onto dst.
static void encode (const LogString &src, std::wstring &dst)
 Append the equivalent of src onto dst.
static wchar_t * wencode (const LogString &src, log4cxx::helpers::Pool &p)
 A null-terminated equivalent of src.
static unsigned int decode (const std::wstring &str, std::wstring::const_iterator &iter)
 Increment iter past the next code point in str.
static void encode (unsigned int ch, std::wstring &dst)
 Append the wchar_t equivalent to ch onto dst.
static void decode (const std::basic_string< UniChar > &src, LogString &dst)
 Append the LogString equivalent of src onto dst.
static void encode (const LogString &src, std::basic_string< UniChar > &dst)
 Append the equivalent of src onto dst.
static unsigned int decode (const std::basic_string< UniChar > &str, std::basic_string< UniChar >::const_iterator &iter)
 Increment iter past the next code point in str.
static void encode (unsigned int ch, std::basic_string< UniChar > &dst)
 Append the UniChar equivalent to ch onto dst.
static void decode (const CFStringRef &src, LogString &dst)
 Append the LogString equivalent of src onto dst.
static CFStringRef encode (const LogString &src)
 A CFStringRef equivalent of src.
static logchar decode (char ch)
 The logchar equivalent to ch.
static LogString decode (const char *str)
 The LogString equivalent to the characters in the null terminated bytes at str.
static std::string encodeCharsetName (const LogString &charsetName)
 Encodes a charset name in the default encoding without using a CharsetEncoder (which could trigger recursion).

Detailed Description

Methods for converting between external and internal strings.

Member Enumeration Documentation

◆ anonymous enum

anonymous enum
Enumerator
LOSSCHAR 

Member Function Documentation

◆ decode() [1/9]

logchar log4cxx::helpers::Transcoder::decode ( char ch)
static

The logchar equivalent to ch.

◆ decode() [2/9]

void log4cxx::helpers::Transcoder::decode ( const CFStringRef & src,
LogString & dst )
static

Append the LogString equivalent of src onto dst.

◆ decode() [3/9]

LogString log4cxx::helpers::Transcoder::decode ( const char * str)
static

The LogString equivalent to the characters in the null terminated bytes at str.

◆ decode() [4/9]

void log4cxx::helpers::Transcoder::decode ( const std::basic_string< UniChar > & src,
LogString & dst )
static

Append the LogString equivalent of src onto dst.

◆ decode() [5/9]

unsigned int log4cxx::helpers::Transcoder::decode ( const std::basic_string< UniChar > & str,
std::basic_string< UniChar >::const_iterator & iter )
static

Increment iter past the next code point in str.

Precondition
iter is a valid, dereferenceable iterator.
iter and the end of str are in the same sequence.
Parameters
strcontains the code point to which iter refers.
iterthe start of the current code point.
Returns
the code point value or 0xFFFF if not a valid sequence.

◆ decode() [6/9]

void log4cxx::helpers::Transcoder::decode ( const std::string & src,
LogString & dst )
static

Append the LogString equivalent of src onto dst.

◆ decode() [7/9]

unsigned int log4cxx::helpers::Transcoder::decode ( const std::string & str,
std::string::const_iterator & iter )
static

Increment iter past the next code point in str.

Precondition
iter is a valid, dereferenceable iterator.
iter and the end of str are in the same sequence.
Parameters
strcontains the code point to which iter refers.
iterthe start of the current code point.
Returns
the code point value or 0xFFFF if not a valid sequence.

◆ decode() [8/9]

void log4cxx::helpers::Transcoder::decode ( const std::wstring & src,
LogString & dst )
static

Append the LogString equivalent of src onto dst.

◆ decode() [9/9]

unsigned int log4cxx::helpers::Transcoder::decode ( const std::wstring & str,
std::wstring::const_iterator & iter )
static

Increment iter past the next code point in str.

Precondition
iter is a valid, dereferenceable iterator.
iter and the end of str are in the same sequence.
Parameters
strcontains the code point to which iter refers.
iterthe start of the current code point.
Returns
the code point value or 0xFFFF if not a valid sequence.

◆ decodeUTF8()

void log4cxx::helpers::Transcoder::decodeUTF8 ( const std::string & src,
LogString & dst )
static

Append the UTF-8 characters in src onto dst.

◆ encode() [1/8]

CFStringRef log4cxx::helpers::Transcoder::encode ( const LogString & src)
static

A CFStringRef equivalent of src.

◆ encode() [2/8]

char * log4cxx::helpers::Transcoder::encode ( const LogString & src,
log4cxx::helpers::Pool & p )
static
Encodes the specified LogString to the current
  character set.
Deprecated
This function is deprecated and will be removed in a future version.
Parameters
srcstring to encode.
ppool from which to allocate return value.
Returns
pool allocated string.

◆ encode() [3/8]

void log4cxx::helpers::Transcoder::encode ( const LogString & src,
std::basic_string< UniChar > & dst )
static

Append the equivalent of src onto dst.

◆ encode() [4/8]

void log4cxx::helpers::Transcoder::encode ( const LogString & src,
std::string & dst )
static

Append the UTF8 equivalent of src onto dst.

Unrepresentable characters may be replaced with loss characters.

◆ encode() [5/8]

void log4cxx::helpers::Transcoder::encode ( const LogString & src,
std::wstring & dst )
static

Append the equivalent of src onto dst.

◆ encode() [6/8]

void log4cxx::helpers::Transcoder::encode ( unsigned int ch,
std::basic_string< UniChar > & dst )
static

Append the UniChar equivalent to ch onto dst.

◆ encode() [7/8]

void log4cxx::helpers::Transcoder::encode ( unsigned int ch,
std::string & dst )
static

Append the UTF8 equivalent to ch onto dst.

◆ encode() [8/8]

void log4cxx::helpers::Transcoder::encode ( unsigned int ch,
std::wstring & dst )
static

Append the wchar_t equivalent to ch onto dst.

◆ encodeCharsetName()

std::string log4cxx::helpers::Transcoder::encodeCharsetName ( const LogString & charsetName)
static

Encodes a charset name in the default encoding without using a CharsetEncoder (which could trigger recursion).

◆ encodeUTF16BE()

void log4cxx::helpers::Transcoder::encodeUTF16BE ( unsigned int sv,
ByteBuffer & dst )
static

Append the code point sv to dst as UTF-16BE.

◆ encodeUTF16LE()

void log4cxx::helpers::Transcoder::encodeUTF16LE ( unsigned int sv,
ByteBuffer & dst )
static

Append the code point sv to dst as UTF-16LE.

◆ encodeUTF8() [1/3]

char * log4cxx::helpers::Transcoder::encodeUTF8 ( const LogString & src,
log4cxx::helpers::Pool & p )
static

Converts the LogString to a UTF-8 string.

Deprecated
This function is deprecated and will be removed in a future version.

◆ encodeUTF8() [2/3]

void log4cxx::helpers::Transcoder::encodeUTF8 ( const LogString & src,
std::string & dst )
static

Append \src onto dst as a UTF-8 string.

◆ encodeUTF8() [3/3]

void log4cxx::helpers::Transcoder::encodeUTF8 ( unsigned int sv,
ByteBuffer & dst )
static

Append the code point sv to dst as UTF-8.

◆ wencode()

wchar_t * log4cxx::helpers::Transcoder::wencode ( const LogString & src,
log4cxx::helpers::Pool & p )
static

A null-terminated equivalent of src.


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