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;
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;
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);
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;
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;
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;
162 UNICHARMAP::UNICHARMAP_NODE::UNICHARMAP_NODE() :
168 UNICHARMAP::UNICHARMAP_NODE::~UNICHARMAP_NODE() {
UNICHAR_ID unichar_to_id(const char *const unichar_repr) const
int minmatch(const char *const unichar_repr) const
bool contains(const char *const unichar_repr) const
void insert(const char *const unichar_repr, UNICHAR_ID id)