The active extended-ascii character set encoding. Performs UTF-8 encoding and decoding of extended-ascii characters. More...
#include <convert.h>
Public Member Functions | |
ExtendedASCIICharacterSet () | |
void | print () const |
Prints the (up to) 128 characters in the current extended-ascii character set. Useful for debugging. | |
const UTF8Character & | decode (char c) const |
Returns c decoded from extended-ascii to UTF-8. c must be an extended-ascii character. | |
char | encode (const UTF8Character &c) const |
Returns c encoded to extended-ascii from UTF-8. c must map to an extended-ascii character. | |
Private Types | |
typedef char | UTF8CharBuffer [6] |
Private Attributes | |
UTF8CharBuffer | m_converted [128] |
UTF8Character | m_decodeMap [128] |
UTF8CharacterToExtendedASCII | m_encodeMap [128] |
The active extended-ascii character set encoding. Performs UTF-8 encoding and decoding of extended-ascii characters.
Obtain the global instance with globalExtendedASCIICharacterSet().
Definition at line 148 of file convert.h.
typedef char ExtendedASCIICharacterSet::UTF8CharBuffer[6] [private] |
ExtendedASCIICharacterSet::ExtendedASCIICharacterSet | ( | ) | [inline] |
Definition at line 155 of file convert.h.
References extended_ascii_for_index(), globalCharacterSet(), i, m_converted, m_decodeMap, m_encodeMap, and sort().
const UTF8Character& ExtendedASCIICharacterSet::decode | ( | char | c | ) | const [inline] |
Returns c
decoded from extended-ascii to UTF-8. c
must be an extended-ascii character.
Definition at line 188 of file convert.h.
References char_is_ascii(), extended_ascii_to_index(), globalCharacterSet(), and m_decodeMap.
char ExtendedASCIICharacterSet::encode | ( | const UTF8Character & | c | ) | const [inline] |
Returns c
encoded to extended-ascii from UTF-8. c
must map to an extended-ascii character.
Definition at line 197 of file convert.h.
References UTF8Character::buffer, char_is_ascii(), globalCharacterSet(), and m_encodeMap.
Referenced by ostream_write().
void ExtendedASCIICharacterSet::print | ( | ) | const [inline] |
Prints the (up to) 128 characters in the current extended-ascii character set. Useful for debugging.
Definition at line 177 of file convert.h.
References extended_ascii_for_index(), CharacterSet::get(), globalCharacterSet(), i, and m_decodeMap.
UTF8CharBuffer ExtendedASCIICharacterSet::m_converted[128] [private] |
Definition at line 151 of file convert.h.
Referenced by ExtendedASCIICharacterSet().
UTF8Character ExtendedASCIICharacterSet::m_decodeMap[128] [private] |
Definition at line 152 of file convert.h.
Referenced by decode(), ExtendedASCIICharacterSet(), and print().
Definition at line 153 of file convert.h.
Referenced by encode(), and ExtendedASCIICharacterSet().