Add OOM exception handler
[platform/core/appfw/wgt-backend.git] / src / wgt / step / filesystem / step_create_symbolic_link.h
1 // Copyright (c) 2015 Samsung Electronics Co., Ltd All Rights Reserved
2 // Use of this source code is governed by a apache 2.0 license that can be
3 // found in the LICENSE file.
4
5 #ifndef WGT_STEP_FILESYSTEM_STEP_CREATE_SYMBOLIC_LINK_H_
6 #define WGT_STEP_FILESYSTEM_STEP_CREATE_SYMBOLIC_LINK_H_
7
8 #include <boost/filesystem.hpp>
9
10 #include <manifest_parser/utils/logging.h>
11
12 #include <common/app_installer.h>
13 #include <common/installer_context.h>
14 #include <common/step/step.h>
15
16 namespace wgt {
17 namespace filesystem {
18
19 /**
20  * \brief Step that create symbolic link to application
21  */
22 class StepCreateSymbolicLink : public common_installer::Step {
23  public:
24   using Step::Step;
25
26   /**
27    * \brief Create symbolic link
28    *
29    * \return Status::ERROR when failed to create symbolic link,
30    *         Status::OK otherwise
31    */
32   Status process() override;
33
34   /**
35    * \brief Empty method
36    *
37    * \return Status::OK
38    */
39   Status clean() override { return Status::OK; }
40
41   /**
42    * \brief Delete created symbolic link
43    *
44    * \return Status::OK
45    */
46   Status undo() override;
47
48   /**
49    * \brief Empty method
50    *
51    * \return Status::OK
52    */
53   Status precheck() override { return Status::OK; }
54
55  private:
56   bool CreateSymlinksForApps();
57
58   STEP_NAME(SymbolicLink)
59 };
60
61 }  // namespace filesystem
62 }  // namespace wgt
63
64 #endif  // WGT_STEP_FILESYSTEM_STEP_CREATE_SYMBOLIC_LINK_H_