21 #ifndef CONFIGURATION_NODE_H
22 #define CONFIGURATION_NODE_H
27 #include <QStringList>
31 class ParameterSettable;
37 enum ObjectCreationStatus {
40 ObjectCreatedNotConfigured,
44 CreatingAndConfiguringObject,
48 ObjectCreatedAndConfigured
77 objectStatus(ObjectNotCreated)
86 objectStatus(other.objectStatus)
152 QList<const ConfigurationNode*> getAncestors()
const;
161 QStringList getAncestorsNames()
const;
179 QString getFullName()
const;
188 return m_name.isNull();
198 return m_caseSensitive;
240 bool deleteNode(QString name);
249 bool renameNode(QString oldName, QString newName);
256 QList<ConfigurationNode*> getChildrenNodesList();
263 QStringList getChildrenList()
const;
273 QStringList getFilteredChildrenList(QRegExp filter)
const;
288 bool setObjectForNode(QString path,
ParameterSettable*
object, ObjectCreationStatus status = ObjectCreatedAndConfigured);
306 ObjectAndStatus getObjectForNode(QString path)
const;
316 bool addParameter(QString name);
346 QString getValue(QString path,
bool alsoMatchParents =
false)
const;
378 ObjectAndStatus getObject(QString path,
bool alsoMatchParents =
false)
const;
388 bool setValue(QString path, QString value);
408 bool deleteParameter(QString name);
416 QStringList getParametersList()
const;
427 QStringList getFilteredParametersList(QRegExp filter)
const;
434 QStringList getObjectParametersList()
const;
443 QStringList getFilteredObjectParametersList(QRegExp filter)
const;
460 const bool m_caseSensitive;
465 const QString m_name;
477 mutable QString m_nullValue;
482 ObjectAndStatus m_object;
487 QMap<QString, ConfigurationNode*> m_children;
492 QStringList m_childrenkeys;
497 QMap<QString, QString> m_parameters;
502 QStringList m_parameterskeys;
507 QMap<QString, ObjectAndStatus> m_objectParameters;
ObjectAndStatus()
Constructor.
This file contains the common type defitions used on the whole framework.
bool isCaseSensitive() const
Returns true if we behave in a case sensitive way.
ObjectAndStatus(const ObjectAndStatus &other)
Copy constructor.
ObjectCreationStatus objectStatus
The status of the object.
bool isNull() const
Returns true if this is a NULL node.
The base for classes that can be configured/saved using a ConfigurationParameters object...
const ConfigurationNode * getParent() const
Returns the parent node.
QString getName() const
Returns the name of the node.
ParameterSettable * object
The object.
The structure with the object for a node and its status.
A node in the configuration tree.
ObjectAndStatus & operator=(const ObjectAndStatus &other)
Copy operator.