*******************************************************************************/
-#ifndef _SETTINGS_HH_
-#define _SETTINGS_HH_
+#ifndef _MOOF_SETTINGS_HH_
+#define _MOOF_SETTINGS_HH_
/**
- * @file settings.hh
+ * @file Settings.hh
* Load, store, save program settings.
*/
-#include <string>
#include <map>
+#include <string>
-#include "singleton.hh"
-#include "serializable.hh"
+#include <Moof/Singleton.hh>
+#include <Moof/Serializable.hh>
-namespace dc {
+namespace Mf {
-class settings : public singleton<settings>
+class Settings : public Singleton<Settings>
{
public:
- settings() {}
- settings(int argc, char* argv[]);
+ Settings() {}
+ Settings(int argc, char* argv[]);
void parseArgs(int argc, char* argv[]);
bool getNumber(const std::string& key, T& value);
private:
- std::map<std::string,serializable_ptr> map;
+ std::map<std::string,SerializablePtr> map_;
};
template <typename T>
-bool settings::get(const std::string& key, T& value)
+bool Settings::get(const std::string& key, T& value)
{
- std::map<std::string,serializable_ptr>::const_iterator i = map.find(key);
+ std::map<std::string,SerializablePtr>::const_iterator it = map_.find(key);
- if (i != map.end())
+ if (it != map_.end())
{
- serializable_ptr obj = (*i).second;
+ SerializablePtr obj = (*it).second;
return obj->get(value);
}
else
}
template <typename T>
-bool settings::getNumber(const std::string& key, T& value)
+bool Settings::getNumber(const std::string& key, T& value)
{
- std::map<std::string,serializable_ptr>::const_iterator i = map.find(key);
+ std::map<std::string,SerializablePtr>::const_iterator it = map_.find(key);
- if (i != map.end())
+ if (it != map_.end())
{
- serializable_ptr obj = (*i).second;
+ SerializablePtr obj = (*it).second;
return obj->getNumber(value);
}
else
}
}
-} // namepsace dc
-#endif // _SETTINGS_HH_
+} // namepsace Mf
+
+#endif // _MOOF_SETTINGS_HH_
/** vim: set ts=4 sw=4 tw=80: *************************************************/