a7390e2c0ffa53d9c63cd3627b2984baccdd86d5
[platform/core/appfw/app-installers.git] / src / common / step / filesystem / step_update_storage_directories.h
1 // Copyright (c) 2017 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_UPDATE_STORAGE_DIRECTORIES_H_
6 #define COMMON_STEP_FILESYSTEM_STEP_UPDATE_STORAGE_DIRECTORIES_H_
7
8 #include <boost/filesystem/path.hpp>
9
10 #include <manifest_parser/utils/logging.h>
11
12 #include "common/step/step.h"
13
14 namespace common_installer {
15 namespace filesystem {
16
17 class StepUpdateStorageDirectories : public common_installer::Step {
18  public:
19   using Step::Step;
20
21   explicit StepUpdateStorageDirectories(InstallerContext* context) :
22       Step(context), old_shared_data_exists_(false),
23       should_create_shared_data_(false) {}
24
25   Status process() override;
26   Status clean() override;
27   Status undo() override;
28   Status precheck() override;
29
30   STEP_NAME(UpdateStorageDirectories)
31
32  private:
33   bool UpdatePerUserStorageDirectories();
34   bool UpdateStorageDirectories();
35   bool CleanUpdatePerUserStorageDirectories();
36   bool CleanUpdateStorageDirectories();
37   bool UndoUpdatePerUserStorageDirectories();
38   bool UndoUpdateStorageDirectories();
39
40   bool old_shared_data_exists_;
41   bool should_create_shared_data_;
42 };
43
44 }  // namespace filesystem
45 }  // namespace common_installer
46
47 #endif  // COMMON_STEP_FILESYSTEM_STEP_UPDATE_STORAGE_DIRECTORIES_H_