Remove boost dependency
[platform/core/appfw/app-installers.git] / src / common / pkgmgr_registration.cc
index 57d3554..4f75407 100644 (file)
@@ -16,7 +16,7 @@
 #include "common/utils/glist_range.h"
 #include "common/utils/manifest_util.h"
 
-namespace bf = boost::filesystem;
+namespace fs = std::filesystem;
 
 
 namespace {
@@ -102,13 +102,13 @@ bool RegisterAppInPkgmgr(manifest_x* manifest,
                          uid_t uid,
                          Storage storage,
                          RequestMode request_mode,
-                         const boost::filesystem::path& tep_path) {
+                         const std::filesystem::path& tep_path) {
   // Fill "non-xml" elements
   if (!tep_path.empty())
     manifest->tep_name = strdup(tep_path.c_str());
 
   if (storage == Storage::EXTENDED) {
-    bf::path ext_path = bf::path(GetExtendedRootAppPath(uid)) / pkgid;
+    fs::path ext_path = fs::path(GetExtendedRootAppPath(uid)) / pkgid;
     manifest->external_path = strdup(ext_path.c_str());
   } else if (storage == Storage::EXTERNAL) {
     App2ExtDynamicService service;
@@ -142,7 +142,7 @@ bool UpgradeAppInPkgmgr(manifest_x* manifest,
                         Storage storage,
                         RequestMode request_mode) {
   if (storage == Storage::EXTENDED) {
-    bf::path ext_path = bf::path(GetExtendedRootAppPath(uid)) / pkgid;
+    fs::path ext_path = fs::path(GetExtendedRootAppPath(uid)) / pkgid;
     manifest->external_path = strdup(ext_path.c_str());
   } else if (storage == Storage::EXTERNAL) {
     App2ExtDynamicService service;
@@ -201,13 +201,13 @@ bool UnregisterAppInPkgmgr(manifest_x* manifest,
   return true;
 }
 
-bool UpdateTepInfoInPkgmgr(const bf::path& tep_path, const std::string& pkgid,
+bool UpdateTepInfoInPkgmgr(const fs::path& tep_path, const std::string& pkgid,
                         uid_t uid, RequestMode request_mode) {
   int ret = request_mode != RequestMode::GLOBAL ?
         pkgmgr_parser_usr_update_tep(
-            pkgid.c_str(), tep_path.string().c_str(), uid) :
+            pkgid.c_str(), tep_path.c_str(), uid) :
         pkgmgr_parser_update_tep(
-            pkgid.c_str(), tep_path.string().c_str());
+            pkgid.c_str(), tep_path.c_str());
 
   if (ret != 0) {
     LOG(ERROR) << "Failed to upgrade tep info: " << pkgid;
@@ -217,7 +217,7 @@ bool UpdateTepInfoInPkgmgr(const bf::path& tep_path, const std::string& pkgid,
   return true;
 }
 
-bool UpdateInstalledStorageInPkgmgr(Storage storage, const bf::path& ext_path,
+bool UpdateInstalledStorageInPkgmgr(Storage storage, const fs::path& ext_path,
                                     const std::string& pkgid, uid_t uid) {
   // FIXME: refactor this
   INSTALL_LOCATION install_location;
@@ -227,10 +227,10 @@ bool UpdateInstalledStorageInPkgmgr(Storage storage, const bf::path& ext_path,
     path = "";
   } else if (storage == Storage::EXTERNAL) {
     install_location = INSTALL_EXTERNAL;
-    path = ext_path.string().c_str();
+    path = ext_path.c_str();
   } else {
     install_location = INSTALL_EXTENDED;
-    path = ext_path.string().c_str();
+    path = ext_path.c_str();
   }
   int ret = pkgmgrinfo_pkginfo_set_usr_installed_storage(
       pkgid.c_str(), install_location, path, uid);