Tesseract  3.02
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
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 591 of file unicharset.cpp.

Constructor & Destructor Documentation

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

Definition at line 593 of file unicharset.cpp.

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

Member Function Documentation

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

Definition at line 596 of file unicharset.cpp.

596  {
597  const char *src_end = memory_ + mem_size_;
598  char *dst_end = orig_dst + size - 1;
599  if (size < 1) {
600  return fgets_ptr_ < src_end ? orig_dst : NULL;
601  }
602 
603  char *dst = orig_dst;
604  char ch = '^';
605  while (fgets_ptr_ < src_end && dst < dst_end && ch != '\n') {
606  ch = *dst++ = *fgets_ptr_++;
607  }
608  *dst = 0;
609  return (dst == orig_dst) ? NULL : orig_dst;
610  }
#define NULL
Definition: host.h:144

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