X-Git-Url: https://git.dogcows.com/gitweb?p=chaz%2Fyoink;a=blobdiff_plain;f=src%2FMoof%2FSettings.hh;fp=src%2Fsettings.hh;h=9c29007613f90d6b35a7c8500208581dae05a5a5;hp=f2a7aedc4151ee9ee60336cdc9b0d23fae7eef22;hb=c2321281bf12a7efaedde930422c7ddbc92080d4;hpb=87bc17e55b0c1dc73ecc66df856d3f08fd7a7724 diff --git a/src/settings.hh b/src/Moof/Settings.hh similarity index 75% rename from src/settings.hh rename to src/Moof/Settings.hh index f2a7aed..9c29007 100644 --- a/src/settings.hh +++ b/src/Moof/Settings.hh @@ -26,29 +26,29 @@ *******************************************************************************/ -#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 #include +#include -#include "singleton.hh" -#include "serializable.hh" +#include +#include -namespace dc { +namespace Mf { -class settings : public singleton +class Settings : public Singleton { public: - settings() {} - settings(int argc, char* argv[]); + Settings() {} + Settings(int argc, char* argv[]); void parseArgs(int argc, char* argv[]); @@ -62,18 +62,18 @@ public: bool getNumber(const std::string& key, T& value); private: - std::map map; + std::map map_; }; template -bool settings::get(const std::string& key, T& value) +bool Settings::get(const std::string& key, T& value) { - std::map::const_iterator i = map.find(key); + std::map::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 @@ -83,13 +83,13 @@ bool settings::get(const std::string& key, T& value) } template -bool settings::getNumber(const std::string& key, T& value) +bool Settings::getNumber(const std::string& key, T& value) { - std::map::const_iterator i = map.find(key); + std::map::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 @@ -98,9 +98,10 @@ bool settings::getNumber(const std::string& key, T& value) } } -} // namepsace dc -#endif // _SETTINGS_HH_ +} // namepsace Mf + +#endif // _MOOF_SETTINGS_HH_ /** vim: set ts=4 sw=4 tw=80: *************************************************/