Tesseract  3.02
InMemoryFilePointer Class Reference

List of all members.

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.

      : 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.

                                        {
    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;
  }

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