1 #pragma once
2 
3 #include "config.h"
4 
5 #include <filesystem>
6 #include <set>
7 
8 namespace phosphor
9 {
10 namespace dump
11 {
12 namespace elog
13 {
14 using EId = uint32_t;
15 using ElogList = std::set<EId>;
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 std::filesystem::path& dir =
24                    std::filesystem::path(ELOG_ID_PERSIST_PATH));
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  */
31 bool deserialize(const std::filesystem::path& path, ElogList& list);
32 
33 } // namespace elog
34 } // namespace dump
35 } // namespace phosphor
36