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

Writer for stromx files. More...

#include <XmlWriter.h>

Public Member Functions

void writeStream (const std::string &filepath, const Stream &stream) const
 
void writeStream (FileOutput &output, const std::string &basename, const Stream &stream) const
 
void writeParameters (const std::string &filepath, const std::vector< const stromx::runtime::Operator *> &operators) const
 
void writeParameters (const std::string &filepath, const std::vector< stromx::runtime::Operator *> &operators) const
 
void writeParameters (FileOutput &output, const std::string &basename, const std::vector< const stromx::runtime::Operator *> &operators) const
 
void writeParameters (FileOutput &output, const std::string &basename, const std::vector< stromx::runtime::Operator *> &operators) const
 

Detailed Description

Writer for stromx files.

Stromx can read and write stream and parameter files. A stream file contains all the operators, connections and threads of a stream. In addition, the settings of the parameters of each operator are stored. A parameter file contains the parameter settings of a list of operator. It can be used to set the parameters of an existing stream without changing its connections or threads.

Both stream and parameter files are XML files. Additionally, they can refer to dependend files which contain parameter information which should not be encoded as XML (such as image data). Thus the stream and parameter XML files are actually part of file bundles which are either stored in a common directory or in a zip archive. In the first case the path of the file is the path of XML file contained in the same directory as the dependend files. In the second case it is the path of zip file which contains the XML file and the dependend files. Zip files can also have the custom extension *.stromx.

Stream and parameter files can also be written to file outputs. File outputs are an abstraction of the file bundles mentioned above and are represented by a FileOutput object. This allows the user to implement custom ways to store file bundles, e.g. in a database or using a different archive format.

Member Function Documentation

§ writeParameters() [1/4]

void stromx::runtime::XmlWriter::writeParameters ( const std::string &  filepath,
const std::vector< const stromx::runtime::Operator *> &  operators 
) const

Writes a parameter file.

Parameters
filepathThe path of the file. Any existing file is overwritten.
operatorsThe operators whose parameter settings are written to the file.
Exceptions
FileExceptionThe base name of the file name is empty or the file extension is unknown.
SerializationErrorFailed to serialize data referenced in the XML file.

§ writeParameters() [2/4]

void stromx::runtime::XmlWriter::writeParameters ( const std::string &  filepath,
const std::vector< stromx::runtime::Operator *> &  operators 
) const

Writes a parameter file.

Parameters
filepathThe path of the file. Any existing file is overwritten.
operatorsThe operators whose parameter settings are written to the file.
Exceptions
FileExceptionThe base name of the file name is empty or the file extension is unknown.
SerializationErrorFailed to serialize data referenced in the XML file.

§ writeParameters() [3/4]

void stromx::runtime::XmlWriter::writeParameters ( FileOutput output,
const std::string &  basename,
const std::vector< const stromx::runtime::Operator *> &  operators 
) const

Writes a parameter file to a file output

Parameters
basenameThe common first part of the name of all files which are written to the file output.
operatorsThe operators whose parameter settings are written to the file.
Exceptions
WrongArgumentThe base name of the file name is empty.
SerializationErrorFailed to serialize data referenced in the XML file.

§ writeParameters() [4/4]

void stromx::runtime::XmlWriter::writeParameters ( FileOutput output,
const std::string &  basename,
const std::vector< stromx::runtime::Operator *> &  operators 
) const

Writes a parameter file to a file output

Parameters
basenameThe common first part of the name of all files which are written to the file output.
operatorsThe operators whose parameter settings are written to the file.
Exceptions
WrongArgumentThe base name of the file name is empty.
SerializationErrorFailed to serialize data referenced in the XML file.

§ writeStream() [1/2]

void stromx::runtime::XmlWriter::writeStream ( const std::string &  filepath,
const Stream stream 
) const

Writes a stream file. The file can be either an XML or a zip file.

Parameters
filepathThe path of the file. Any existing file is overwritten.
streamThe stream to write.
Exceptions
FileExceptionThe base name of the file name is empty or the file extension is unknown.
SerializationErrorFailed to serialize data referenced in the XML file.

§ writeStream() [2/2]

void stromx::runtime::XmlWriter::writeStream ( FileOutput output,
const std::string &  basename,
const Stream stream 
) const

Writes a stream file to a file output.

Parameters
outputThe file output which receives the stream file.
basenameThe common first part of the name of all files which are written to the file output.
streamThe stream to write.
Exceptions
FileExceptionThe base name of the file name is empty or the file extension is unknown.
SerializationErrorFailed to serialize data referenced in the XML file.

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