Add functions for classes inherits this class 26/256526/3
authorJunghyun Yeon <jungh.yeon@samsung.com>
Tue, 6 Apr 2021 08:33:01 +0000 (17:33 +0900)
committerJunghyun Yeon <jungh.yeon@samsung.com>
Thu, 3 Jun 2021 02:56:17 +0000 (02:56 +0000)
- Add ExtractPackageArchive() as virtual function.
- Define RemoveTmpDir() and implement it.

Change-Id: I9a62c629dff3434e186f9b56f618e41255f66625
Signed-off-by: Junghyun Yeon <jungh.yeon@samsung.com>
src/common/archive_info.cc
src/common/archive_info.h

index f24def4..b3e1423 100644 (file)
@@ -8,6 +8,8 @@
 #include <manifest_parser/utils/logging.h>
 #include <package-manager-plugin.h>
 
+#include <common/utils/file_util.h>
+
 #include <algorithm>
 #include <cstdio>
 #include <cstring>
@@ -75,4 +77,8 @@ bool ArchiveInfo::GetPkgDetailInfo(package_manager_pkg_detail_info_t* info) {
   return true;
 }
 
+void ArchiveInfo::RemoveTmpDir(const std::string& tmp_dir) {
+  common_installer::RemoveAll(tmp_dir);
+}
+
 }  // namespace common_installer
index fb41fed..4303f76 100644 (file)
@@ -22,7 +22,10 @@ class ArchiveInfo {
   explicit ArchiveInfo(std::string path) : path_(std::move(path)) { }
   virtual ~ArchiveInfo() = default;
   virtual bool LoadArchiveInfo() = 0;
+  virtual bool ExtractPackageArchive(const std::string& archive_path,
+      const std::string& file, const std::string& tmp_dir) = 0;
   bool GetPkgDetailInfo(package_manager_pkg_detail_info_t* info);
+  virtual void RemoveTmpDir(const std::string& tmp_dir);
 
   std::string type() const { return type_; }
   std::string name() const { return name_; }