00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021 #ifndef CONFIGURATION_HELPER_H
00022 #define CONFIGURATION_HELPER_H
00023
00024 #include "configurationparameters.h"
00025 #include <QVector>
00026
00027 namespace farsa {
00028
00034 class FARSA_CONF_API ConfigurationHelper {
00035 public:
00041 static int getInt( ConfigurationParameters& params, QString paramPath, int def = 0 );
00042
00048 static unsigned int getUnsignedInt( ConfigurationParameters& params, QString paramPath, unsigned int def = 0 );
00049
00055 static double getDouble( ConfigurationParameters& params, QString paramPath, double def = 0 );
00056
00073 static bool getBool( ConfigurationParameters& params, QString paramPath, bool def = false );
00074
00082 static QString getString( ConfigurationParameters& params, QString paramPath, QString def = QString() );
00083
00089 static QStringList getStringList( ConfigurationParameters& params, QString paramPath, QString delimiter = QString(" ") );
00090
00107 static QVector<double> getVector( ConfigurationParameters& params, QString paramPath );
00108
00112 static bool hasGroup( ConfigurationParameters& params, QString group );
00113
00119 static bool hasParameter( ConfigurationParameters& params, QString group, QString paramName );
00120
00132 static void throwUserConfigError(QString paramName, QString paramValue, QString description);
00133
00144 static void throwUserMissingResourceError(QString resourceName, QString description);
00145
00146 private:
00148 ConfigurationHelper() { };
00149 };
00150
00151 }
00152
00153 #endif