tesseract  4.1.1
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 91 of file fileio.h.

Constructor & Destructor Documentation

◆ OutputBuffer() [1/2]

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

Definition at line 176 of file fileio.cpp.

177  : stream_(stream) {
178 }

◆ OutputBuffer() [2/2]

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

Definition at line 180 of file fileio.cpp.

181  : stream_(stream) {
182 }

◆ ~OutputBuffer()

tesseract::OutputBuffer::~OutputBuffer ( )

Definition at line 184 of file fileio.cpp.

184  {
185  if (stream_ != nullptr) {
186  fclose(stream_);
187  }
188 }

Member Function Documentation

◆ CloseFile()

bool tesseract::OutputBuffer::CloseFile ( )

Definition at line 194 of file fileio.cpp.

194  {
195  int ret = fclose(stream_);
196  stream_ = nullptr;
197  return ret == 0;
198 }

◆ WriteString()

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

Definition at line 190 of file fileio.cpp.

190  {
191  fputs(str.c_str(), stream_);
192 }

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