![]() |
stromx
0.8.0
|
Reader for stromx files. More...
#include <XmlReader.h>
Public Member Functions | |
| Stream * | readStream (const std::string &filepath, const AbstractFactory *factory) const |
| Stream * | readStream (FileInput &input, const std::string &filename, const AbstractFactory *factory) const |
| void | readParameters (const std::string &filepath, const AbstractFactory *factory, const std::vector< stromx::runtime::Operator *> &operators) const |
| void | readParameters (FileInput &input, const std::string &filename, const AbstractFactory *factory, const std::vector< stromx::runtime::Operator *> &operators) const |
Reader 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 read from file inputs. File inputs are an abstraction of the file bundles mentioned above and are represented by a FileInput object. This allows the user to implement custom ways to store file bundles, e.g. in a database or using a different archive format.
| void stromx::runtime::XmlReader::readParameters | ( | const std::string & | filepath, |
| const AbstractFactory * | factory, | ||
| const std::vector< stromx::runtime::Operator *> & | operators | ||
| ) | const |
Reads a parameter file. The file can be either an XML or a zip file. The functions sets the parameters of operators to the values in the file. If a parameter can not be set the error is silently ignored. In particular, only those operator parameters are set which can be written to in the current operator state.
| filepath | The path of the file to be read. |
| factory | The factory is used to instantiate data objects in the stream. I.e. all required data types must have been registered with the factory. |
| DeserializationError | Failed to deserialize data referenced in the XML file. |
| FileException | Failed to access the XML file or a data file. |
| FactoryException | Failed to allocate an operator or a data object. |
| InconsistentFileContent | The content of the file is inconsistent. This is probably due to a change of the file format. |
| void stromx::runtime::XmlReader::readParameters | ( | FileInput & | input, |
| const std::string & | filename, | ||
| const AbstractFactory * | factory, | ||
| const std::vector< stromx::runtime::Operator *> & | operators | ||
| ) | const |
Reads a parameter file from an file input. The function sets the parameters of operators to the values in the file. If a parameter can not be set the error is silently ignored. In particular, only those operator parameters are set which can be written to in the current operator state.
| input | The file input which provides the parameter files. |
| filename | The name of the file in the input to be read. |
| factory | The factory is used to instantiate data objects in the stream. I.e. all required data types must have been registered with the factory. |
| FileException | Failed to access the XML file or a data file. |
| FactoryException | Failed to allocate an operator or a data object. |
| DeserializationError | Failed to deserialize data referenced in the XML file. |
| Stream * stromx::runtime::XmlReader::readStream | ( | const std::string & | filepath, |
| const AbstractFactory * | factory | ||
| ) | const |
Reads a stream file. The file can be either an XML or a zip file.
| filepath | The path of the file to be read. |
| factory | The factory is used to instantiate the operators and data objects in the stream. I.e. all required operator and data types must have been registered with the factory. |
| DeserializationError | Failed to deserialize data referenced in the XML file. |
| FileException | Failed to access the XML file or a data file. |
| FactoryException | Failed to allocate an operator or a data object. |
| InconsistentFileContent | The content of the file is inconsistent. This is probably due to a change of the file format. |
| Stream * stromx::runtime::XmlReader::readStream | ( | FileInput & | input, |
| const std::string & | filename, | ||
| const AbstractFactory * | factory | ||
| ) | const |
Reads a stream file from an file input.
| input | The file input which provides the stream files. |
| filename | The name of the file in the input to be read. |
| factory | The factory is used to instantiate the operators and data objects in the stream. I.e. all required operator and data types must have been registered with the factory. |
| DeserializationError | Failed to deserialize data referenced in the XML file. |
| FileException | Failed to access the XML file or a data file. |
| FactoryException | Failed to allocate an operator or a data object. |
| InconsistentFileContent | The content of the file is inconsistent. This is probably due to a change of the file format. |
1.8.12