Remove some cruft from option.h

This commit is contained in:
Thomas Goyne 2012-12-16 13:18:18 -08:00
parent 4c6be1fe55
commit eab11666a9
2 changed files with 6 additions and 10 deletions

View File

@ -21,8 +21,6 @@
#include "libaegisub/option.h" #include "libaegisub/option.h"
#include <cassert> #include <cassert>
#include <fstream>
#include <map>
#include <memory> #include <memory>
#include <sstream> #include <sstream>
@ -69,7 +67,9 @@ namespace {
namespace agi { namespace agi {
Options::Options(const std::string &file, const std::string& default_config, const OptionSetting setting) Options::Options(const std::string &file, const std::string& default_config, const OptionSetting setting)
: config_file(file), setting(setting) { : config_file(file)
, setting(setting)
{
LOG_D("agi/options") << "New Options object"; LOG_D("agi/options") << "New Options object";
std::istringstream stream(default_config); std::istringstream stream(default_config);
LoadConfig(stream); LoadConfig(stream);
@ -127,7 +127,7 @@ OptionValue* Options::Get(const std::string &name) {
throw OptionErrorNotFound("Option value not found: " + name); throw OptionErrorNotFound("Option value not found: " + name);
} }
void Options::Flush() { void Options::Flush() const {
json::Object obj_out; json::Object obj_out;
for (auto const& ov : values) { for (auto const& ov : values) {

View File

@ -59,12 +59,8 @@ private:
/// Internal OptionValueMap /// Internal OptionValueMap
OptionValueMap values; OptionValueMap values;
/// @brief Create option object.
/// @param path Path to store
::json::Object CreateObject(std::string path);
/// User config (file that will be written to disk) /// User config (file that will be written to disk)
std::string config_file; const std::string config_file;
/// Settings. /// Settings.
const OptionSetting setting; const OptionSetting setting;
@ -101,7 +97,7 @@ public:
void ConfigUser(); void ConfigUser();
/// Write the user configuration to disk, throws an exception if something goes wrong. /// Write the user configuration to disk, throws an exception if something goes wrong.
void Flush(); void Flush() const;
}; };
} // namespace agi } // namespace agi