Remove boost dependency
[platform/core/appfw/app-installers.git] / src / common / step / filesystem / step_remove_user_data.cc
index e6a81e4..4999aa4 100644 (file)
@@ -4,6 +4,7 @@
 
 #include "common/step/filesystem/step_remove_user_data.h"
 
+#include <filesystem>
 #include <string>
 #include <utility>
 #include <vector>
@@ -13,7 +14,7 @@
 #include "common/utils/file_util.h"
 #include "common/utils/user_util.h"
 
-namespace bf = boost::filesystem;
+namespace fs = std::filesystem;
 namespace ci = common_installer;
 
 namespace {
@@ -23,11 +24,11 @@ const char kCacheDir[] = "cache";
 const char kSharedDir[] = ".shared";
 const char kSubssesionDir[] = "subsession";
 
-bool RemoveContents(const bf::path& path) {
-  if (!bf::exists(path))
+bool RemoveContents(const fs::path& path) {
+  if (!fs::exists(path))
     return true;
 
-  for (bf::directory_iterator iter(path); iter != bf::directory_iterator();
+  for (fs::directory_iterator iter(path); iter != fs::directory_iterator();
       ++iter) {
     if (!ci::RemoveAll(iter->path()))
       return false;
@@ -49,8 +50,8 @@ Step::Status StepRemoveUserData::process() {
   UserList list = ci::GetUserList();
   for (const auto& l : list) {
     uid_t uid = std::get<0>(l);
-    bf::path owner_apps_rw(std::get<2>(l) / "apps_rw");
-    std::vector<bf::path> apps_rw_paths;
+    fs::path owner_apps_rw(std::get<2>(l) / "apps_rw");
+    std::vector<fs::path> apps_rw_paths;
     apps_rw_paths.push_back(std::move(owner_apps_rw));
     for (auto& lw_user : GetLightUserList(uid))
       apps_rw_paths.push_back(std::get<2>(l) / kSubssesionDir / lw_user /