Remove boost dependency
[platform/core/appfw/app-installers.git] / src / common / global_recovery_file.h
1 // Copyright (c) 2020 Samsung Electronics Co., Ltd All Rights Reserved
2 // Use of this source code is governed by an apache-2.0 license that can be
3 // found in the LICENSE file.
4
5 #ifndef COMMON_GLOBAL_RECOVERY_FILE_H_
6 #define COMMON_GLOBAL_RECOVERY_FILE_H_
7
8 #include <filesystem>
9 #include <string>
10 #include <vector>
11
12 #include "common/pkgmgr_interface.h"
13
14 namespace fs = std::filesystem;
15
16 namespace common_installer {
17
18 class GlobalRecoveryFile {
19  public:
20   explicit GlobalRecoveryFile(std::shared_ptr<PkgMgrInterface> pkgmgr);
21   ~GlobalRecoveryFile();
22
23   bool Init();
24
25   std::string AddPathWithType(const std::string& pkg_type);
26
27   bool AppendPath(const fs::path& additional_path);
28
29   bool AppendCleanUp();
30
31  private:
32   bool AppendString(const std::string& val);
33   fs::path GenerateRecoveryFilePath(
34       const fs::path& path,
35       const std::string& type);
36   std::shared_ptr<common_installer::PkgMgrInterface> pkgmgr_;
37   fs::path recovery_filepath_;
38   fs::path backup_path_;
39   std::vector<std::string> recovery_list_;
40 };
41
42 }  // namespace common_installer
43
44 #endif  // COMMON_GLOBAL_RECOVERY_FILE_H_