11 #ifndef __TEXTWOLF_CHARSET_INTERFACE_HPP__
12 #define __TEXTWOLF_CHARSET_INTERFACE_HPP__
29 static bool encode(
UChar chr,
char* bufptr, std::size_t bufsize)
31 static const char* HEX =
"0123456789abcdef";
37 bb[ii++] = HEX[ chr & 0xf];
66 template <
class Iterator>
67 static void skip(
char* buf,
unsigned int& bufpos, Iterator& itr);
76 template <
class Iterator>
77 static signed char asciichar(
char* buf,
unsigned int& bufpos, Iterator& itr);
85 template <
class Iterator>
86 static void fetchbytes(
char* buf,
unsigned int& bufpos, Iterator& itr);
95 template <
class Iterator>
96 UChar value(
char* buf,
unsigned int& bufpos, Iterator& itr)
const;
102 template <
class Buffer_>
Fixed size buffer fulfilling the requirement of a back insertion sequence needed for textwolf output...
void print(UChar chr, Buffer_ &buf) const
Prints a unicode character to a buffer.
static bool encode(UChar chr, char *bufptr, std::size_t bufsize)
Write the character 'chr' in encoded form as nul-terminated string to a buffer.
Definition: charset_interface.hpp:29
Definition: charset_interface.hpp:119
Simple back insertion sequence for storing the outputs of textwolf in a contant size buffer...
Definition: staticbuffer.hpp:24
Definition: charset_interface.hpp:120
Collection of functions for encode/decode XML character entities.
Definition: charset_interface.hpp:23
uint32_t UChar
Unicode character type.
Definition: char.hpp:37
static void fetchbytes(char *buf, unsigned int &bufpos, Iterator &itr)
Fetches the bytes of the current character into a buffer.
This interface has to be implemented for a character set encoding.
Definition: charset_interface.hpp:55
static signed char asciichar(char *buf, unsigned int &bufpos, Iterator &itr)
Fetches the ascii char representation of the current character.
bool overflow() const
check for array bounds write
Definition: staticbuffer.hpp:141
Definition: charset_interface.hpp:58
UChar value(char *buf, unsigned int &bufpos, Iterator &itr) const
Fetches the unicode character representation of the current character.
Order of bytes for wide char character sets.
Definition: charset_interface.hpp:115
void push_back(char ch)
Append one character.
Definition: staticbuffer.hpp:71
static void skip(char *buf, unsigned int &bufpos, Iterator &itr)
Skip to start of the next character.
static bool is_equal(const Interface &, const Interface &)
Evaluate if two character set encodings of the same type are equal in all properties (code page...
Definition: charset_interface.hpp:107