Remove boost dependency
[platform/core/appfw/app-installers.git] / src / common / recovery_file.h
index 57fa2a0..f2d3260 100644 (file)
@@ -5,13 +5,12 @@
 #ifndef COMMON_RECOVERY_FILE_H_
 #define COMMON_RECOVERY_FILE_H_
 
-#include <boost/filesystem/path.hpp>
-
 #include <cstdio>
+#include <filesystem>
 #include <memory>
 #include <string>
 
-#include "common/request.h"
+#include "common/utils/request.h"
 
 namespace common_installer {
 
@@ -33,7 +32,7 @@ class RecoveryFile {
    * \return new RecoveryFile object
    */
   static std::unique_ptr<RecoveryFile> CreateRecoveryFile(
-      const boost::filesystem::path& path, RequestType type);
+      const std::filesystem::path& path, RequestType type);
 
   /**
    * Opens RecoveryFile object for given request
@@ -43,7 +42,7 @@ class RecoveryFile {
    * \return new RecoveryFile object
    */
   static std::unique_ptr<RecoveryFile> OpenRecoveryFile(
-      const boost::filesystem::path& path);
+      const std::filesystem::path& path);
 
   /** Desctructor */
   ~RecoveryFile();
@@ -64,7 +63,7 @@ class RecoveryFile {
    *
    * \param unpacked_dir new unpacked_dir value
    */
-  void set_unpacked_dir(boost::filesystem::path unpacked_dir);
+  void set_unpacked_dir(std::filesystem::path unpacked_dir);
 
   /**
    * setter for pkgid
@@ -74,18 +73,32 @@ class RecoveryFile {
   void set_pkgid(std::string pkgid);
 
   /**
-   * setter for request type
+   * setter for backup done
+   *
+   * \param backup_done boolean value of backup_done
+   */
+  void set_backup_done(bool backup_done);
+
+  /**
+   * setter for cleanup flag
    *
-   * \param new request type value
+   * \param cleanup boolean value of cleanup
    */
-  void set_type(RequestType type);
+  void set_cleanup(bool cleanup);
+
+  /**
+   * setter for security operation done
+   *
+   * \param security_operation_done boolean value of security_operation_done
+   */
+  void set_security_operation_done(bool security_operation_done);
 
   /**
    * getter for unpacked dir
    *
    * \return current unpacked_dir
    */
-  const boost::filesystem::path& unpacked_dir() const;
+  const std::filesystem::path& unpacked_dir() const;
 
   /**
    * getter for pkgid
@@ -102,6 +115,27 @@ class RecoveryFile {
   RequestType type() const;
 
   /**
+   * getter for backup exist flag
+   *
+   * \return true if backup does exist
+   */
+  bool backup_done() const;
+
+  /**
+   * getter for cleanup flag
+   *
+   * \return true if cleanup flag has set
+   */
+  bool cleanup() const;
+
+  /**
+   * getter for security operation done flag
+   *
+   * \return true if security operation done flag has set
+   */
+  bool security_operation_done() const;
+
+  /**
    * Transaction of current RecoveryFile content into recovery file
    *
    * \return true if success
@@ -109,16 +143,20 @@ class RecoveryFile {
   bool WriteAndCommitFileContent();
 
  private:
-  RecoveryFile(const boost::filesystem::path& path, RequestType type,
+  RecoveryFile(const std::filesystem::path& path, RequestType type,
       bool load);
 
   bool ReadFileContent();
 
   RequestType type_;
-  boost::filesystem::path unpacked_dir_;
+  std::filesystem::path unpacked_dir_;
   std::string pkgid_;
 
-  boost::filesystem::path path_;
+  std::filesystem::path path_;
+  std::filesystem::path backup_path_;
+  bool backup_done_;
+  bool cleanup_;
+  bool security_operation_done_;
 };
 
 }  // namespace recovery