aboutsummaryrefslogtreecommitdiff
path: root/src/util/getuniquepath.h
diff options
context:
space:
mode:
authorKiminuo <kiminuo@protonmail.com>2021-02-01 13:35:28 +0100
committerKiminuo <kiminuo@protonmail.com>2021-02-04 11:38:09 +0100
commit1bca2aa694cd85984c09699ae28daec313077462 (patch)
treedd3ea392cf4379cb03e1476736c5e968c759129e /src/util/getuniquepath.h
parentea5a50f92a6ff81b1d2dd67cdc3663e0e66733ac (diff)
downloadbitcoin-1bca2aa694cd85984c09699ae28daec313077462.tar.xz
Introduce GetUniquePath(base) helper method to replace boost::filesystem::unique_path() which is not available in std::filesystem.
Diffstat (limited to 'src/util/getuniquepath.h')
-rw-r--r--src/util/getuniquepath.h19
1 files changed, 19 insertions, 0 deletions
diff --git a/src/util/getuniquepath.h b/src/util/getuniquepath.h
new file mode 100644
index 0000000000..e0c6147876
--- /dev/null
+++ b/src/util/getuniquepath.h
@@ -0,0 +1,19 @@
+// Copyright (c) 2021 The Bitcoin Core developers
+// Distributed under the MIT software license, see the accompanying
+// file COPYING or http://www.opensource.org/licenses/mit-license.php.
+
+#ifndef BITCOIN_UTIL_GETUNIQUEPATH_H
+#define BITCOIN_UTIL_GETUNIQUEPATH_H
+
+#include <fs.h>
+
+/**
+ * Helper function for getting a unique path
+ *
+ * @param[in] base Base path
+ * @returns base joined with a random 8-character long string.
+ * @post Returned path is unique with high probability.
+ */
+fs::path GetUniquePath(const fs::path& base);
+
+#endif // BITCOIN_UTIL_GETUNIQUEPATH_H \ No newline at end of file