From 0e55bc6e7fe439404dc56093a0949395dae51e6b Mon Sep 17 00:00:00 2001 From: Ryan Ofsky Date: Mon, 29 Apr 2019 15:29:00 -0400 Subject: settings: Add update/getPersistent/isIgnored methods Add interfaces::Node methods to give GUI finer grained control over settings.json file. Update method is used to write settings to the file, getPersistent and isIgnored methods are used to find out about settings file and command line option interactions. --- src/util/system.h | 10 ++++++++++ 1 file changed, 10 insertions(+) (limited to 'src/util/system.h') diff --git a/src/util/system.h b/src/util/system.h index a7f4d16911..bfc9698221 100644 --- a/src/util/system.h +++ b/src/util/system.h @@ -161,6 +161,10 @@ struct SectionInfo int m_line; }; +std::string SettingToString(const util::SettingsValue&, const std::string&); +int64_t SettingToInt(const util::SettingsValue&, int64_t); +bool SettingToBool(const util::SettingsValue&, bool); + class ArgsManager { public: @@ -448,6 +452,12 @@ protected: */ bool WriteSettingsFile(std::vector* errors = nullptr) const; + /** + * Get current setting from config file or read/write settings file, + * ignoring nonpersistent command line or forced settings values. + */ + util::SettingsValue GetPersistentSetting(const std::string& name) const; + /** * Access settings with lock held. */ -- cgit v1.2.3