1 #pragma once 2 3 #include "config.h" 4 5 #include "version.hpp" 6 7 #include <string> 8 9 namespace phosphor 10 { 11 namespace software 12 { 13 namespace updater 14 { 15 16 using VersionPurpose = 17 sdbusplus::xyz::openbmc_project::Software::server::Version::VersionPurpose; 18 19 /** @brief Serialization function - stores priority information to file 20 * @param[in] versionId - The version for which to store information. 21 * @param[in] priority - RedundancyPriority value for that version. 22 **/ 23 void storePriority(const std::string& versionId, uint8_t priority); 24 25 /** @brief Serialization function - stores purpose information to file 26 * @param[in] versionId - The version for which to store information. 27 * @param[in] purpose - VersionPurpose value for that version. 28 **/ 29 void storePurpose(const std::string& versionId, VersionPurpose purpose); 30 31 /** @brief Serialization function - restores priority information from file 32 * @param[in] versionId - The version for which to retrieve information. 33 * @param[in] priority - RedundancyPriority reference for that version. 34 * @return true if restore was successful, false if not 35 **/ 36 bool restorePriority(const std::string& versionId, uint8_t& priority); 37 38 /** @brief Serialization function - restores purpose information from file 39 * @param[in] versionId - The version for which to retrieve information. 40 * @param[in] purpose - VersionPurpose reference for that version. 41 * @return true if restore was successful, false if not 42 **/ 43 bool restorePurpose(const std::string& versionId, VersionPurpose& purpose); 44 45 /** @brief Removes the serial directory for a given version. 46 * @param[in] versionId - The version for which to remove a file, if it exists. 47 **/ 48 void removePersistDataDirectory(const std::string& versionId); 49 50 } // namespace updater 51 } // namespace software 52 } // namespace phosphor 53