Change the file remove to a virtual function in recovery
[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 <boost/filesystem/path.hpp>
9
10 #include <manifest_parser/utils/logging.h>
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 The StepRecoverFiles class
20  *        Fixes state of package files in recovery mode.
21  *
22  * For recovering new installation, package files are removed.
23  * For recovering update installation, old package files are restored to its
24  * original locations.
25  */
26 class StepRecoverFiles : public recovery::StepRecovery {
27  public:
28   using StepRecovery::StepRecovery;
29
30   Status RecoveryNew() override;
31   Status RecoveryUpdate() override;
32   Status RecoveryMountNew() override;
33   Status RecoveryMountUpdate() override;
34   Status RecoveryReadonlyUpdateInstall() override;
35   Status Cleanup() override;
36
37  protected:
38   virtual bool ClearPath(const boost::filesystem::path& path);
39
40   STEP_NAME(RecoverFiles)
41 };
42
43 }  // namespace filesystem
44 }  // namespace common_installer
45
46 #endif  // COMMON_STEP_FILESYSTEM_STEP_RECOVER_FILES_H_