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 | 3fc6df4 | 2021-04-08 03:45:24 -0500 | [diff] [blame] | 5 | #include <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 | |
Jayanth Othayoth | 2496482 | 2017-09-04 22:07:06 -0500 | [diff] [blame] | 17 | /** @brief Serialize and persist list of ids. |
| 18 | * @param[in] list - elog id list. |
| 19 | * @param[in] dir - pathname of file where the serialized elog id's will |
| 20 | * be placed. |
| 21 | */ |
| 22 | void serialize(const ElogList& list, |
Jayanth Othayoth | 3fc6df4 | 2021-04-08 03:45:24 -0500 | [diff] [blame] | 23 | const std::filesystem::path& dir = |
| 24 | std::filesystem::path(ELOG_ID_PERSIST_PATH)); |
Jayanth Othayoth | 2496482 | 2017-09-04 22:07:06 -0500 | [diff] [blame] | 25 | |
| 26 | /** @brief Deserialze a persisted list of ids into list |
| 27 | * @param[in] path - pathname of persisted error file |
| 28 | * @param[out] list - elog id list |
| 29 | * @return bool - true if the deserialization was successful, false otherwise. |
| 30 | */ |
Jayanth Othayoth | 3fc6df4 | 2021-04-08 03:45:24 -0500 | [diff] [blame] | 31 | bool deserialize(const std::filesystem::path& path, ElogList& list); |
Jayanth Othayoth | 2496482 | 2017-09-04 22:07:06 -0500 | [diff] [blame] | 32 | |
| 33 | } // namespace elog |
| 34 | } // namespace dump |
| 35 | } // namespace phosphor |