From 0f5623b3654fb7bca0b192086384012c13ea4947 Mon Sep 17 00:00:00 2001 From: Dan Goodliffe Date: Sun, 3 Feb 2019 12:17:31 +0000 Subject: Remove boost::filesystem in favour of std::filesystem --- icetray/Jamfile.jam | 1 - icetray/dryice/Jamfile.jam | 1 - icetray/icetray/Jamfile.jam | 1 - icetray/tool/Jamfile.jam | 8 +++----- icetray/tool/icetraySql.cpp | 15 +++++++-------- icetray/unittests/Jamfile.jam | 7 +++---- 6 files changed, 13 insertions(+), 20 deletions(-) diff --git a/icetray/Jamfile.jam b/icetray/Jamfile.jam index 83ad692..f6df0c9 100644 --- a/icetray/Jamfile.jam +++ b/icetray/Jamfile.jam @@ -8,7 +8,6 @@ lib pthread ; lib dl ; lib IceBox++11 ; lib dbppcore : : : : /usr/include/dbpp ; -lib boost_system ; lib boost_thread ; build-project unittests ; diff --git a/icetray/dryice/Jamfile.jam b/icetray/dryice/Jamfile.jam index 15d00fd..d17c9c9 100644 --- a/icetray/dryice/Jamfile.jam +++ b/icetray/dryice/Jamfile.jam @@ -9,7 +9,6 @@ lib dryice : ..//Ice++11 ..//IceBox++11 ..//pthread - ..//boost_system ..//boost_thread ../icetray//icetray : : diff --git a/icetray/icetray/Jamfile.jam b/icetray/icetray/Jamfile.jam index 51e5d69..cba31bb 100644 --- a/icetray/icetray/Jamfile.jam +++ b/icetray/icetray/Jamfile.jam @@ -12,7 +12,6 @@ lib icetray : ..//pthread ..//slicer ..//slicer-db - ..//boost_system ..//boost_thread ../..//glibmm boost_program_options diff --git a/icetray/tool/Jamfile.jam b/icetray/tool/Jamfile.jam index 9f6caff..9d53f4e 100644 --- a/icetray/tool/Jamfile.jam +++ b/icetray/tool/Jamfile.jam @@ -1,17 +1,15 @@ import package ; lib boost_program_options ; -lib boost_filesystem ; -lib boost_system ; +lib stdc++fs ; lib dl ; exe icetray-sql : icetraySql.cpp : boost_program_options - boost_filesystem - boost_system - /usr/include/adhocutil/ + stdc++fs + ..//adhocutil ; exe icetray-doc : diff --git a/icetray/tool/icetraySql.cpp b/icetray/tool/icetraySql.cpp index 8663c8b..3b3d1d9 100644 --- a/icetray/tool/icetraySql.cpp +++ b/icetray/tool/icetraySql.cpp @@ -1,15 +1,14 @@ #include #include #include -#include -#include +#include #include #include #include #include namespace po = boost::program_options; -namespace fs = boost::filesystem; +namespace fs = std::filesystem; AdHocFormatter(CPPHeader, R"C(#include "%?.h" @@ -70,14 +69,14 @@ main(int argc, char ** argv) boost::algorithm::split(sqlnsparts, sqlns, boost::algorithm::is_any_of(":"), boost::algorithm::token_compress_on); auto r = fs::canonical(sql).lexically_relative(fs::canonical(base)).parent_path(); if (!r.empty()) { - std::transform(r.begin(), r.end(), std::back_inserter(sqlnsparts), [](const auto & p) { return p.string(); }); + std::copy(r.begin(), r.end(), std::back_inserter(sqlnsparts)); } - std::ifstream sqlin(sql.string()); - std::ofstream cppout(cpp.string()); - std::ofstream hout(h.string()); + std::ifstream sqlin(sql); + std::ofstream cppout(cpp); + std::ofstream hout(h); - CPPHeader::write(cppout, sql.leaf().string()); + CPPHeader::write(cppout, sql.filename().string()); std::for_each(sqlnsparts.begin(), sqlnsparts.end(), [&cppout](const auto & nsp) { CPPNS::write(cppout, nsp); }); diff --git a/icetray/unittests/Jamfile.jam b/icetray/unittests/Jamfile.jam index f5223d3..7ca8e2f 100644 --- a/icetray/unittests/Jamfile.jam +++ b/icetray/unittests/Jamfile.jam @@ -5,7 +5,7 @@ import feature ; import toolset.flags ; lib boost_utf : : boost_unit_test_framework ; -lib boost_filesystem ; +lib stdc++fs ; lib dbpp-postgresql : : : : /usr/include/dbpp-postgresql ; path-constant me : . ; @@ -19,7 +19,6 @@ alias testCommon : : : : ..//Ice++11 ..//pthread boost_utf - ..//boost_system BOOST_TEST_DYN_LINK ../tool//icetray-sql ../tool//icetray-sql @@ -51,7 +50,7 @@ run : : : TestIceTray::sql testCommon - boost_filesystem + stdc++fs dbpp-postgresql ..//dl ; @@ -74,7 +73,7 @@ run : : : TestIceTray::sql testCommon - boost_filesystem + stdc++fs dbpp-postgresql ; -- cgit v1.2.3