Remove boost dependency
[platform/core/appfw/app-installers.git] / src / common / signature.h
index a73d767..499237d 100644 (file)
@@ -7,11 +7,12 @@
 
 #include <pkgmgrinfo_basic.h>
 
+#include <filesystem>
 #include <string>
 
 #include "common/installer_context.h"
 
-namespace bf = boost::filesystem;
+namespace fs = std::filesystem;
 
 namespace common_installer {
 
@@ -24,11 +25,12 @@ class Signature {
             is_readonly_package_(is_readonly_package),
             skip_check_reference_(skip_check_reference),
             cert_info_(cert_info) {}
+  virtual ~Signature() = default;
 
-  bool CheckSignatures(bool check_reference, PrivilegeLevel* level,
-                      boost::filesystem::path sig_root_path,
-                      std::string* error_message);
-  bool GetPrivilegeLevel(boost::filesystem::path sig_root_path,
+  virtual bool CheckSignatures(bool check_reference, PrivilegeLevel* level,
+                               std::filesystem::path sig_root_path,
+                               std::string* error_message);
+  bool GetPrivilegeLevel(std::filesystem::path sig_root_path,
                         PrivilegeLevel* level,
                         std::string* error_message);
   bool CheckMetadataPrivilege(PrivilegeLevel level, manifest_x* manifest,
@@ -40,19 +42,19 @@ class Signature {
       const ValidationCore::CertificatePtr& im_cert,
       const ValidationCore::CertificatePtr& root_cert);
   bool Store();
-  bool RemoveSignature(const bf::path& path);
-  bool SaveSignature(const bf::path& path);
-  const bf::path& GetFilePath() const;
-  const bf::path& GetBackupPath() const;
+  bool RemoveSignature(const fs::path& path);
+  bool SaveSignature(const fs::path& path);
+  const fs::path& GetFilePath() const;
+  const fs::path& GetBackupPath() const;
 
- private:
+ protected:
   RequestType request_type_;
   std::string pkgid_;
   bool is_readonly_package_;
   bool skip_check_reference_;
   CertificateInfo* cert_info_;
-  bf::path file_path_;
-  bf::path backup_path_;
+  fs::path file_path_;
+  fs::path backup_path_;
 };
 
 }  // namespace common_installer