tesseract  4.0.0-1-g2a2b
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

◆ OutputBuffer() [1/2]

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

Definition at line 173 of file fileio.cpp.

174  : stream_(stream) {
175 }

◆ OutputBuffer() [2/2]

tesseract::OutputBuffer::OutputBuffer ( FILE *  stream,
size_t  size 
)

Definition at line 177 of file fileio.cpp.

178  : stream_(stream) {
179 }

◆ ~OutputBuffer()

tesseract::OutputBuffer::~OutputBuffer ( )

Definition at line 181 of file fileio.cpp.

181  {
182  if (stream_ != nullptr) {
183  fclose(stream_);
184  }
185 }

Member Function Documentation

◆ CloseFile()

bool tesseract::OutputBuffer::CloseFile ( )

Definition at line 191 of file fileio.cpp.

191  {
192  int ret = fclose(stream_);
193  stream_ = nullptr;
194  return ret == 0;
195 }

◆ WriteString()

void tesseract::OutputBuffer::WriteString ( const std::string &  str)

Definition at line 187 of file fileio.cpp.

187  {
188  fputs(str.c_str(), stream_);
189 }

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