Remove boost dependency
[platform/core/appfw/app-installers.git] / src / common / step / filesystem / step_recover_storage_directories.cc
index 0bb6999..784c9f8 100644 (file)
@@ -5,11 +5,10 @@
 #include "common/step/filesystem/step_recover_storage_directories.h"
 #include "common/step/filesystem/step_remove_per_user_storage_directories.h"
 
-#include <boost/filesystem/path.hpp>
-#include <boost/system/error_code.hpp>
-
 #include <pkgmgrinfo_basic.h>
 
+#include <filesystem>
+
 #include "common/utils/paths.h"
 #include "common/privileges.h"
 #include "common/shared_dirs.h"
@@ -17,8 +16,8 @@
 #include "common/utils/glist_range.h"
 #include "common/utils/user_util.h"
 
-namespace bf = boost::filesystem;
 namespace ci = common_installer;
+namespace fs = std::filesystem;
 
 namespace {
 
@@ -51,21 +50,21 @@ Step::Status StepRecoverStorageDirectories::RecoveryNew() {
 }
 
 bool StepRecoverStorageDirectories::MoveAppStorage(
-    const bf::path& in_src,
-    const bf::path& in_dst,
+    const fs::path& in_src,
+    const fs::path& in_dst,
     const char *key) {
-  bf::path src = in_src / key;
-  if (!bf::exists(src))
+  fs::path src = in_src / key;
+  if (!fs::exists(src))
     return false;
-  bf::path dst = in_dst / key;
+  fs::path dst = in_dst / key;
   return common_installer::MoveDir(src, dst);
 }
 
 Step::Status StepRecoverStorageDirectories::RecoveryUpdate() {
   if (!context_->GetPkgPath().empty()) {
-    bf::path backup_path = common_installer::GetBackupPathForPackagePath(
+    fs::path backup_path = common_installer::GetBackupPathForPackagePath(
         context_->GetPkgPath());
-    if (bf::exists(backup_path)) {
+    if (fs::exists(backup_path)) {
       MoveAppStorage(context_->GetPkgPath(), backup_path, kDataLocation);
       MoveAppStorage(context_->GetPkgPath(), backup_path, kSharedResLocation);
     }
@@ -106,4 +105,3 @@ Step::Status StepRecoverStorageDirectories::RecoveryMountUpdate() {
 
 }  // namespace filesystem
 }  // namespace common_installer
-