Jayanth Othayoth | 2496482 | 2017-09-04 22:07:06 -0500 | [diff] [blame] | 1 | #pragma once |
| 2 | |
Jayanth Othayoth | cb65ffc | 2018-10-16 08:29:32 -0500 | [diff] [blame] | 3 | #include "config.h" |
Jayanth Othayoth | 2496482 | 2017-09-04 22:07:06 -0500 | [diff] [blame] | 4 | |
Jayanth Othayoth | cb65ffc | 2018-10-16 08:29:32 -0500 | [diff] [blame] | 5 | #include <experimental/filesystem> |
Chirag Sharma | 5042725 | 2020-08-11 12:11:38 -0500 | [diff] [blame] | 6 | #include <set> |
Jayanth Othayoth | 2496482 | 2017-09-04 22:07:06 -0500 | [diff] [blame] | 7 | |
| 8 | namespace phosphor |
| 9 | { |
| 10 | namespace dump |
| 11 | { |
| 12 | namespace elog |
| 13 | { |
Chirag Sharma | 5042725 | 2020-08-11 12:11:38 -0500 | [diff] [blame] | 14 | using EId = uint32_t; |
| 15 | using ElogList = std::set<EId>; |
Jayanth Othayoth | 2496482 | 2017-09-04 22:07:06 -0500 | [diff] [blame] | 16 | |
| 17 | namespace fs = std::experimental::filesystem; |
| 18 | |
| 19 | /** @brief Serialize and persist list of ids. |
| 20 | * @param[in] list - elog id list. |
| 21 | * @param[in] dir - pathname of file where the serialized elog id's will |
| 22 | * be placed. |
| 23 | */ |
| 24 | void serialize(const ElogList& list, |
| 25 | const fs::path& dir = fs::path(ELOG_ID_PERSIST_PATH)); |
| 26 | |
| 27 | /** @brief Deserialze a persisted list of ids into list |
| 28 | * @param[in] path - pathname of persisted error file |
| 29 | * @param[out] list - elog id list |
| 30 | * @return bool - true if the deserialization was successful, false otherwise. |
| 31 | */ |
| 32 | bool deserialize(const fs::path& path, ElogList& list); |
| 33 | |
| 34 | } // namespace elog |
| 35 | } // namespace dump |
| 36 | } // namespace phosphor |