forked from ibm-openbmc/phosphor-debug-collector
-
Notifications
You must be signed in to change notification settings - Fork 0
/
dump_serialize.hpp
35 lines (29 loc) · 893 Bytes
/
dump_serialize.hpp
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
#pragma once
#include "config.h"
#include <filesystem>
#include <set>
namespace phosphor
{
namespace dump
{
namespace elog
{
using EId = uint32_t;
using ElogList = std::set<EId>;
/** @brief Serialize and persist list of ids.
* @param[in] list - elog id list.
* @param[in] dir - pathname of file where the serialized elog id's will
* be placed.
*/
void serialize(const ElogList& list,
const std::filesystem::path& dir =
std::filesystem::path(ELOG_ID_PERSIST_PATH));
/** @brief Deserialze a persisted list of ids into list
* @param[in] path - pathname of persisted error file
* @param[out] list - elog id list
* @return bool - true if the deserialization was successful, false otherwise.
*/
bool deserialize(const std::filesystem::path& path, ElogList& list);
} // namespace elog
} // namespace dump
} // namespace phosphor