Remove boost dependency
[platform/core/appfw/app-installers.git] / src / common / step / filesystem / step_remove_temporary_directory.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 COMMON_STEP_FILESYSTEM_STEP_REMOVE_TEMPORARY_DIRECTORY_H_
6 #define COMMON_STEP_FILESYSTEM_STEP_REMOVE_TEMPORARY_DIRECTORY_H_
7
8 #include <manifest_parser/utils/logging.h>
9
10 #include <filesystem>
11
12 #include "common/step/recovery/step_recovery.h"
13
14 namespace common_installer {
15 namespace filesystem {
16
17 /**
18  * @brief removes temp directories if install gets
19  *        interrupted
20  *
21  * Part of Recovery Mode. If recovery mode gets called
22  * path to temporary unpack directory and its content get
23  * deleted
24  */
25 class StepRemoveTemporaryDirectory : public recovery::StepRecovery {
26  public:
27   using StepRecovery::StepRecovery;
28
29   Status RecoveryNew() override;
30   Status RecoveryUpdate() override;
31   Status Cleanup() override;
32
33  protected:
34   virtual bool ClearPath(const std::filesystem::path& path);
35
36  private:
37   /**
38    * @brief RemoveFiles
39    * Removes all the temporary files
40    */
41   Status RemoveFiles();
42
43   STEP_NAME(RemoveTemporaryDirectory)
44 };
45
46 }  // namespace filesystem
47 }  // namespace common_installer
48
49 #endif  // COMMON_STEP_FILESYSTEM_STEP_REMOVE_TEMPORARY_DIRECTORY_H_