blob: 9199da72329551d725a84e6e9393184350326db0 [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
5#include "elog_watch.hpp"
Jayanth Othayothcb65ffc2018-10-16 08:29:32 -05006
7#include <experimental/filesystem>
Jayanth Othayoth24964822017-09-04 22:07:06 -05008
9namespace phosphor
10{
11namespace dump
12{
13namespace elog
14{
15
16namespace fs = std::experimental::filesystem;
17
18/** @brief Serialize and persist list of ids.
19 * @param[in] list - elog id list.
20 * @param[in] dir - pathname of file where the serialized elog id's will
21 * be placed.
22 */
23void serialize(const ElogList& list,
24 const fs::path& dir = fs::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 */
31bool deserialize(const fs::path& path, ElogList& list);
32
33} // namespace elog
34} // namespace dump
35} // namespace phosphor