Remove boost dependency
[platform/core/appfw/app-installers.git] / src / common / step / filesystem / step_recover_storage_directories.h
1 // Copyright (c) 2015 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_STEP_FILESYSTEM_STEP_RECOVER_STORAGE_DIRECTORIES_H_
6 #define COMMON_STEP_FILESYSTEM_STEP_RECOVER_STORAGE_DIRECTORIES_H_
7
8 #include <manifest_parser/utils/logging.h>
9
10 #include <filesystem>
11
12 #include "common/installer_context.h"
13 #include "common/step/recovery/step_recovery.h"
14
15 namespace common_installer {
16 namespace filesystem {
17
18 /**
19  * @brief recovers data and shared directories of application
20  *
21  * Part of Recovery Mode. Is responsible for restoring data and shared
22  * directories in case partial update occurs.
23  */
24 class StepRecoverStorageDirectories : public recovery::StepRecovery {
25  public:
26   using StepRecovery::StepRecovery;
27
28   Status RecoveryNew() override;
29   Status RecoveryUpdate() override;
30   Status RecoveryMountUpdate() override;
31
32  private:
33   /**
34    * @brief moves directories
35    * @param in_src path of the source location
36    * @param in_dst path of the destination location
37    * @param key directory name
38    * @return true if operation successful
39    */
40   bool MoveAppStorage(const std::filesystem::path& in_src,
41                       const std::filesystem::path& in_dst,
42                       const char *key);
43
44   STEP_NAME(RecoverStorageDirectories)
45 };
46
47 }  // namespace filesystem
48 }  // namespace common_installer
49
50 #endif  // COMMON_STEP_FILESYSTEM_STEP_RECOVER_STORAGE_DIRECTORIES_H_