#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 {
* \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
* \return new RecoveryFile object
*/
static std::unique_ptr<RecoveryFile> OpenRecoveryFile(
- const boost::filesystem::path& path);
+ const std::filesystem::path& path);
/** Desctructor */
~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
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
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
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