|
Tesseract
3.02
|
Public Member Functions | |
| InMemoryFilePointer (const char *memory, int mem_size) | |
| char * | fgets (char *orig_dst, int size) |
Definition at line 591 of file unicharset.cpp.
| InMemoryFilePointer::InMemoryFilePointer | ( | const char * | memory, |
| int | mem_size | ||
| ) | [inline] |
Definition at line 593 of file unicharset.cpp.
: memory_(memory), fgets_ptr_(memory), mem_size_(mem_size) { }
| char* InMemoryFilePointer::fgets | ( | char * | orig_dst, |
| int | size | ||
| ) | [inline] |
Definition at line 596 of file unicharset.cpp.
{
const char *src_end = memory_ + mem_size_;
char *dst_end = orig_dst + size - 1;
if (size < 1) {
return fgets_ptr_ < src_end ? orig_dst : NULL;
}
char *dst = orig_dst;
char ch = '^';
while (fgets_ptr_ < src_end && dst < dst_end && ch != '\n') {
ch = *dst++ = *fgets_ptr_++;
}
*dst = 0;
return (dst == orig_dst) ? NULL : orig_dst;
}