f1d8b4000752848f6b5691f7bc6c1c9f33e7e3ab
[platform/core/appfw/app-installers.git] / src / common / step / mount / step_mount_unpacked.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_MOUNT_STEP_MOUNT_UNPACKED_H_
6 #define COMMON_STEP_MOUNT_STEP_MOUNT_UNPACKED_H_
7
8 #include <manifest_parser/utils/logging.h>
9
10 #include "common/installer_context.h"
11 #include "common/mount_base.h"
12 #include "common/step/step.h"
13
14 namespace common_installer {
15 namespace mount {
16
17 /**
18  * \brief Responsible for mounting package zip in temporary directory (wgt/tpk)
19  *
20  * Mounts package zip in temporary location to enable step to access package
21  * content for parsing, signature check and others.
22  *
23  * Following directories are used as mount points:
24  * * TZ_SYS_RW/tmpuniquedir (/usr/apps/tmpuniquedir)
25  * * TZ_SER_APPS/tmpdir  (/{HOME}/apps_rw/tmpuniquedir)
26  */
27 class StepMountUnpacked : public MountBase, public Step {
28  public:
29   using MountBase::MountBase;
30   using Step::Step;
31
32   Status process() override;
33   Status clean() override { return Status::OK; }
34   Status undo() override;
35   Status precheck() override;
36
37  protected:
38   std::unique_ptr<IZipInterface> CreateZipInterface(
39       const boost::filesystem::path& mount_path) override;
40
41   STEP_NAME(MountUnpacked)
42 };
43
44 }  // namespace mount
45 }  // namespace common_installer
46
47 #endif  // COMMON_STEP_MOUNT_STEP_MOUNT_UNPACKED_H_