blob: 4e6e99fc10df723f19cbb47d4446992a475eeff1 [file] [log] [blame]
Michael Tritz60bc20f2017-07-29 23:32:21 -05001#pragma once
2
3#include <experimental/filesystem>
4#include "config.h"
5
6namespace openpower
7{
8namespace software
9{
10namespace updater
11{
12
13namespace fs = std::experimental::filesystem;
14
15/** @brief Serialization function - stores activation information to file
16 * @param[in] versionId - The version for which to store information.
17 * @param[in] priority - RedundancyPriority value for that version.
18 */
19void storeToFile(std::string versionId, uint8_t priority);
20
21/** @brief Serialization function - restores activation information from file
22 * @param[in] versionId - The version for which to retrieve information.
23 * @param[in] priority - RedundancyPriority pointer for that version.
Michael Tritz36417922017-08-04 14:00:29 -050024 * @return true if restore was successful, false if not
Michael Tritz60bc20f2017-07-29 23:32:21 -050025 */
Michael Tritz36417922017-08-04 14:00:29 -050026bool restoreFromFile(std::string versionId, uint8_t& priority);
Michael Tritz60bc20f2017-07-29 23:32:21 -050027
28/** @brief Removes the serial file for a given version.
29 * @param[in] versionId - The version for which to remove a file, if it exists.
30 */
31void removeFile(std::string versionId);
32
33} // namespace updater
34} // namespace software
35} // namespace openpower