configurationhelper.cpp
37 unsigned int ConfigurationHelper::getUnsignedInt( ConfigurationParameters& params, QString paramPath, unsigned int def ) {
48 double ConfigurationHelper::getDouble( ConfigurationParameters& params, QString paramPath, double def ) {
59 bool ConfigurationHelper::getBool( ConfigurationParameters& params, QString paramPath, bool def ) {
71 QString ConfigurationHelper::getString( ConfigurationParameters& params, QString paramPath, QString def ) {
79 QStringList ConfigurationHelper::getStringList( ConfigurationParameters& params, QString paramPath, QString delimiter ) {
83 QVector<double> ConfigurationHelper::getVector( ConfigurationParameters& params, QString paramPath, QString def ) {
98 QVector<int> ConfigurationHelper::getIntegerVector(ConfigurationParameters& params, QString paramPath, QString def) {
117 QVector<unsigned int> ConfigurationHelper::getUnsignedIntegerVector(ConfigurationParameters& params, QString paramPath, QString def) {
136 QVector<bool> ConfigurationHelper::getBoolVector(ConfigurationParameters& params, QString paramPath, QString def) {
155 // If a string doesn't contain any colon, it always follows the other string; this way strings without colons are always
177 if ( groupName.compare( agroup, (params.isCaseSensitive() ? Qt::CaseSensitive : Qt::CaseInsensitive) ) == 0 ) {
184 bool ConfigurationHelper::hasParameter( ConfigurationParameters& params, QString group, QString paramName ) {
188 void ConfigurationHelper::throwUserConfigError(QString paramName, QString paramValue, QString description)
190 throw UserDefinedCheckFailureException(paramName.toLatin1().data(), paramValue.toLatin1().data(), description.toLatin1().data());
193 void ConfigurationHelper::throwUserMissingResourceError(QString resourceName, QString description)
195 throw UserRequiredResourceMissingException(resourceName.toLatin1().data(), description.toLatin1().data());
static QString fullSubgroupDescriptionPath(QString type, QString sub)
helper function for creating the full path to a subgroup description
Definition: parametersettable.cpp:90
static ConfigurationParameters & getTypeDescriptions()
Returns the only instance of the typeDescriptions object.
Definition: factory.cpp:34
bool isCaseSensitive() const
Returns true if we are case sensistive, false otherwise.
Definition: configurationparameters.cpp:119
static void throwUserMissingResourceError(QString resourceName, QString description)
A utility function to ease throwing the exception UserRequiredResourceMissingException.
Definition: configurationhelper.cpp:193
static QVector< double > getVector(ConfigurationParameters ¶ms, QString paramPath, QString def=QString())
Return a QVector of double from the parameters specified It helps on parsing parameters like: ...
Definition: configurationhelper.cpp:83
static QString getString(ConfigurationParameters ¶ms, QString paramPath, QString def=QString())
Return the value of parameter as QString, if the parameter has not been setted, it will return the de...
Definition: configurationhelper.cpp:71
static bool isRuntimeParameter(QString type, QString paramName)
Returns true if the parameter can be modified at runtime using ParameterSettable::setRuntimeParameter...
Definition: configurationhelper.cpp:215
static QString getParameterTypeName(QString type, QString paramName)
return the type of the parameter as declared in Factory::getTypeDescriptions()
Definition: configurationhelper.cpp:208
Definition: configurationhelper.cpp:24
The class containing configuration parameters.
Definition: configurationparameters.h:259
static QStringList getDescribedParameterNames(QString type, QString prefix=QString())
return the list of all parameter's type described in Factory::getTypeDescriptions() ...
Definition: configurationhelper.cpp:198
static QString fullParameterDescriptionPath(QString type, QString param)
helper function for creating the full path to a parameter description
Definition: parametersettable.cpp:80
static QStringList getDescribedSubgroupNames(QString type, QString prefix=QString())
return the list of all subgroup's type described in Factory::getTypeDescriptions() ...
Definition: configurationhelper.cpp:203
static void throwUserConfigError(QString paramName, QString paramValue, QString description)
A utility function to ease throwing the exception UserDefinedCheckFailureException.
Definition: configurationhelper.cpp:188
The exception to throw when a user check on a parameter fails.
Definition: configurationexceptions.h:1119
static QVector< int > getIntegerVector(ConfigurationParameters ¶ms, QString paramPath, QString def=QString())
Returns a vector of integers from the specified parameter.
Definition: configurationhelper.cpp:98
static bool getBool(ConfigurationParameters ¶ms, QString paramPath, bool def=false)
Return the value of parameter as boolean, if the parameter has not been setted or the value is not a ...
Definition: configurationhelper.cpp:59
static double getDouble(ConfigurationParameters ¶ms, QString paramPath, double def=0)
Return the value of parameter as double, if the parameter has not been setted or the value is not an ...
Definition: configurationhelper.cpp:48
The exception to throw when a user needs a resouce during configuration which doesn't exist...
Definition: configurationexceptions.h:1606
static QVector< unsigned int > getUnsignedIntegerVector(ConfigurationParameters ¶ms, QString paramPath, QString def=QString())
Returns a vector of unsigned integers from the specified parameter.
Definition: configurationhelper.cpp:117
QString getValue(QString path, bool alsoMatchParents=false) const
Returns a parameter value.
Definition: configurationparameters.cpp:219
static unsigned int getUnsignedInt(ConfigurationParameters ¶ms, QString paramPath, unsigned int def=0)
Return the value of parameter as unsigned integer, if the parameter has not been setted or the value ...
Definition: configurationhelper.cpp:37
static QVector< bool > getBoolVector(ConfigurationParameters ¶ms, QString paramPath, QString def=QString())
Returns a vector of booleans from the specified parameter.
Definition: configurationhelper.cpp:136
static QStringList getStringList(ConfigurationParameters ¶ms, QString paramPath, QString delimiter=QString(" "))
Return the value of parameter as QStringList, if the parameter has not been setted, it will return an empty QStringList.
Definition: configurationhelper.cpp:79
static bool orderByNumberAfterColon(const QString &s1, const QString &s2)
Helper function to order a list of groups name by the number following a colon.
Definition: configurationhelper.cpp:154
QStringList getGroupsList(QString group) const
Returns the list of sub-groups in the given group.
Definition: configurationparameters.cpp:129
static QStringList getParameterEnumValues(QString type, QString paramName)
return the possible enum values as QStringList for the parameter
Definition: configurationhelper.cpp:230
static bool hasParameter(ConfigurationParameters ¶ms, QString group, QString paramName)
Return true if the parameter exist and is not empty into the group.
Definition: configurationhelper.cpp:184
static bool parameterIsDouble(QString type, QString paramName)
return true if the real parameter is double, otherwise return false
Definition: configurationhelper.cpp:222
static int getInt(ConfigurationParameters ¶ms, QString paramPath, int def=0)
Return the value of parameter as integer, if the parameter has not been setted or the value is not an...
Definition: configurationhelper.cpp:26
static bool hasGroup(ConfigurationParameters ¶ms, QString group)
Return true if the group exists.
Definition: configurationhelper.cpp:171