aboutsummaryrefslogtreecommitdiff
path: root/src/util/system.h
diff options
context:
space:
mode:
authorRussell Yanofsky <russ@yanofsky.org>2019-11-12 13:47:19 -0500
committerRussell Yanofsky <russ@yanofsky.org>2019-11-13 04:20:30 -0500
commit3e185522ace1678e0a25b9cf8a5553a4bc279bea (patch)
tree681c0aec38c32ed881cc18bcb7a9eae365b0a434 /src/util/system.h
parentdc0f1480746b34aa3ca2d9c0f1ec764083026b40 (diff)
downloadbitcoin-3e185522ace1678e0a25b9cf8a5553a4bc279bea.tar.xz
refactor: Get rid of ArgsManagerHelper class
Suggested by John Newbery <john@johnnewbery.com> https://github.com/bitcoin/bitcoin/pull/15934#issuecomment-551969778 This commit does not change behavior.
Diffstat (limited to 'src/util/system.h')
-rw-r--r--src/util/system.h18
1 files changed, 16 insertions, 2 deletions
diff --git a/src/util/system.h b/src/util/system.h
index d02d3f274a..4db3028196 100644
--- a/src/util/system.h
+++ b/src/util/system.h
@@ -148,8 +148,6 @@ public:
};
protected:
- friend class ArgsManagerHelper;
-
struct Arg
{
std::string m_help_param;
@@ -166,6 +164,22 @@ protected:
NODISCARD bool ReadConfigStream(std::istream& stream, const std::string& filepath, std::string& error, bool ignore_invalid_keys = false);
+ /**
+ * Returns true if settings values from the default section should be used,
+ * depending on the current network and whether the setting is
+ * network-specific.
+ */
+ bool UseDefaultSection(const std::string& arg) const EXCLUSIVE_LOCKS_REQUIRED(cs_args);
+
+ /**
+ * Get setting value.
+ *
+ * Result will be null if setting was unset, true if "-setting" argument was passed
+ * false if "-nosetting" argument was passed, and a string if a "-setting=value"
+ * argument was passed.
+ */
+ util::SettingsValue GetSetting(const std::string& arg) const;
+
public:
ArgsManager();