36 const char* current_char = unichar_repr;
37 UNICHARMAP_NODE* current_nodes = nodes;
39 assert(*unichar_repr !=
'\0');
42 if (*(current_char + 1) ==
'\0')
43 return current_nodes[
static_cast<unsigned char>(*current_char)].id;
45 current_nodes[
static_cast<unsigned char>(*current_char)].children;
55 const char* current_char = unichar_repr;
56 UNICHARMAP_NODE* current_nodes = nodes;
58 assert(*unichar_repr !=
'\0');
62 if (length == 1 || *(current_char + 1) ==
'\0')
63 return current_nodes[
static_cast<unsigned char>(*current_char)].id;
65 current_nodes[
static_cast<unsigned char>(*current_char)].children;
76 const char* current_char = unichar_repr;
77 UNICHARMAP_NODE** current_nodes_pointer = &nodes;
79 assert(*unichar_repr !=
'\0');
83 if (*current_nodes_pointer == 0)
84 *current_nodes_pointer =
new UNICHARMAP_NODE[256];
85 if (*(current_char + 1) ==
'\0') {
86 (*current_nodes_pointer)
87 [
static_cast<unsigned char>(*current_char)].id = id;
90 current_nodes_pointer =
91 &((*current_nodes_pointer)
92 [
static_cast<unsigned char>(*current_char)].children);
101 if (unichar_repr == NULL || *unichar_repr ==
'\0')
return false;
103 const char* current_char = unichar_repr;
104 UNICHARMAP_NODE* current_nodes = nodes;
106 while (current_nodes != 0 && *(current_char + 1) !=
'\0') {
108 current_nodes[
static_cast<unsigned char>(*current_char)].children;
111 return current_nodes != 0 && *(current_char + 1) ==
'\0' &&
112 current_nodes[static_cast<unsigned char>(*current_char)].id >= 0;
121 if (unichar_repr == NULL || *unichar_repr ==
'\0')
return false;
122 if (length <= 0 || length >
UNICHAR_LEN)
return false;
124 const char* current_char = unichar_repr;
125 UNICHARMAP_NODE* current_nodes = nodes;
127 while (current_nodes != 0 && (length > 1 && *(current_char + 1) !=
'\0')) {
129 current_nodes[
static_cast<unsigned char>(*current_char)].children;
133 return current_nodes != 0 && (length == 1 || *(current_char + 1) ==
'\0') &&
134 current_nodes[
static_cast<unsigned char>(*current_char)].id >= 0;
140 const char* current_char = unichar_repr;
141 UNICHARMAP_NODE* current_nodes = nodes;
143 while (current_nodes != NULL && *current_char !=
'\0') {
144 if (current_nodes[static_cast<unsigned char>(*current_char)].
id >= 0)
145 return current_char + 1 - unichar_repr;
147 current_nodes[
static_cast<unsigned char>(*current_char)].children;
158 UNICHARMAP::UNICHARMAP_NODE::UNICHARMAP_NODE() :
164 UNICHARMAP::UNICHARMAP_NODE::~UNICHARMAP_NODE() {
bool contains(const char *const unichar_repr) const
int minmatch(const char *const unichar_repr) const
void insert(const char *const unichar_repr, UNICHAR_ID id)
UNICHAR_ID unichar_to_id(const char *const unichar_repr) const