Public Member Functions | Private Attributes | List of all members
QLigature Class Reference

Public Member Functions

 QLigature (QChar c)
 
Q_UINT16 first ()
 
Q_UINT16 next ()
 
Q_UINT16 current ()
 
int match (QString &str, unsigned int index)
 
QChar head ()
 
QChar::Decomposition tag ()
 

Private Attributes

Q_UINT16ligatures
 
Q_UINT16cur
 

Detailed Description

Definition at line 11426 of file qstring.cpp.

Constructor & Destructor Documentation

QLigature::QLigature ( QChar  c)

Definition at line 11444 of file qstring.cpp.

11445 {
11446  const Q_UINT16 *r = ligature_info[c.row()];
11447  if( !r )
11448  ligatures = 0;
11449  else
11450  {
11451  const Q_UINT16 pos = r[c.cell()];
11452  ligatures = (Q_UINT16 *)&(ligature_map[pos]);
11453  }
11454  cur = ligatures;
11455 }
uchar & cell()
Definition: qstring.h:167
Q_UINT16 * ligatures
Definition: qstring.cpp:11440
static const Q_UINT16 ligature_map[]
Definition: qstring.cpp:7187
unsigned short Q_UINT16
Definition: qglobal.h:418
static const Q_UINT16 *const ligature_info[256]
Definition: qstring.cpp:8415
uchar & row()
Definition: qstring.h:168
Q_UINT16 * cur
Definition: qstring.cpp:11441

Member Function Documentation

Q_UINT16 QLigature::current ( )
inline

Definition at line 11433 of file qstring.cpp.

11433 { return cur ? *cur : 0; }
Q_UINT16 * cur
Definition: qstring.cpp:11441
Q_UINT16 QLigature::first ( )
inline

Definition at line 11431 of file qstring.cpp.

11431 { cur = ligatures; return cur ? *cur : 0; }
Q_UINT16 * ligatures
Definition: qstring.cpp:11440
Q_UINT16 * cur
Definition: qstring.cpp:11441
QChar QLigature::head ( )

Definition at line 11457 of file qstring.cpp.

11458 {
11459  if(current())
11460  return QChar(decomposition_map[current()+1]);
11461 
11462  return QChar::null;
11463 }
The QChar class provides a light-weight Unicode character.
Definition: qstring.h:56
QT_STATIC_CONST QChar null
Definition: qstring.h:68
static const Q_UINT16 decomposition_map[]
Definition: qstring.cpp:2403
Q_UINT16 current()
Definition: qstring.cpp:11433
int QLigature::match ( QString str,
unsigned int  index 
)

Definition at line 11473 of file qstring.cpp.

11474 {
11475  unsigned int i=index;
11476 
11477  if(!current()) return 0;
11478 
11479  Q_UINT16 lig = current() + 2;
11480  Q_UINT16 ch;
11481 
11482  while ((i < str.length()) && (ch = decomposition_map[lig])) {
11483  if (str[(int)i] != QChar(ch))
11484  return 0;
11485  i++; lig++;
11486  }
11487 
11488  if (!decomposition_map[lig])
11489  {
11490  return i-index;
11491  }
11492  return 0;
11493 }
The QChar class provides a light-weight Unicode character.
Definition: qstring.h:56
uint length() const
Definition: qstring.h:679
unsigned short Q_UINT16
Definition: qglobal.h:418
static const Q_UINT16 decomposition_map[]
Definition: qstring.cpp:2403
Q_UINT16 current()
Definition: qstring.cpp:11433
Q_UINT16 QLigature::next ( )
inline

Definition at line 11432 of file qstring.cpp.

11432 { return cur && *cur ? *(cur++) : 0; }
Q_UINT16 * cur
Definition: qstring.cpp:11441
QChar::Decomposition QLigature::tag ( )

Definition at line 11465 of file qstring.cpp.

11466 {
11467  if(current())
11469 
11470  return QChar::Canonical;
11471 }
static const Q_UINT16 decomposition_map[]
Definition: qstring.cpp:2403
Q_UINT16 current()
Definition: qstring.cpp:11433
Decomposition
Definition: qstring.h:124

Member Data Documentation

Q_UINT16* QLigature::cur
private

Definition at line 11441 of file qstring.cpp.

Q_UINT16* QLigature::ligatures
private

Definition at line 11440 of file qstring.cpp.


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