]> Dogcows Code - chaz/yoink/blobdiff - src/Moof/Settings.cc
the massive refactoring effort
[chaz/yoink] / src / Moof / Settings.cc
diff --git a/src/Moof/Settings.cc b/src/Moof/Settings.cc
deleted file mode 100644 (file)
index 5846430..0000000
+++ /dev/null
@@ -1,107 +0,0 @@
-
-/*]  Copyright (c) 2009-2010, Charles McGarvey  [**************************
-**]  All rights reserved.
-*
-* vi:ts=4 sw=4 tw=75
-*
-* Distributable under the terms and conditions of the 2-clause BSD license;
-* see the file COPYING for a complete text of the license.
-*
-**************************************************************************/
-
-#include <cstdlib>             // getenv
-
-#include "Settings.hh"
-
-
-namespace Mf {
-
-
-Settings::~Settings()
-{
-       save();
-}
-
-
-void Settings::parseArgs(int argc, char* argv[])
-{
-       for (int i = 1; i < argc; ++i)
-       {
-               if (mScript.doString(argv[i]) != Script::SUCCESS)
-               {
-                       std::string str;
-                       mScript[-1].get(str);
-                       logWarning << "invalid option: " << argv[i]
-                                          << ": " << str << std::endl;
-                       mScript.clearStack();
-               }
-       }
-}
-
-
-void Settings::loadFromFiles(const std::string& path)
-{
-       std::vector<std::string> paths;
-       boost::split(paths, path, boost::is_any_of(":"));
-
-       loadFromFiles(paths);
-}
-
-void Settings::loadFromFiles(const std::vector<std::string>& path)
-{
-       std::vector<std::string> copy(path);
-       std::vector<std::string>::iterator it;
-
-#if defined(_WIN32)
-       char* homeDrive = getenv("HOMEDRIVE");
-       char* homePath = getenv("HOMEPATH");
-       std::string home(homeDrive ? homeDrive : "");
-       if (homePath) home += homePath;
-#else
-       char *homePath = getenv("HOME");
-       std::string home(homePath ? homePath : "");
-#endif
-
-       for (it = copy.begin(); it != copy.end(); ++it)
-       {
-               if (!home.empty())
-               {
-                       boost::replace_all(*it, "$HOME", home);
-
-                       //Mf::logDebug("Copying global settings...");
-                       //mUserFile = *it;
-                       //mGlobals.pushCopy();
-                       //mScript.set("globals", Script::REGISTRY);
-               }
-
-               if (mScript.doFile(*it) != Script::SUCCESS)
-               {
-                       std::string str;
-                       mScript[-1].get(str);
-                       logWarning(str);
-                       mScript.clearStack();
-               }
-       }
-}
-
-
-void Settings::clear()
-{
-       mScript.reset();
-}
-
-
-void Settings::saveAs(const std::string& path)
-{
-       mUserFile = path;
-       save();
-}
-
-void Settings::save() const
-{
-       // TODO saving settings not yet implemented
-}
-
-
-} // namepsace Mf
-
This page took 0.023611 seconds and 4 git commands to generate.