aboutsummaryrefslogtreecommitdiff
path: root/src/util/system.h
diff options
context:
space:
mode:
authorHennadii Stepanov <32963518+hebasto@users.noreply.github.com>2022-02-04 17:57:51 +0200
committerHennadii Stepanov <32963518+hebasto@users.noreply.github.com>2022-02-09 19:31:16 +0200
commit540ca5111f7dc91a9808e41ccb4446d8dc0a1bec (patch)
tree9d956753b4de73919e9cbf1fd68490bc4440b113 /src/util/system.h
parent5e8e0b3d7f6055e326bda61e60712b530e8920f0 (diff)
downloadbitcoin-540ca5111f7dc91a9808e41ccb4446d8dc0a1bec.tar.xz
util: Add ArgsManager::GetPathArg() function
Co-authored-by: Ryan Ofsky <ryan@ofsky.org>
Diffstat (limited to 'src/util/system.h')
-rw-r--r--src/util/system.h10
1 files changed, 10 insertions, 0 deletions
diff --git a/src/util/system.h b/src/util/system.h
index a8fd21fcaa..6b7bd38cc2 100644
--- a/src/util/system.h
+++ b/src/util/system.h
@@ -265,6 +265,16 @@ 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