Skip to content

Commit a0a222e

Browse files
committed
Replace deprecated Boost Filesystem function
Boost Filesystem basename() function is deprecated since v1.36.0. Also, defining BOOST_FILESYSTEM_NO_DEPRECATED before including filesystem headers is strongly recommended. This prevents inadvertent use of old features, particularly legacy function names, that have been replaced and are going to go away in the future.
1 parent 4f65af9 commit a0a222e

File tree

2 files changed

+2
-1
lines changed

2 files changed

+2
-1
lines changed

src/dbwrapper.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -115,7 +115,7 @@ static leveldb::Options GetOptions(size_t nCacheSize)
115115
}
116116

117117
CDBWrapper::CDBWrapper(const fs::path& path, size_t nCacheSize, bool fMemory, bool fWipe, bool obfuscate)
118-
: m_name(fs::basename(path))
118+
: m_name{path.stem().string()}
119119
{
120120
penv = nullptr;
121121
readoptions.verify_checksums = true;

src/fs.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@
1111
#include <ext/stdio_filebuf.h>
1212
#endif
1313

14+
#define BOOST_FILESYSTEM_NO_DEPRECATED
1415
#include <boost/filesystem.hpp>
1516
#include <boost/filesystem/fstream.hpp>
1617

0 commit comments

Comments
 (0)