blob: 8ad4a2450a66d98a71ca007567cca8f2bb3edeed [file] [log] [blame]
Jayanth Othayoth24964822017-09-04 22:07:06 -05001#pragma once
2
Jayanth Othayothcb65ffc2018-10-16 08:29:32 -05003#include "config.h"
Jayanth Othayoth24964822017-09-04 22:07:06 -05004
Jayanth Othayothcb65ffc2018-10-16 08:29:32 -05005#include <experimental/filesystem>
Chirag Sharma50427252020-08-11 12:11:38 -05006#include <set>
Jayanth Othayoth24964822017-09-04 22:07:06 -05007
8namespace phosphor
9{
10namespace dump
11{
12namespace elog
13{
Chirag Sharma50427252020-08-11 12:11:38 -050014using EId = uint32_t;
15using ElogList = std::set<EId>;
Jayanth Othayoth24964822017-09-04 22:07:06 -050016
17namespace 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 */
24void 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 */
32bool deserialize(const fs::path& path, ElogList& list);
33
34} // namespace elog
35} // namespace dump
36} // namespace phosphor