// $Id: SettingsManager.hh 5830 2006-11-02 19:44:55Z m9710797 $ #ifndef SETTINGSMANAGER_HH #define SETTINGSMANAGER_HH #include "noncopyable.hh" #include #include #include #include namespace openmsx { class Setting; class GlobalCommandController; class XMLElement; class SettingInfo; class SetCompleter; class SettingCompleter; /** Manages all settings. */ class SettingsManager : private noncopyable { private: typedef std::map SettingsMap; SettingsMap settingsMap; public: explicit SettingsManager(GlobalCommandController& commandController); ~SettingsManager(); /** Get a setting by specifying its name. * @return The Setting with the given name, * or NULL if there is no such Setting. */ Setting* getByName(const std::string& name) const; std::string makeUnique(const std::string& name) const; void loadSettings(const XMLElement& config); void saveSettings(XMLElement& config) const; void registerSetting(Setting& setting, const std::string& name); void unregisterSetting(Setting& setting, const std::string& name); private: void getSettingNames(std::set& result) const; Setting& getByName(const std::string& cmd, const std::string& name) const; friend class SettingInfo; friend class SetCompleter; friend class SettingCompleter; const std::auto_ptr settingInfo; const std::auto_ptr setCompleter; const std::auto_ptr incrCompleter; const std::auto_ptr unsetCompleter; }; } // namespace openmsx #endif