changed: use std::filesystem instead of boost::filesystem

since we still support g++-7, where filesystem is marked experimental,
we introduce a wrapper header and expose the namespace to use
as Opm::filesystem.

for gcc we unconditionally link with libstdc++fs in the python bindings.
the setup.py stuff links as c code, not c++ code, so it is not
automatically added on any gcc version. this might prove unportable
later.
This commit is contained in:
Arne Morten Kvarving
2020-02-12 09:12:29 +01:00
parent 679c7a2a5c
commit fb75bcd4e2
38 changed files with 306 additions and 204 deletions

View File

@@ -55,7 +55,7 @@
#include <vector>
#include <boost/date_time/posix_time/posix_time.hpp>
#include <boost/filesystem.hpp>
#include <opm/common/utility/FileSystem.hpp>
using namespace Opm;
@@ -76,16 +76,16 @@ namespace {
{
public:
explicit RSet(std::string base)
: odir_(boost::filesystem::temp_directory_path() /
boost::filesystem::unique_path("rset-%%%%"))
: odir_(Opm::filesystem::temp_directory_path() /
Opm::unique_path("rset-%%%%"))
, base_(std::move(base))
{
boost::filesystem::create_directories(this->odir_);
Opm::filesystem::create_directories(this->odir_);
}
~RSet()
{
boost::filesystem::remove_all(this->odir_);
Opm::filesystem::remove_all(this->odir_);
}
std::string outputDir() const
@@ -99,7 +99,7 @@ namespace {
}
private:
boost::filesystem::path odir_;
Opm::filesystem::path odir_;
std::string base_;
};