Remove boost dependency
[platform/core/appfw/app-installers.git] / src / common / step / backup / step_backup_manifest.cc
index c9149f7..fdaad81 100644 (file)
@@ -4,28 +4,25 @@
 
 #include "common/step/backup/step_backup_manifest.h"
 
-#include <boost/filesystem/path.hpp>
-#include <boost/filesystem/operations.hpp>
-#include <boost/system/error_code.hpp>
-
 #include <pkgmgr-info.h>
 #include <pkgmgr_installer.h>
 
 #include <algorithm>
+#include <filesystem>
 #include <string>
+#include <system_error>
 
 #include "common/utils/paths.h"
 #include "common/utils/file_util.h"
 
-namespace bf = boost::filesystem;
-namespace bs = boost::system;
 namespace ci = common_installer;
+namespace fs = std::filesystem;
 
 namespace common_installer {
 namespace backup {
 
 Step::Status StepBackupManifest::precheck() {
-  if (!bf::exists(context_->xml_path.get())) {
+  if (!fs::exists(context_->xml_path.get())) {
     LOG(ERROR) << "Xml manifest file does not exist";
     return Status::MANIFEST_NOT_FOUND;
   }
@@ -35,7 +32,7 @@ Step::Status StepBackupManifest::precheck() {
 
 Step::Status StepBackupManifest::process() {
   // set backup file path
-  bf::path backup_xml_path =
+  fs::path backup_xml_path =
       GetBackupPathForManifestFile(context_->xml_path.get());
   context_->backup_xml_path.set(backup_xml_path);
   if (!MoveFile(context_->xml_path.get(), backup_xml_path, true) ||
@@ -56,11 +53,11 @@ Step::Status StepBackupManifest::clean() {
 }
 
 Step::Status StepBackupManifest::undo() {
-  if (!bf::exists(context_->backup_xml_path.get()))
+  if (!fs::exists(context_->backup_xml_path.get()))
     return Status::OK;
 
-  bs::error_code error;
-  bf::remove(context_->xml_path.get(), error);
+  std::error_code error;
+  fs::remove(context_->xml_path.get(), error);
   if (error) {
     LOG(ERROR) << "Failed to remove newly generated xml file in revert";
     return Status::MANIFEST_ERROR;