Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
Get rid of dependency on boost::filesystem.
authorArnaud Giersch <arnaud.giersch@univ-fcomte.fr>
Fri, 13 Jul 2018 14:32:23 +0000 (16:32 +0200)
committerArnaud Giersch <arnaud.giersch@univ-fcomte.fr>
Fri, 13 Jul 2018 14:32:23 +0000 (16:32 +0200)
examples/smpi/replay_multiple_manual_deploy/CMakeLists.txt
examples/smpi/replay_multiple_manual_deploy/replay_multiple_manual.cpp

index 269a06e..109ee5f 100644 (file)
@@ -2,7 +2,7 @@ if(enable_smpi)
   include_directories(BEFORE "${CMAKE_HOME_DIRECTORY}/include/smpi")
 
   # Boost regex dependency
-  find_package(Boost COMPONENTS regex filesystem REQUIRED)
+  find_package(Boost COMPONENTS regex REQUIRED)
 
   add_executable       (replay_multiple_manual replay_multiple_manual.cpp)
   target_link_libraries(replay_multiple_manual simgrid ${Boost_LIBRARIES})
index 1b7330e..59550d3 100644 (file)
 #include <vector>
 
 #include <boost/algorithm/string.hpp>
-#include <boost/filesystem.hpp>
 #include <boost/regex.hpp>
 
 #include <simgrid/msg.h>
 #include <simgrid/s4u.hpp>
 #include <smpi/smpi.h>
+#include <xbt/file.hpp>
 
 XBT_LOG_NEW_DEFAULT_CATEGORY(replay_multiple_manual, "Messages specific for this example");
 
@@ -174,8 +174,8 @@ static std::vector<Job*> all_jobs(const std::string& workload_file)
   xbt_assert(f.is_open(), "Cannot open file '%s'.", workload_file.c_str());
   std::vector<Job*> jobs;
 
-  boost::filesystem::path path(workload_file);
-  std::string dir = path.parent_path().native();
+  simgrid::xbt::Path path(workload_file);
+  std::string dir = path.get_dir_name();
 
   boost::regex r(R"(^\s*(\S+)\s+(\S+\.txt)\s+(\d+)\s+(\d+)\s+(\d+(?:,\d+)*).*$)");
   std::string line;