hgl 0.5.42~jessie
A compiler/interpreter suite for developing images (plugin development)
|
A simple exception safe writer for image output plugins. More...
#include "writer.h"
Public Member Functions | |
Writer (const std::string &filename, const char *const suffix=0L) throw (ImageOutputException) | |
Constructs an Writer and initializes it for use. More... | |
~Writer () | |
Closes the file. More... | |
void | endWrite () |
Indicates a successful end of write of the file. More... | |
void | endWrite (bool noClose) |
Indicates a successful end of write of the file. More... | |
FILE * | getFile () const |
Gets a pointer to the FILE structure of the file. More... | |
int | getHandle () const |
Gets the file handle of the file. More... | |
operator FILE * () const | |
Gets a pointer to the FILE structure of the file. More... | |
Writer & | operator<< (const std::string &s) throw (ImageOutputException) |
Writes a string into the file. More... | |
Writer & | operator<< (float f) throw (ImageOutputException) |
Writes a float into the file. More... | |
A simple exception safe writer for image output plugins.
HGL::ImageOutput::Writer::Writer | ( | const std::string & | filename, |
const char *const | suffix = 0L |
||
) | |||
throw | ( | ImageOutputException | |
) |
Constructs an Writer
and initializes it for use.
This writer opens the file or throws an ImageOutputException if it failed.
ImageOutputException | if the file could not get created |
filename | the filename or an empty string for output to stdout |
suffix | appends suffix if not NULL and not given |
HGL::ImageOutput::Writer::~Writer | ( | ) |
void HGL::ImageOutput::Writer::endWrite | ( | ) |
Indicates a successful end of write of the file.
If no call to this function is done before Writer
gets destroyed it will delete the file.
void HGL::ImageOutput::Writer::endWrite | ( | bool | noClose | ) |
Indicates a successful end of write of the file.
If no call to this function is done before Writer
gets destroyed it will delete the file.
noClose | true if the file needs not to get closed, false otherwise |
FILE* HGL::ImageOutput::Writer::getFile | ( | ) | const |
Gets a pointer to the FILE structure of the file.
int HGL::ImageOutput::Writer::getHandle | ( | ) | const |
Gets the file handle of the file.
HGL::ImageOutput::Writer::operator FILE * | ( | ) | const |
Gets a pointer to the FILE structure of the file.
Writer& HGL::ImageOutput::Writer::operator<< | ( | const std::string & | s | ) | |
throw | ( | ImageOutputException | |||
) |
Writes a string into the file.
s | the string to write |