Tesseract  3.02
tesseract::InputFileBuffer Class Reference

#include <input_file_buffer.h>

List of all members.

Public Member Functions

 InputFileBuffer (const string &file_name)
virtual ~InputFileBuffer ()
int Read (void *buffer, int bytes_to_read)

Protected Attributes

string file_name_
FILE * fp_

Detailed Description

Definition at line 19 of file input_file_buffer.h.


Constructor & Destructor Documentation

tesseract::InputFileBuffer::InputFileBuffer ( const string &  file_name) [explicit]

Definition at line 13 of file input_file_buffer.cpp.

  : file_name_(file_name) {
  fp_ = NULL;
}
tesseract::InputFileBuffer::~InputFileBuffer ( ) [virtual]

Definition at line 19 of file input_file_buffer.cpp.

                                  {
  if (fp_ != NULL) {
    fclose(fp_);
  }
}

Member Function Documentation

int tesseract::InputFileBuffer::Read ( void *  buffer,
int  bytes_to_read 
)

Definition at line 26 of file input_file_buffer.cpp.

                                                         {
  // open the file if necessary
  if (fp_ == NULL) {
    fp_ = fopen(file_name_.c_str(), "rb");
    if (fp_ == NULL) {
      return 0;
    }
  }
  return fread(buffer, 1, bytes_to_read, fp_);
}

Member Data Documentation

Definition at line 26 of file input_file_buffer.h.

Definition at line 27 of file input_file_buffer.h.


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