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.
pull/764/head
Hennadii Stepanov 6 years ago
parent 4f65af97b4
commit a0a222eec0
No known key found for this signature in database
GPG Key ID: 410108112E7EA81F

@ -115,7 +115,7 @@ static leveldb::Options GetOptions(size_t nCacheSize)
} }
CDBWrapper::CDBWrapper(const fs::path& path, size_t nCacheSize, bool fMemory, bool fWipe, bool obfuscate) CDBWrapper::CDBWrapper(const fs::path& path, size_t nCacheSize, bool fMemory, bool fWipe, bool obfuscate)
: m_name(fs::basename(path)) : m_name{path.stem().string()}
{ {
penv = nullptr; penv = nullptr;
readoptions.verify_checksums = true; readoptions.verify_checksums = true;

@ -11,6 +11,7 @@
#include <ext/stdio_filebuf.h> #include <ext/stdio_filebuf.h>
#endif #endif
#define BOOST_FILESYSTEM_NO_DEPRECATED
#include <boost/filesystem.hpp> #include <boost/filesystem.hpp>
#include <boost/filesystem/fstream.hpp> #include <boost/filesystem/fstream.hpp>

Loading…
Cancel
Save