GNU Octave  6.2.0
A high-level interpreted language, primarily intended for numerical computations, mostly compatible with Matlab
ExtendedCharTable Class Reference

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

#include "Character.h"

Collaboration diagram for ExtendedCharTable:

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
 

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::ExtendedCharTable ( )

Constructs a new character table.

Definition at line 424 of file Emulation.cpp.

◆ ~ExtendedCharTable()

ExtendedCharTable::~ExtendedCharTable ( )

Definition at line 427 of file Emulation.cpp.

References extendedCharTable.

Member Function Documentation

◆ createExtendedChar()

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 371 of file Emulation.cpp.

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

◆ extendedCharHash()

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

Definition at line 345 of file Emulation.cpp.

References octave::crypto::hash(), and octave::jit_convention::length.

Referenced by createExtendedChar().

◆ extendedCharMatch()

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

◆ lookupExtendedChar()

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 406 of file Emulation.cpp.

References extendedCharTable, octave::crypto::hash(), and octave::jit_convention::length.

Referenced by TerminalView::drawContents().

Member Data Documentation

◆ extendedCharTable

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

◆ instance

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: