blob: f7f3bd99c7a66a44f5ae4b76dc2c8e79159f6ab6 [file] [log] [blame]
Deepak Kodihalli72654f12017-06-12 04:33:29 -05001#pragma once
2
3#include <string>
4#include <vector>
5#include <experimental/filesystem>
6#include "elog_entry.hpp"
7#include "config.h"
8
9namespace phosphor
10{
11namespace logging
12{
13
14namespace fs = std::experimental::filesystem;
15
Deepak Kodihalli72654f12017-06-12 04:33:29 -050016/** @brief Serialize and persist error d-bus object
17 * @param[in] a - const reference to error entry.
18 * @param[in] dir - pathname of directory where the serialized error will
19 * be placed.
20 * @return fs::path - pathname of persisted error file
21 */
22fs::path serialize(const Entry& e,
23 const fs::path& dir = fs::path(ERRLOG_PERSIST_PATH));
24
25/** @brief Deserialze a persisted error into a d-bus object
26 * @param[in] path - pathname of persisted error file
27 * @param[in] e - reference to error object which is the target of
28 * deserialization.
29 * @return bool - true if the deserialization was successful, false otherwise.
30 */
31bool deserialize(const fs::path& path, Entry& e);
32
33} // namespace logging
34} // namespace phosphor