]> Dogcows Code - chaz/yoink/blobdiff - src/Moof/Settings.hh
extreme refactoring
[chaz/yoink] / src / Moof / Settings.hh
similarity index 75%
rename from src/settings.hh
rename to src/Moof/Settings.hh
index f2a7aedc4151ee9ee60336cdc9b0d23fae7eef22..9c29007613f90d6b35a7c8500208581dae05a5a5 100644 (file)
 
 *******************************************************************************/
 
-#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[]);
 
@@ -62,18 +62,18 @@ public:
        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
@@ -83,13 +83,13 @@ bool settings::get(const std::string& key, T& value)
 }
 
 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
@@ -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: *************************************************/
 
This page took 0.024177 seconds and 4 git commands to generate.