Definition at line 734 of file unicharset.cpp.
◆ InMemoryFilePointer()
InMemoryFilePointer::InMemoryFilePointer |
( |
const char * |
memory, |
|
|
int |
mem_size |
|
) |
| |
|
inline |
Definition at line 736 of file unicharset.cpp.
737 : memory_(memory), fgets_ptr_(memory), mem_size_(mem_size) { }
◆ fgets()
char * InMemoryFilePointer::fgets |
( |
char * |
orig_dst, |
|
|
int |
size |
|
) |
| |
|
inline |
Definition at line 739 of file unicharset.cpp.
739 {
740 const char *src_end = memory_ + mem_size_;
741 char *dst_end = orig_dst + size - 1;
742 if (size < 1) {
743 return fgets_ptr_ < src_end ? orig_dst : nullptr;
744 }
745
746 char *dst = orig_dst;
747 char ch = '^';
748 while (fgets_ptr_ < src_end && dst < dst_end && ch != '\n') {
749 ch = *dst++ = *fgets_ptr_++;
750 }
751 *dst = 0;
752 return (dst == orig_dst) ? nullptr : orig_dst;
753 }
The documentation for this class was generated from the following file: