aboutsummaryrefslogtreecommitdiff
path: root/src/util/system.h
diff options
context:
space:
mode:
Diffstat (limited to 'src/util/system.h')
-rw-r--r--src/util/system.h22
1 files changed, 12 insertions, 10 deletions
diff --git a/src/util/system.h b/src/util/system.h
index f193c8ac0b..a66b597d41 100644
--- a/src/util/system.h
+++ b/src/util/system.h
@@ -271,16 +271,6 @@ protected:
std::optional<const Command> GetCommand() const;
/**
- * Get a normalized path from a specified pathlike argument
- *
- * It is guaranteed that the returned path has no trailing slashes.
- *
- * @param pathlike_arg Pathlike argument to get a path from (e.g., "-datadir", "-blocksdir" or "-walletdir")
- * @return Normalized path which is get from a specified pathlike argument
- */
- fs::path GetPathArg(std::string pathlike_arg) const;
-
- /**
* Get blocks directory path
*
* @return Blocks path which is network specific
@@ -343,6 +333,18 @@ protected:
std::string GetArg(const std::string& strArg, const std::string& strDefault) const;
/**
+ * Return path argument or default value
+ *
+ * @param arg Argument to get a path from (e.g., "-datadir", "-blocksdir" or "-walletdir")
+ * @param default_value Optional default value to return instead of the empty path.
+ * @return normalized path if argument is set, with redundant "." and ".."
+ * path components and trailing separators removed (see patharg unit test
+ * for examples or implementation for details). If argument is empty or not
+ * set, default_value is returned unchanged.
+ */
+ fs::path GetPathArg(std::string arg, const fs::path& default_value = {}) const;
+
+ /**
* Return integer argument or default value
*
* @param strArg Argument to get (e.g. "-foo")