stromx  0.8.0
Public Member Functions | List of all members
stromx::runtime::ZipFileOutput Class Reference

File output which stores the output data in a zip file. More...

#include <ZipFileOutput.h>

Inheritance diagram for stromx::runtime::ZipFileOutput:
stromx::runtime::FileOutput stromx::runtime::OutputProvider

Public Member Functions

 ZipFileOutput (const std::string &archive)
 
virtual void initialize (const std::string &filename)
 
virtual const std::string & getFilename () const
 
virtual const std::string getText () const
 
virtual std::ostream & text ()
 
virtual std::ostream & openFile (const std::string &ext, const OpenMode mode)
 
virtual std::ostream & file ()
 
virtual void close ()
 

Additional Inherited Members

- Public Types inherited from stromx::runtime::OutputProvider
enum  OpenMode { BINARY, TEXT }
 

Detailed Description

File output which stores the output data in a zip file.

Constructor & Destructor Documentation

§ ZipFileOutput()

stromx::runtime::ZipFileOutput::ZipFileOutput ( const std::string &  archive)
explicit

Constructs a file output which stores data in a zip file.

Parameters
archiveThe path to the zip file.
Exceptions
FileAccessFailedIf the zip file could not be opened.

Member Function Documentation

§ close()

void stromx::runtime::ZipFileOutput::close ( )
virtual

Closes the file output. If this functions is not called the output is closed by the destructor.

Exceptions
FileAccessFailedIf data could not be saved (e.g. due to missing write permission).

Implements stromx::runtime::FileOutput.

§ file()

std::ostream & stromx::runtime::ZipFileOutput::file ( )
virtual

Returns the output stream which accepts the file representation of the data.

Exceptions
WrongStateIf the input provider has not been correctly initialized or if openFile() has not been called before calling this function.

Implements stromx::runtime::OutputProvider.

§ getFilename()

const std::string & stromx::runtime::ZipFileOutput::getFilename ( ) const
virtual

Returns the name of the current file including the correct file extension. If no file data was written an empty string is returned.

Exceptions
WrongStateIf no file has been opened by the client.

Implements stromx::runtime::FileOutput.

§ getText()

const std::string stromx::runtime::ZipFileOutput::getText ( ) const
virtual

Returns the text representation of the data if it has already been set. Otherwise an empty string is returned.

Implements stromx::runtime::FileOutput.

§ initialize()

void stromx::runtime::ZipFileOutput::initialize ( const std::string &  filename)
virtual

Initializes the output provider.

Parameters
filenameThe name of the file which accepts the file data without file extension.

Implements stromx::runtime::FileOutput.

§ openFile()

std::ostream & stromx::runtime::ZipFileOutput::openFile ( const std::string &  ext,
const OpenMode  mode 
)
virtual

Opens the file representation of the data and returns the associated output stream.

Exceptions
WrongStateIf the input provider has not been correctly initialized or if this function has already been called.
FileAccessFailedIf the file could not be opened.

Implements stromx::runtime::OutputProvider.

§ text()

std::ostream & stromx::runtime::ZipFileOutput::text ( )
virtual

Returns an output stream which accepts the text representation of the data.

Exceptions
WrongStateIf the input provider has not been correctly initialized.

Implements stromx::runtime::OutputProvider.


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