configurationparameters.cpp
47 bool ConfigurationParameters::registerFileFormat(QString format, ParametersFileLoaderSaver *fileLoaderSaver, QString defaultExtension)
92 ConfigurationParameters& ConfigurationParameters::operator=(const ConfigurationParameters &other)
134 QStringList ConfigurationParameters::getGroupsWithPrefixList(QString group, QString prefix) const
137 QRegExp filter(QString("^") + QRegExp::escape(prefix), (isCaseSensitive() ? Qt::CaseSensitive : Qt::CaseInsensitive));
150 QStringList splittedPath = groupPath.split(ConfigurationParameters::GroupSeparator(), QString::SkipEmptyParts, Qt::CaseSensitive);
207 bool ConfigurationParameters::startObjectParameters(QString groupPath, QString typeName, ParameterSettable* object)
239 QStringList ConfigurationParameters::getParametersWithPrefixList(QString group, QString prefix) const
242 QRegExp filter(QString("^") + QRegExp::escape(prefix), (isCaseSensitive() ? Qt::CaseSensitive : Qt::CaseInsensitive));
247 QStringList ConfigurationParameters::getFilteredParametersList(QString group, QRegExp filter) const
287 // We perform the update in two steps: first of all we create a map from pointers to group paths;
454 void ConfigurationParameters::copyNode(const ConfigurationNode *source, ConfigurationNode *target)
481 bool ConfigurationParameters::setObjectFromGroupStatusToCreatedNotConfigured(QString group, ParameterSettable *object)
505 bool ConfigurationParameters::setObjectFromGroupStatusToCreatedAndConfigured(QString group, ParameterSettable *object)
void stopRememberingGroupObjectAssociations()
Stops remembering associations between groups and objects.
Definition: configurationparameters.cpp:257
A simple class to access/declare resources (not thread-safe)
Definition: resourcesuser.h:227
bool isCaseSensitive() const
Returns true if we are case sensistive, false otherwise.
Definition: configurationparameters.cpp:119
QStringList getFilteredParametersList(QString group, QRegExp filter) const
Returns the list of parameters in the given group whose name matches the given regular expression...
Definition: configurationparameters.cpp:247
bool loadParameters(QString filename, bool keepOld=false, QString format="")
Loads a configuration file.
Definition: configurationparameters.cpp:360
bool copyGroupTree(QString sourceGroup, QString destGroup)
Copy a group tree to another location.
Definition: configurationparameters.cpp:177
ConfigurationParameters(bool caseSensitive=false)
Constructor.
Definition: configurationparameters.cpp:70
bool setValue(QString path, QString value)
Sets the value of the parameter with the given path.
Definition: configurationparameters.cpp:224
Definition: configurationhelper.cpp:24
The class containing configuration parameters.
Definition: configurationparameters.h:259
ObjectAndStatus getObjectForNode(QString path) const
Returns the object corresponding to the given node.
Definition: configurationnode.cpp:248
The base for classes that can be configured/saved using a ConfigurationParameters object...
Definition: parametersettable.h:51
QStringList getParametersWithPrefixList(QString group, QString prefix) const
Returns the list of parameters in the given group whose name starts with the provided string...
Definition: configurationparameters.cpp:239
void updateObjectReferences()
Updates all object references to point to actual groups.
Definition: configurationparameters.cpp:285
QString getFullName() const
Returns the full name of the node (i.e. the full path from root to this node)
Definition: configurationnode.cpp:89
bool deleteGroup(QString groupPath)
Delete the last group in the path specified.
Definition: configurationparameters.cpp:159
QList< ConfigurationNode * > getChildrenNodesList()
Returns the list of child nodes.
Definition: configurationnode.cpp:209
SimpleResourcesUser * getResourcesUserForResource(QString resourceName)
Returns the resouce user holding the resource with the given name.
Definition: configurationparameters.cpp:407
void shareObserversWith(ConfigurationParameters ¶ms)
share the FactoryObservers with an another ConfigurationParameters
Definition: configurationparameters.cpp:429
void createGroup(QString groupPath)
Create a group in the path specified.
Definition: configurationparameters.cpp:147
ObjectAndStatus getObject(QString path, bool alsoMatchParents=false) const
Returns the object to which the parameter with the given path refer.
Definition: configurationnode.cpp:336
void resetGroupObjectAssociations()
Resets all associations between groups and objects.
Definition: configurationparameters.cpp:262
bool startObjectParameters(QString groupPath, QString typeName, ParameterSettable *object)
Initializes a group so that it corresponds to the given object.
Definition: configurationparameters.cpp:207
FactoryObserver class to keep trace on operations done by Factory.
Definition: factoryobserver.h:36
void deleteParameter(QString groupPath, QString parameter)
Delete a parameter in the group path specified.
Definition: configurationparameters.cpp:200
bool saveParameters(QString filename, QString format="", bool append=false)
Saves a configuration file.
Definition: configurationparameters.cpp:382
QString getValue(QString path, bool alsoMatchParents=false) const
Returns a parameter value.
Definition: configurationparameters.cpp:219
The structure with the object for a node and its status.
Definition: configurationnode.h:70
bool setValue(QString path, QString value)
Sets the value of the parameter with the given path.
Definition: configurationnode.cpp:393
bool renameGroup(QString oldGroupPath, QString newGroupName)
Rename the last group in the path specified with the new name.
Definition: configurationparameters.cpp:168
static bool registerFileFormat(QString format, ParametersFileLoaderSaver *fileLoaderSaver, QString defaultExtension)
The function to register file formats to use when loading or saving parameters from/to file...
Definition: configurationparameters.cpp:47
QStringList getGroupsWithPrefixList(QString group, QString prefix) const
Returns the list of sub-groups in the given group whose name starts with the provided string...
Definition: configurationparameters.cpp:134
QStringList getFilteredGroupsList(QString group, QRegExp filter) const
Returns the list of sub-groups in the given group whose name matches the given regular expression...
Definition: configurationparameters.cpp:142
QStringList getGroupsList(QString group) const
Returns the list of sub-groups in the given group.
Definition: configurationparameters.cpp:129
void setResourcesUser(ResourcesUser *resourcesUser)
Registers a new resource user.
Definition: configurationparameters.cpp:419
void addObserver(FactoryObserver *observer)
Add a new observer.
Definition: configurationparameters.cpp:424
void clearAll()
Delete all parameters in all groups and subgroups.
Definition: configurationparameters.cpp:124
void startRememberingGroupObjectAssociations()
Starts remembering associations between groups and objects.
Definition: configurationparameters.cpp:252
static QString GroupSeparator()
The character used to split path in groups.
Definition: configurationparameters.h:268
ConfigurationNode * addNode(QString name)
Adds a child node with the given name and returns a pointer to it.
Definition: configurationnode.cpp:103
QStringList getParametersList(QString group) const
Returns the list of parameters in the given group.
Definition: configurationparameters.cpp:234
void createParameter(QString groupPath, QString parameter)
Create a parameter in the group path specified.
Definition: configurationparameters.cpp:192
The exception thrown when trying to copy a ConfigurationParameter.
Definition: configurationexceptions.h:683
ConfigurationParameters & operator=(const ConfigurationParameters &other)
Assignment operator.
Definition: configurationparameters.cpp:92
QStringList getObjectParametersList() const
Returns the list of parameters referring to objects.
Definition: configurationnode.cpp:494
The base for all classes able to load/save configuration parameters from/to file. ...
Definition: parametersfileloadersaver.h:39