Remove boost dependency
[platform/core/appfw/app-installers.git] / src / common / step / mount / step_mount_unpacked.cc
index e0fe999..95e6ce3 100644 (file)
@@ -4,10 +4,9 @@
 
 #include "common/step/mount/step_mount_unpacked.h"
 
-#include <boost/filesystem/operations.hpp>
-#include <boost/filesystem/path.hpp>
 #include <unistd.h>
 
+#include <filesystem>
 #include <string>
 
 #include "common/utils/paths.h"
@@ -15,8 +14,7 @@
 #include "common/tzip_interface.h"
 #include "common/zip_interface.h"
 
-namespace bf = boost::filesystem;
-namespace bs = boost::system;
+namespace fs = std::filesystem;
 
 namespace {
 
@@ -28,7 +26,7 @@ namespace common_installer {
 namespace mount {
 
 Step::Status StepMountUnpacked::process() {
-  bf::path tmp_dir = GenerateTmpDir(kPackageUnpackDirPath);
+  fs::path tmp_dir = GenerateTmpDir(kPackageUnpackDirPath);
   context_->unpacked_dir_path.set(tmp_dir);
   // write unpacked directory for recovery file
   // to remove unpacked dir properly when recovery mode
@@ -57,7 +55,7 @@ Step::Status StepMountUnpacked::undo() {
   RemoveAll(context_->unpacked_dir_path.get());
 
   if (context_->request_type.get() == RequestType::MountUpdate) {
-    bf::path mount_point = GetMountLocation(context_->GetPkgPath());
+    fs::path mount_point = GetMountLocation(context_->GetPkgPath());
     auto zip_final = CreateZipInterface(mount_point);
     if (!zip_final->UnmountZip()) {
       LOG(ERROR) << "Failed to unmount zip package after revoke";
@@ -72,7 +70,7 @@ Step::Status StepMountUnpacked::precheck() {
     LOG(ERROR) << "file_path attribute is empty";
     return Step::Status::INVALID_VALUE;
   }
-  if (!bf::exists(context_->file_path.get())) {
+  if (!fs::exists(context_->file_path.get())) {
     LOG(ERROR) << "file_path ("
                << context_->file_path.get()
                << ") path does not exist";
@@ -82,7 +80,7 @@ Step::Status StepMountUnpacked::precheck() {
     LOG(ERROR) << "root_application_path attribute is empty";
     return Step::Status::INVALID_VALUE;
   }
-  if (!bf::exists(context_->root_application_path.get())) {
+  if (!fs::exists(context_->root_application_path.get())) {
     LOG(ERROR) << "root_application_path ("
                << context_->root_application_path.get()
                << ") path does not exist";
@@ -92,7 +90,7 @@ Step::Status StepMountUnpacked::precheck() {
 }
 
 std::unique_ptr<IZipInterface> StepMountUnpacked::CreateZipInterface(
-    const boost::filesystem::path& mount_path) {
+    const fs::path& mount_path) {
   std::unique_ptr<IZipInterface> zip_interface(
       new TzipInterface(mount_path));
   return zip_interface;