Jayanth Othayoth | 2496482 | 2017-09-04 22:07:06 -0500 | [diff] [blame] | 1 | #pragma once |
| 2 | |
| 3 | #include <experimental/filesystem> |
| 4 | |
| 5 | #include "elog_watch.hpp" |
| 6 | #include "config.h" |
| 7 | |
| 8 | namespace phosphor |
| 9 | { |
| 10 | namespace dump |
| 11 | { |
| 12 | namespace elog |
| 13 | { |
| 14 | |
| 15 | namespace fs = std::experimental::filesystem; |
| 16 | |
| 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, |
| 23 | const fs::path& dir = fs::path(ELOG_ID_PERSIST_PATH)); |
| 24 | |
| 25 | /** @brief Deserialze a persisted list of ids into list |
| 26 | * @param[in] path - pathname of persisted error file |
| 27 | * @param[out] list - elog id list |
| 28 | * @return bool - true if the deserialization was successful, false otherwise. |
| 29 | */ |
| 30 | bool deserialize(const fs::path& path, ElogList& list); |
| 31 | |
| 32 | } // namespace elog |
| 33 | } // namespace dump |
| 34 | } // namespace phosphor |