A table which stores sequences of unicode characters, referenced by hash keys. More...
#include "Character.h"
Public Member Functions | |
ExtendedCharTable () | |
Constructs a new character table. More... | |
~ExtendedCharTable () | |
ushort | createExtendedChar (ushort *unicodePoints, ushort length) |
Adds a sequences of unicode characters to the table and returns a hash code which can be used later to look up the sequence using lookupExtendedChar() More... | |
ushort * | lookupExtendedChar (ushort hash, ushort &length) const |
Looks up and returns a pointer to a sequence of unicode characters which was added to the table using createExtendedChar(). More... | |
Static Public Attributes | |
static ExtendedCharTable | instance |
The global ExtendedCharTable instance. More... | |
Private Member Functions | |
ushort | extendedCharHash (ushort *unicodePoints, ushort length) const |
bool | extendedCharMatch (ushort hash, ushort *unicodePoints, ushort length) const |
Private Attributes | |
QHash< ushort, ushort * > | extendedCharTable |
A table which stores sequences of unicode characters, referenced by hash keys.
The hash key itself is the same size as a unicode character ( ushort ) so that it can occupy the same space in a structure.
Definition at line 159 of file Character.h.
ExtendedCharTable::ExtendedCharTable | ( | ) |
Constructs a new character table.
Definition at line 424 of file Emulation.cpp.
ExtendedCharTable::~ExtendedCharTable | ( | ) |
Definition at line 427 of file Emulation.cpp.
References extendedCharTable.
ushort ExtendedCharTable::createExtendedChar | ( | ushort * | unicodePoints, |
ushort | length | ||
) |
Adds a sequences of unicode characters to the table and returns a hash code which can be used later to look up the sequence using lookupExtendedChar()
If the same sequence already exists in the table, the hash of the existing sequence will be returned.
unicodePoints | An array of unicode character points |
length | Length of unicodePoints |
Definition at line 371 of file Emulation.cpp.
References extendedCharHash(), extendedCharMatch(), extendedCharTable, and hash().
|
private |
Definition at line 345 of file Emulation.cpp.
References hash().
Referenced by createExtendedChar().
|
private |
Definition at line 354 of file Emulation.cpp.
References extendedCharTable, and hash().
Referenced by createExtendedChar().
ushort * ExtendedCharTable::lookupExtendedChar | ( | ushort | hash, |
ushort & | length | ||
) | const |
Looks up and returns a pointer to a sequence of unicode characters which was added to the table using createExtendedChar().
hash | The hash key returned by createExtendedChar() |
length | This variable is set to the length of the character sequence. |
length
. Definition at line 406 of file Emulation.cpp.
References extendedCharTable, and hash().
Referenced by TerminalView::drawContents().
|
private |
Definition at line 201 of file Character.h.
Referenced by ~ExtendedCharTable(), createExtendedChar(), extendedCharMatch(), and lookupExtendedChar().
|
static |
The global ExtendedCharTable instance.
Definition at line 191 of file Character.h.
Referenced by TerminalView::drawContents().