The base for all classes able to load/save configuration parameters from/to file. More...
Public Member Functions | |
ParametersFileLoaderSaver () | |
Constructor. | |
virtual | ~ParametersFileLoaderSaver () |
Destructor. | |
bool | load (QString filename, ConfigurationParameters &configParams, bool keepOld=false) |
Load configuration from the given file and store them to ConfigurationParameters. | |
bool | save (QString filename, const ConfigurationParameters &configParams, bool append=false) |
Save configuration from the ConfigurationParameters to the given file. | |
Protected Member Functions | |
virtual bool | loadParameters (QTextStream &stream, ConfigurationParameters &configParams)=0 |
The function actually load configuration from the given stream. | |
virtual bool | saveParameters (QTextStream &stream, const ConfigurationParameters &configParams)=0 |
The function actually save configuration to the given stream. | |
Detailed Description
The base for all classes able to load/save configuration parameters from/to file.
When subclassing this, you should only override loadParameters and saveParameters
Definition at line 39 of file parametersfileloadersaver.h.
Constructor & Destructor Documentation
|
inline |
Constructor.
Definition at line 45 of file parametersfileloadersaver.h.
|
inlinevirtual |
Destructor.
Definition at line 52 of file parametersfileloadersaver.h.
Member Function Documentation
bool load | ( | QString | filename, |
ConfigurationParameters & | configParams, | ||
bool | keepOld = false |
||
) |
Load configuration from the given file and store them to ConfigurationParameters.
- Parameters
-
filename the name of the file from which configuration should be loaded configParams the ConfigurationParameters which data will be stored keepOld if true previous parameters are deleted before loading the new ones, otherwise they are kept (however they can be overridden)
- Returns
- true on success, false otherwise
Definition at line 28 of file parametersfileloadersaver.cpp.
References ConfigurationParameters::clearAll(), and ParametersFileLoaderSaver::loadParameters().
|
protectedpure virtual |
The function actually load configuration from the given stream.
Implement in subclasses
- Parameters
-
stream the stream from which data should be read
- Returns
- true if loading was successful, false otherwise
Referenced by ParametersFileLoaderSaver::load().
bool save | ( | QString | filename, |
const ConfigurationParameters & | configParams, | ||
bool | append = false |
||
) |
Save configuration from the ConfigurationParameters to the given file.
- Parameters
-
filename the name of the file to which configuration will be saved configParams the ConfigurationParameters to save on file append if true it appends the parameters to the file specified lefting any previous data present on the file untouched; if false, it delete any previous data on file
Definition at line 56 of file parametersfileloadersaver.cpp.
References ParametersFileLoaderSaver::saveParameters().
|
protectedpure virtual |
The function actually save configuration to the given stream.
Implement in subclasses
- Parameters
-
stream the stream to which data should be write
- Returns
- true if loading was successful, false otherwise
Referenced by ParametersFileLoaderSaver::save().
The documentation for this class was generated from the following files:
- configuration/include/parametersfileloadersaver.h
- configuration/src/parametersfileloadersaver.cpp