HGL::ImageOutput::Writer Class Reference
[Image output plugins]

A simple exception safe writer for image output plugins. More...

#include <writer.h>

List of all members.

Public Member Functions

 Writer (const std::string &filename, const char *suffix=0L) throw (ImageOutputException)
 Constructs an Writer and initializes it for use.
 ~Writer ()
 Closes the file.
void endWrite (bool noClose)
 Indicates a successful end of write of the file.
void endWrite ()
 Indicates a successful end of write of the file.
FILE * getFile () const
 Gets a pointer to the FILE structure of the file.
int getHandle () const
 Gets the file handle of the file.
 operator FILE * () const
 Gets a pointer to the FILE structure of the file.
Writeroperator<< (float f) throw (ImageOutputException)
 Writes a float into the file.
Writeroperator<< (const std::string &s) throw (ImageOutputException)
 Writes a string into the file.

Detailed Description

A simple exception safe writer for image output plugins.

Author:
Heiko Schäfer <heiko@hgl.rangun.de> BSD License
Since:
0.4.52
Examples:

exampleoutput.cpp.


Constructor & Destructor Documentation

HGL::ImageOutput::Writer::Writer ( const std::string &  filename,
const char *  suffix = 0L 
) throw (ImageOutputException)

Constructs an Writer and initializes it for use.

This writer opens the file or throws an ImageOutputException if it failed.

Exceptions:
ImageOutputException if the file could not get created
Parameters:
filename the filename or an empty string for output to stdout
suffix appends suffix if not NULL and not given
Since:
0.4.52
HGL::ImageOutput::Writer::~Writer (  ) 

Closes the file.

If no call to Writer::endWrite was done, it will remove the file.

Since:
0.4.52

Member Function Documentation

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.

Parameters:
noClose true if the file needs not to get closed, false otherwise
Since:
0.5.17
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.

Since:
0.4.52
FILE* HGL::ImageOutput::Writer::getFile (  )  const

Gets a pointer to the FILE structure of the file.

Returns:
a pointer to the FILE structure of the file
Since:
0.4.52
int HGL::ImageOutput::Writer::getHandle (  )  const

Gets the file handle of the file.

Returns:
int the file handle
Since:
0.4.52
HGL::ImageOutput::Writer::operator FILE * (  )  const

Gets a pointer to the FILE structure of the file.

Returns:
a pointer to the FILE structure of the file
Since:
0.5.4
Writer& HGL::ImageOutput::Writer::operator<< ( float  f  )  throw (ImageOutputException)

Writes a float into the file.

Parameters:
f the float to write
Returns:
reference to the Writer to concatenate this operator
Since:
0.5.2
Writer& HGL::ImageOutput::Writer::operator<< ( const std::string &  s  )  throw (ImageOutputException)

Writes a string into the file.

Parameters:
s the string to write
Returns:
reference to the Writer to concatenate this operator
Since:
0.4.70

Generated on 9 Apr 2014 for hgl 0.5.26~svn by  doxygen 1.6.1