Change AppQueryInterface's some function to virtual 88/244388/6
authorIlho Kim <ilho159.kim@samsung.com>
Fri, 18 Sep 2020 05:01:41 +0000 (14:01 +0900)
committerIlho Kim <ilho159.kim@samsung.com>
Tue, 22 Sep 2020 02:07:33 +0000 (11:07 +0900)
Child class's logic of extracting manifest can be diffrent
and add a clear function for result of extracting function

Change-Id: Ic15edf83008a7b8f7f4e6021a51b1d53e3e40ac4
Signed-off-by: Ilho Kim <ilho159.kim@samsung.com>
src/common/app_query_interface.cc
src/common/app_query_interface.h

index 3d57894..4f36950 100644 (file)
@@ -45,4 +45,9 @@ boost::filesystem::path AppQueryInterface::ExtractManifest(
   return tmp_path;
 }
 
+bool AppQueryInterface::ClearTemporaryFile(
+    const boost::filesystem::path& path) const {
+  return RemoveAll(path);
+}
+
 }  // namespace common_installer
index 129725d..5025e68 100644 (file)
@@ -37,7 +37,9 @@ class AppQueryInterface {
   std::string GetPkgId(const std::string& arg) const;
 
  protected:
-  boost::filesystem::path ExtractManifest(const std::string& from) const;
+  virtual boost::filesystem::path ExtractManifest(
+      const std::string& from) const;
+  virtual bool ClearTemporaryFile(const boost::filesystem::path& path) const;
 
  private:
   virtual std::string GetPkgIdFromPath(const std::string& path) const = 0;