tesseract  4.00.00dev
InMemoryFilePointer Class Reference

Public Member Functions

 InMemoryFilePointer (const char *memory, int mem_size)
 
char * fgets (char *orig_dst, int size)
 

Detailed Description

Definition at line 697 of file unicharset.cpp.

Constructor & Destructor Documentation

◆ InMemoryFilePointer()

InMemoryFilePointer::InMemoryFilePointer ( const char *  memory,
int  mem_size 
)
inline

Definition at line 699 of file unicharset.cpp.

700  : memory_(memory), fgets_ptr_(memory), mem_size_(mem_size) { }

Member Function Documentation

◆ fgets()

char* InMemoryFilePointer::fgets ( char *  orig_dst,
int  size 
)
inline

Definition at line 702 of file unicharset.cpp.

702  {
703  const char *src_end = memory_ + mem_size_;
704  char *dst_end = orig_dst + size - 1;
705  if (size < 1) {
706  return fgets_ptr_ < src_end ? orig_dst : NULL;
707  }
708 
709  char *dst = orig_dst;
710  char ch = '^';
711  while (fgets_ptr_ < src_end && dst < dst_end && ch != '\n') {
712  ch = *dst++ = *fgets_ptr_++;
713  }
714  *dst = 0;
715  return (dst == orig_dst) ? NULL : orig_dst;
716  }
voidpf void uLong size
Definition: ioapi.h:39

The documentation for this class was generated from the following file: