#include <rtt/PropertyLoader.hpp>
The default file format is 'cpf' from the CPFMarshaller class. You can select another file format using the configuration tool in CoreLib->Properties->Marshalling->Default.
Public Member Functions | |
| bool | configure (const std::string &filename, TaskContext *target, bool all=true) const |
| Read the XML cpf file and 'refresh' the matching attributes of the given TaskContext. | |
| bool | save (const std::string &filename, TaskContext *target, bool all=true) const |
| Write the XML cpf file with the attributes of the given TaskContext. | |
| bool | configure (const std::string &filename, TaskContext *target, const std::string &name) const |
| Read a single property from a file. | |
| bool | save (const std::string &filename, TaskContext *target, const std::string &name) const |
| Write a single property to a file, or update an existing file. | |
| bool configure | ( | const std::string & | filename, | |
| TaskContext * | target, | |||
| bool | all = true | |||
| ) | const |
Read the XML cpf file and 'refresh' the matching attributes of the given TaskContext.
There may be more properties in the file than attributes in the target.
| filename | The file to read from. | |
| target | The TaskContext to configure. | |
| all | Configure all properties of target. Return an error if not all properties were found in filename. |
| bool save | ( | const std::string & | filename, | |
| TaskContext * | target, | |||
| bool | all = true | |||
| ) | const |
Write the XML cpf file with the attributes of the given TaskContext.
The file is first read in, the resulting tree is updated with the task's attributes and then written to disk again. This allows to share files between tasks.
| filename | The file to read from and write to (updating). | |
| target | The TaskContext to configure. | |
| all | Write out all properties of target to filename, add missing ones if necessary. |
| bool configure | ( | const std::string & | filename, | |
| TaskContext * | target, | |||
| const std::string & | name | |||
| ) | const |
Read a single property from a file.
| filename | The file to read from. | |
| target | The TaskContext to configure. | |
| name | The path to or name of a property in target. |
| bool save | ( | const std::string & | filename, | |
| TaskContext * | target, | |||
| const std::string & | name | |||
| ) | const |
Write a single property to a file, or update an existing file.
| filename | The file to update or write to. | |
| target | The TaskContext to configure. | |
| name | The path to or name of a property in target. |
1.5.1