-/*] Copyright (c) 2009-2010, Charles McGarvey [**************************
+/*] Copyright (c) 2009-2011, 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.
*
-**************************************************************************/
+*****************************************************************************/
#ifndef _MOOF_SETTINGS_HH_
#define _MOOF_SETTINGS_HH_
-/**
- * \file settings.hh
- * Load, store, save program settings.
- */
-
#include <string>
#include <vector>
#include <moof/script.hh>
+/**
+ * \file settings.hh
+ * Load, store, save program settings.
+ */
+
namespace moof {
public:
settings(int argc, char* argv[], const std::string& path);
-
~settings();
void parse_args(int argc, char* argv[]);
void load_files(const std::string& path);
void load_files(const std::vector<std::string>& path);
-
/**
* Remove all settings.
*/
void save_as(const std::string& path);
void save() const;
-
/**
* Get a setting by name.
* \param key The name of the setting.
template <class T>
bool get(const std::string& key, T& value) const;
-
private:
mutable script script_;
-
- std::string mUserFile;
+ std::string userfile_;
};
-
template <class T>
bool settings::get(const std::string& key, T& value) const
{