#include <fileio.h>
Definition at line 70 of file fileio.h.
◆ InputBuffer() [1/2]
tesseract::InputBuffer::InputBuffer |
( |
FILE * |
stream | ) |
|
|
explicit |
◆ InputBuffer() [2/2]
tesseract::InputBuffer::InputBuffer |
( |
FILE * |
stream, |
|
|
size_t |
size |
|
) |
| |
◆ ~InputBuffer()
tesseract::InputBuffer::~InputBuffer |
( |
| ) |
|
Definition at line 138 of file fileio.cpp.
138 {
139 if (stream_ != nullptr) {
140 fclose(stream_);
141 }
142}
◆ CloseFile()
bool tesseract::InputBuffer::CloseFile |
( |
| ) |
|
Definition at line 158 of file fileio.cpp.
158 {
159 int ret = fclose(stream_);
160 stream_ = nullptr;
161 return ret == 0;
162}
◆ Read()
bool tesseract::InputBuffer::Read |
( |
std::string * |
out | ) |
|
Definition at line 144 of file fileio.cpp.
144 {
145 char buf[BUFSIZ + 1];
146 int l;
147 while ((l = fread(buf, 1, BUFSIZ, stream_)) > 0) {
148 if (ferror(stream_)) {
149 clearerr(stream_);
150 return false;
151 }
152 buf[l] = 0;
153 out->append(buf);
154 }
155 return true;
156}
The documentation for this class was generated from the following files:
- /media/home/debian/src/github/tesseract-ocr/tesseract/src/training/unicharset/fileio.h
- /media/home/debian/src/github/tesseract-ocr/tesseract/src/training/unicharset/fileio.cpp