GNU Octave  3.8.0
A high-level interpreted language, primarily intended for numerical computations, mostly compatible with Matlab
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
Public Member Functions | Static Public Attributes | Private Member Functions | Private Attributes | List of all members
ExtendedCharTable Class Reference

A table which stores sequences of unicode characters, referenced by hash keys. More...

#include "Character.h"

Collaboration diagram for ExtendedCharTable:
Collaboration graph
[legend]

Public Member Functions

 ExtendedCharTable ()
 Constructs a new character table.
 ~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()
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().

Static Public Attributes

static ExtendedCharTable instance
 The global ExtendedCharTable instance.

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

Detailed Description

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.

Constructor & Destructor Documentation

ExtendedCharTable::ExtendedCharTable ( )

Constructs a new character table.

Definition at line 411 of file Emulation.cpp.

ExtendedCharTable::~ExtendedCharTable ( )

Definition at line 414 of file Emulation.cpp.

References extendedCharTable.

Member Function Documentation

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.

Parameters
unicodePointsAn array of unicode character points
lengthLength of unicodePoints

Definition at line 358 of file Emulation.cpp.

References extendedCharHash(), extendedCharMatch(), extendedCharTable, and jit_convention::length.

ushort ExtendedCharTable::extendedCharHash ( ushort *  unicodePoints,
ushort  length 
) const
private

Definition at line 332 of file Emulation.cpp.

References jit_convention::length.

Referenced by createExtendedChar().

bool ExtendedCharTable::extendedCharMatch ( ushort  hash,
ushort *  unicodePoints,
ushort  length 
) const
private

Definition at line 341 of file Emulation.cpp.

References extendedCharTable, and jit_convention::length.

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().

Parameters
hashThe hash key returned by createExtendedChar()
lengthThis variable is set to the length of the character sequence.
Returns
A unicode character sequence of size length.

Definition at line 393 of file Emulation.cpp.

References extendedCharTable.

Referenced by TerminalView::drawContents().

Member Data Documentation

QHash<ushort,ushort*> ExtendedCharTable::extendedCharTable
private
ExtendedCharTable ExtendedCharTable::instance
static

The global ExtendedCharTable instance.

Definition at line 191 of file Character.h.

Referenced by TerminalView::drawContents().


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