c844ff34d316769f969da1a9f83ecf85d3332a34
[platform/core/appfw/app-installers.git] / src / common / step / filesystem / step_recover_files.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_FILES_H_
6 #define COMMON_STEP_FILESYSTEM_STEP_RECOVER_FILES_H_
7
8 #include <manifest_parser/utils/logging.h>
9
10 #include "common/installer_context.h"
11 #include "common/step/recovery/step_recovery.h"
12
13 namespace common_installer {
14 namespace filesystem {
15
16 /**
17  * @brief The StepRecoverFiles class
18  *        Fixes state of package files in recovery mode.
19  *
20  * For recovering new installation, package files are removed.
21  * For recovering update installation, old package files are restored to its
22  * original locations.
23  */
24 class StepRecoverFiles : public recovery::StepRecovery {
25  public:
26   using StepRecovery::StepRecovery;
27
28   Status RecoveryNew() override;
29   Status RecoveryUpdate() override;
30   Status RecoveryMountNew() override;
31   Status RecoveryMountUpdate() override;
32   Status RecoveryReadonlyUpdateInstall() override;
33   Status Cleanup() override;
34
35   STEP_NAME(RecoverFiles)
36 };
37
38 }  // namespace filesystem
39 }  // namespace common_installer
40
41 #endif  // COMMON_STEP_FILESYSTEM_STEP_RECOVER_FILES_H_