summaryrefslogtreecommitdiffstats
path: root/dump_serialize.hpp
blob: ecfc9346eeb29709b8c87a149436e2a952ddbc53 (plain)
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
#pragma once

#include <experimental/filesystem>

#include "elog_watch.hpp"
#include "config.h"

namespace phosphor
{
namespace dump
{
namespace elog
{

namespace fs = std::experimental::filesystem;

/** @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 fs::path& dir = fs::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 fs::path& path, ElogList& list);

} // namespace elog
} // namespace dump
} // namespace phosphor
OpenPOWER on IntegriCloud