tesseract v5.3.3.20231005
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 92 of file fileio.h.

Constructor & Destructor Documentation

◆ OutputBuffer() [1/2]

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

Definition at line 168 of file fileio.cpp.

168: stream_(stream) {}

◆ OutputBuffer() [2/2]

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

Definition at line 170 of file fileio.cpp.

170: stream_(stream) {}

◆ ~OutputBuffer()

tesseract::OutputBuffer::~OutputBuffer ( )

Definition at line 172 of file fileio.cpp.

172 {
173 if (stream_ != nullptr) {
174 fclose(stream_);
175 }
176}

Member Function Documentation

◆ CloseFile()

bool tesseract::OutputBuffer::CloseFile ( )

Definition at line 182 of file fileio.cpp.

182 {
183 int ret = fclose(stream_);
184 stream_ = nullptr;
185 return ret == 0;
186}

◆ WriteString()

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

Definition at line 178 of file fileio.cpp.

178 {
179 fputs(str.c_str(), stream_);
180}

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