Remove boost dependency
[platform/core/appfw/app-installers.git] / src / common / step / filesystem / step_create_res_control_directories.cc
index fd68f35..8dcf366 100644 (file)
@@ -4,22 +4,21 @@
 
 #include "common/step/filesystem/step_create_res_control_directories.h"
 
-#include <boost/filesystem/path.hpp>
-
+#include <filesystem>
 #include <string>
 
 #include "common/utils/file_util.h"
 #include "common/utils/glist_range.h"
 
-namespace bf = boost::filesystem;
 namespace ci = common_installer;
+namespace fs = std::filesystem;
 
 namespace {
 
 constexpr char kAllowedDir[] = "res/mount/allowed";
 constexpr char kGlobalDir[] = "res/mount/global";
 
-bool CreateResControlDirs(const bf::path& root) {
+bool CreateResControlDirs(const fs::path& root) {
   if (!ci::CreateDir(root / kAllowedDir))
     return false;
   if (!ci::CreateDir(root / kGlobalDir))
@@ -27,7 +26,7 @@ bool CreateResControlDirs(const bf::path& root) {
   return true;
 }
 
-bool RemoveResControlDirs(const bf::path& root) {
+bool RemoveResControlDirs(const fs::path& root) {
   if (!ci::RemoveAll(root / kAllowedDir))
     return false;
   if (!ci::RemoveAll(root / kGlobalDir))
@@ -69,7 +68,7 @@ Step::Status StepCreateResControlDirectories::process() {
   if (!HasResControl(context_->manifest_data.get()))
     return Status::OK;
 
-  bf::path root = context_->GetPkgPath();
+  fs::path root = context_->GetPkgPath();
   if (!CreateResControlDirs(root)) {
     LOG(ERROR) << "Failed to create res-control directories";
     return Status::APP_DIR_ERROR;
@@ -81,7 +80,7 @@ Step::Status StepCreateResControlDirectories::undo() {
   if (!HasResControl(context_->manifest_data.get()))
     return Status::OK;
 
-  bf::path root = context_->GetPkgPath();
+  fs::path root = context_->GetPkgPath();
   if (!RemoveResControlDirs(root)) {
     LOG(ERROR) << "Failed to remove res-control directories";
     return Status::APP_DIR_ERROR;