diff options
author | Kiminuo <kiminuo@protonmail.com> | 2021-05-22 14:55:38 +0200 |
---|---|---|
committer | Kiminuo <kiminuo@protonmail.com> | 2021-05-24 10:29:55 +0200 |
commit | 0f53df47d5b8319fc71f3b87c15a115ff797fb50 (patch) | |
tree | efa12325b165fe5f85bb926c69001e98cb0d45b9 /src/util/system.h | |
parent | 716de29dd8672d28bfe0a08424e9958fe61054d2 (diff) | |
download | bitcoin-0f53df47d5b8319fc71f3b87c15a115ff797fb50.tar.xz |
Add `ArgsManager.GetDataDirBase()` and `ArgsManager.GetDataDirNet()` as an intended replacement for `ArgsManager.GetDataDirPath(net_identifier)`
Diffstat (limited to 'src/util/system.h')
-rw-r--r-- | src/util/system.h | 18 |
1 files changed, 17 insertions, 1 deletions
diff --git a/src/util/system.h b/src/util/system.h index 88a217f71d..fcbbd24e83 100644 --- a/src/util/system.h +++ b/src/util/system.h @@ -119,7 +119,7 @@ UniValue RunCommandParseJSON(const std::string& str_command, const std::string& * the datadir if they are not absolute. * * @param path The path to be conditionally prefixed with datadir. - * @param net_specific Forwarded to GetDataDir(). + * @param net_specific Use network specific datadir variant * @return The normalized path. */ fs::path AbsPathForConfigVal(const fs::path& path, bool net_specific = true); @@ -271,6 +271,22 @@ public: /** * Get data directory path * + * @return Absolute path on success, otherwise an empty path when a non-directory path would be returned + * @post Returned directory path is created unless it is empty + */ + const fs::path& GetDataDirBase() const { return GetDataDirPath(false); } + + /** + * Get data directory path with appended network identifier + * + * @return Absolute path on success, otherwise an empty path when a non-directory path would be returned + * @post Returned directory path is created unless it is empty + */ + const fs::path& GetDataDirNet() const { return GetDataDirPath(true); } + + /** + * Get data directory path + * * @param net_specific Append network identifier to the returned path * @return Absolute path on success, otherwise an empty path when a non-directory path would be returned * @post Returned directory path is created unless it is empty |