tesseract  4.1.0
tesseract::OutputBuffer Class Reference

#include <fileio.h>

Public Member Functions

 OutputBuffer (FILE *stream)
 
 OutputBuffer (FILE *stream, size_t size)
 
 ~OutputBuffer ()
 
void WriteString (const std::string &str)
 
bool CloseFile ()
 

Detailed Description

Definition at line 78 of file fileio.h.

Constructor & Destructor Documentation

tesseract::OutputBuffer::OutputBuffer ( FILE *  stream)
explicit

Definition at line 178 of file fileio.cpp.

179  : stream_(stream) {
180 }
tesseract::OutputBuffer::OutputBuffer ( FILE *  stream,
size_t  size 
)

Definition at line 182 of file fileio.cpp.

183  : stream_(stream) {
184 }
tesseract::OutputBuffer::~OutputBuffer ( )

Definition at line 186 of file fileio.cpp.

186  {
187  if (stream_ != nullptr) {
188  fclose(stream_);
189  }
190 }

Member Function Documentation

bool tesseract::OutputBuffer::CloseFile ( )

Definition at line 196 of file fileio.cpp.

196  {
197  int ret = fclose(stream_);
198  stream_ = nullptr;
199  return ret == 0;
200 }
void tesseract::OutputBuffer::WriteString ( const std::string &  str)

Definition at line 192 of file fileio.cpp.

192  {
193  fputs(str.c_str(), stream_);
194 }

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