Saqib Khan | 5d53267 | 2017-08-09 10:44:50 -0500 | [diff] [blame] | 1 | #pragma once |
| 2 | |
Saqib Khan | 5d53267 | 2017-08-09 10:44:50 -0500 | [diff] [blame] | 3 | #include "config.h" |
| 4 | |
Gunnar Mills | b0ce996 | 2018-09-07 13:39:10 -0500 | [diff] [blame] | 5 | #include <experimental/filesystem> |
| 6 | |
Saqib Khan | 5d53267 | 2017-08-09 10:44:50 -0500 | [diff] [blame] | 7 | namespace phosphor |
| 8 | { |
| 9 | namespace software |
| 10 | { |
| 11 | namespace updater |
| 12 | { |
| 13 | |
| 14 | namespace fs = std::experimental::filesystem; |
| 15 | |
| 16 | /** @brief Serialization function - stores activation information to file |
| 17 | * @param[in] versionId - The version for which to store information. |
| 18 | * @param[in] priority - RedundancyPriority value for that version. |
| 19 | **/ |
| 20 | void storeToFile(std::string versionId, uint8_t priority); |
| 21 | |
| 22 | /** @brief Serialization function - restores activation information from file |
| 23 | * @param[in] versionId - The version for which to retrieve information. |
| 24 | * @param[in] priority - RedundancyPriority reference for that version. |
Saqib Khan | 1eef62d | 2017-08-10 15:29:34 -0500 | [diff] [blame] | 25 | * @return true if restore was successful, false if not |
Saqib Khan | 5d53267 | 2017-08-09 10:44:50 -0500 | [diff] [blame] | 26 | **/ |
Saqib Khan | 1eef62d | 2017-08-10 15:29:34 -0500 | [diff] [blame] | 27 | bool restoreFromFile(std::string versionId, uint8_t& priority); |
Saqib Khan | 5d53267 | 2017-08-09 10:44:50 -0500 | [diff] [blame] | 28 | |
| 29 | /** @brief Removes the serial file for a given version. |
| 30 | * @param[in] versionId - The version for which to remove a file, if it exists. |
| 31 | **/ |
| 32 | void removeFile(std::string versionId); |
| 33 | |
Gunnar Mills | fa34e02 | 2018-09-04 10:05:45 -0500 | [diff] [blame] | 34 | } // namespace updater |
Saqib Khan | 5d53267 | 2017-08-09 10:44:50 -0500 | [diff] [blame] | 35 | } // namespace software |
Gunnar Mills | fa34e02 | 2018-09-04 10:05:45 -0500 | [diff] [blame] | 36 | } // namespace phosphor |