#include <unicharmap.h>
Definition at line 27 of file unicharmap.h.
◆ UNICHARMAP()
UNICHARMAP::UNICHARMAP |
( |
| ) |
|
◆ ~UNICHARMAP()
UNICHARMAP::~UNICHARMAP |
( |
| ) |
|
◆ clear()
void UNICHARMAP::clear |
( |
| ) |
|
◆ contains() [1/2]
bool UNICHARMAP::contains |
( |
const char *const |
unichar_repr | ) |
const |
Definition at line 101 of file unicharmap.cpp.
102 if (unichar_repr == NULL || *unichar_repr ==
'\0')
return false;
104 const char* current_char = unichar_repr;
105 UNICHARMAP_NODE* current_nodes = nodes;
107 while (current_nodes != 0 && *(current_char + 1) !=
'\0') {
109 current_nodes[
static_cast<unsigned char>(*current_char)].children;
112 return current_nodes != 0 && *(current_char + 1) ==
'\0' &&
113 current_nodes[static_cast<unsigned char>(*current_char)].id >= 0;
◆ contains() [2/2]
bool UNICHARMAP::contains |
( |
const char *const |
unichar_repr, |
|
|
int |
length |
|
) |
| const |
Definition at line 120 of file unicharmap.cpp.
122 if (unichar_repr == NULL || *unichar_repr ==
'\0')
return false;
123 if (length <= 0 || length >
UNICHAR_LEN)
return false;
125 const char* current_char = unichar_repr;
126 UNICHARMAP_NODE* current_nodes = nodes;
128 while (current_nodes != 0 && (length > 1 && *(current_char + 1) !=
'\0')) {
130 current_nodes[
static_cast<unsigned char>(*current_char)].children;
134 return current_nodes != 0 && (length == 1 || *(current_char + 1) ==
'\0') &&
135 current_nodes[
static_cast<unsigned char>(*current_char)].id >= 0;
◆ insert()
void UNICHARMAP::insert |
( |
const char *const |
unichar_repr, |
|
|
UNICHAR_ID |
id |
|
) |
| |
Definition at line 76 of file unicharmap.cpp.
77 const char* current_char = unichar_repr;
78 UNICHARMAP_NODE** current_nodes_pointer = &nodes;
80 assert(*unichar_repr !=
'\0');
84 if (*current_nodes_pointer == 0)
85 *current_nodes_pointer =
new UNICHARMAP_NODE[256];
86 if (*(current_char + 1) ==
'\0') {
87 (*current_nodes_pointer)
88 [
static_cast<unsigned char>(*current_char)].id = id;
91 current_nodes_pointer =
92 &((*current_nodes_pointer)
93 [
static_cast<unsigned char>(*current_char)].children);
◆ minmatch()
int UNICHARMAP::minmatch |
( |
const char *const |
unichar_repr | ) |
const |
Definition at line 140 of file unicharmap.cpp.
141 const char* current_char = unichar_repr;
142 UNICHARMAP_NODE* current_nodes = nodes;
144 while (current_nodes != NULL && *current_char !=
'\0') {
145 if (current_nodes[static_cast<unsigned char>(*current_char)].
id >= 0)
146 return current_char + 1 - unichar_repr;
148 current_nodes[
static_cast<unsigned char>(*current_char)].children;
◆ unichar_to_id() [1/2]
UNICHAR_ID UNICHARMAP::unichar_to_id |
( |
const char *const |
unichar_repr | ) |
const |
Definition at line 36 of file unicharmap.cpp.
37 const char* current_char = unichar_repr;
38 UNICHARMAP_NODE* current_nodes = nodes;
40 assert(*unichar_repr !=
'\0');
43 if (*(current_char + 1) ==
'\0')
44 return current_nodes[
static_cast<unsigned char>(*current_char)].id;
46 current_nodes[
static_cast<unsigned char>(*current_char)].children;
◆ unichar_to_id() [2/2]
UNICHAR_ID UNICHARMAP::unichar_to_id |
( |
const char *const |
unichar_repr, |
|
|
int |
length |
|
) |
| const |
Definition at line 54 of file unicharmap.cpp.
56 const char* current_char = unichar_repr;
57 UNICHARMAP_NODE* current_nodes = nodes;
59 assert(*unichar_repr !=
'\0');
63 if (length == 1 || *(current_char + 1) ==
'\0')
64 return current_nodes[
static_cast<unsigned char>(*current_char)].id;
66 current_nodes[
static_cast<unsigned char>(*current_char)].children;
The documentation for this class was generated from the following files: