Fix static analysis issue
[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), mode_(UpdateMode::NONE) {}
23
24   Status process() override;
25   Status clean() override;
26   Status undo() override;
27   Status precheck() override;
28
29   STEP_NAME(UpdateStorageDirectories)
30
31  private:
32   enum class UpdateMode : int {
33     NONE,
34     CREATE,
35     DELETE,
36   };
37
38   bool UpdatePerUserStorageDirectories();
39   bool UpdateStorageDirectories();
40   bool CleanUpdatePerUserStorageDirectories();
41   bool CleanUpdateStorageDirectories();
42   bool UndoUpdatePerUserStorageDirectories();
43   bool UndoUpdateStorageDirectories();
44
45   UpdateMode mode_;
46 };
47
48 }  // namespace filesystem
49 }  // namespace common_installer
50
51 #endif  // COMMON_STEP_FILESYSTEM_STEP_UPDATE_STORAGE_DIRECTORIES_H_