89d1844e1e2ee0a2038263cdd43fda171f1fd33d
[platform/core/appfw/app-installers.git] / src / common / step / filesystem / step_move_installed_storage.h
1 // Copyright (c) 2016 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_MOVE_INSTALLED_STORAGE_H_
6 #define COMMON_STEP_FILESYSTEM_STEP_MOVE_INSTALLED_STORAGE_H_
7
8 #include "common/installer_context.h"
9 #include "common/step/step.h"
10
11 namespace common_installer {
12 namespace filesystem {
13
14 class StepMoveInstalledStorage : public Step {
15  public:
16   using Step::Step;
17
18   explicit StepMoveInstalledStorage(InstallerContext* context);
19
20   Status process() override;
21
22   Status clean() override;
23   Status undo() override;
24   Status precheck() override;
25
26  private:
27   void SetTepPaths();
28   bool MoveTep();
29   bool MoveBackTep();
30   bool MoveExternal();
31   bool MoveBackExternal();
32   bool MoveExtended();
33   bool MoveBackExtended();
34
35   boost::filesystem::path old_tep_location_;
36   boost::filesystem::path new_tep_location_;
37   boost::filesystem::path old_pkg_location_;
38   boost::filesystem::path new_pkg_location_;
39   MoveType move_type_;
40
41   STEP_NAME(MoveInstalledStorage)
42 };
43
44 }  // namespace filesystem
45 }  // namespace common_installer
46
47 #endif  // COMMON_STEP_FILESYSTEM_STEP_MOVE_INSTALLED_STORAGE_H_