mirror of
https://github.com/bitcoin/bitcoin.git
synced 2025-11-12 15:09:59 +01:00
Replace fs::absolute calls with AbsPathJoin calls
This adds better test coverage and will make it easier in #20744 to remove our dependency on the two-argument boost::filesystem::absolute() function which does not have a direct equivalent in C++17.
This commit is contained in:
11
src/fs.h
11
src/fs.h
@@ -21,6 +21,17 @@ namespace fs = boost::filesystem;
|
||||
namespace fsbridge {
|
||||
FILE *fopen(const fs::path& p, const char *mode);
|
||||
|
||||
/**
|
||||
* Helper function for joining two paths
|
||||
*
|
||||
* @param[in] base Base path
|
||||
* @param[in] path Path to combine with base
|
||||
* @returns path unchanged if it is an absolute path, otherwise returns base joined with path. Returns base unchanged if path is empty.
|
||||
* @pre Base path must be absolute
|
||||
* @post Returned path will always be absolute
|
||||
*/
|
||||
fs::path AbsPathJoin(const fs::path& base, const fs::path& path);
|
||||
|
||||
class FileLock
|
||||
{
|
||||
public:
|
||||
|
||||
Reference in New Issue
Block a user