blob: adaf018410b9710834087bdc18627085b9239b20 [file] [log] [blame]
Saqib Khan5d532672017-08-09 10:44:50 -05001#pragma once
2
Saqib Khan5d532672017-08-09 10:44:50 -05003#include "config.h"
4
Gunnar Millsb0ce9962018-09-07 13:39:10 -05005#include <experimental/filesystem>
6
Saqib Khan5d532672017-08-09 10:44:50 -05007namespace phosphor
8{
9namespace software
10{
11namespace updater
12{
13
14namespace 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 **/
20void 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 Khan1eef62d2017-08-10 15:29:34 -050025 * @return true if restore was successful, false if not
Saqib Khan5d532672017-08-09 10:44:50 -050026 **/
Saqib Khan1eef62d2017-08-10 15:29:34 -050027bool restoreFromFile(std::string versionId, uint8_t& priority);
Saqib Khan5d532672017-08-09 10:44:50 -050028
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 **/
32void removeFile(std::string versionId);
33
Gunnar Millsfa34e022018-09-04 10:05:45 -050034} // namespace updater
Saqib Khan5d532672017-08-09 10:44:50 -050035} // namespace software
Gunnar Millsfa34e022018-09-04 10:05:45 -050036} // namespace phosphor