#include <unichar.h>
Definition at line 107 of file unichar.h.
◆ get_utf8()
int tesseract::UNICHAR::const_iterator::get_utf8 |
( |
char * |
buf | ) |
const |
Definition at line 178 of file unichar.cpp.
178 {
181 if (len == 0) {
182 tprintf(
"WARNING: Illegal UTF8 encountered\n");
183 utf8_output[0] = ' ';
184 return 1;
185 }
186 strncpy(utf8_output, it_, len);
187 return len;
188}
DLLSYM void tprintf(const char *format,...)
static int utf8_step(const char *utf8_str)
◆ is_legal()
bool tesseract::UNICHAR::const_iterator::is_legal |
( |
| ) |
const |
◆ operator*()
int tesseract::UNICHAR::const_iterator::operator* |
( |
| ) |
const |
Definition at line 167 of file unichar.cpp.
167 {
170 if (len == 0) {
171 tprintf(
"WARNING: Illegal UTF8 encountered\n");
172 return ' ';
173 }
175 return uch.first_uni();
176}
◆ operator++()
Definition at line 153 of file unichar.cpp.
153 {
156 if (step == 0) {
157 tprintf(
"ERROR: Illegal UTF8 encountered.\n");
158 for (int i = 0; i < 5 && it_[i] != '\0'; ++i) {
159 tprintf(
"Index %d char = 0x%x\n", i, it_[i]);
160 }
161 step = 1;
162 }
163 it_ += step;
164 return *this;
165}
◆ utf8_data()
const char * tesseract::UNICHAR::const_iterator::utf8_data |
( |
| ) |
const |
|
inline |
Definition at line 135 of file unichar.h.
135 {
136 return it_;
137 }
◆ utf8_len()
int tesseract::UNICHAR::const_iterator::utf8_len |
( |
| ) |
const |
Definition at line 190 of file unichar.cpp.
190 {
193 if (len == 0) {
194 tprintf(
"WARNING: Illegal UTF8 encountered\n");
195 return 1;
196 }
197 return len;
198}
◆ operator!=
Definition at line 143 of file unichar.h.
143 {
144 return !(lhs == rhs);
145 }
◆ operator==
bool operator== |
( |
const CI & |
lhs, |
|
|
const CI & |
rhs |
|
) |
| |
|
friend |
Definition at line 140 of file unichar.h.
140 {
141 return lhs.it_ == rhs.it_;
142 }
◆ UNICHAR
The documentation for this class was generated from the following files: