blob: ecfc9346eeb29709b8c87a149436e2a952ddbc53 [file] [log] [blame]
Jayanth Othayoth24964822017-09-04 22:07:06 -05001#pragma once
2
3#include <experimental/filesystem>
4
5#include "elog_watch.hpp"
6#include "config.h"
7
8namespace phosphor
9{
10namespace dump
11{
12namespace elog
13{
14
15namespace 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 */
22void 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 */
30bool deserialize(const fs::path& path, ElogList& list);
31
32} // namespace elog
33} // namespace dump
34} // namespace phosphor