blob: f05284577447597c721332e54db2046485c057ac [file] [log] [blame]
Dhruvaraj Subhashchandran6524b9d2017-10-18 01:41:51 -05001#pragma once
2
3#include <experimental/filesystem>
4#include "event_entry.hpp"
5#include "config.h"
6
7namespace phosphor
8{
9namespace events
10{
11
12namespace fs = std::experimental::filesystem;
13
14/** @brief Serialize and persist event d-bus object
15 * @param[in] event - const reference to event entry.
16 * @param[in] eventName - Name of the event.
17 * @return fs::path - pathname of persisted events file
18 */
19fs::path serialize(const Entry& event, const std::string& eventName);
20
21/** @brief Deserialze a persisted event into a d-bus object
22 * @param[in] path - pathname of persisted event file
23 * @param[in] event - reference to event object which is the target of
24 * deserialization.
25 * @return bool - true if the deserialization was successful, false otherwise.
26 */
27bool deserialize(const fs::path& path, Entry& event);
28
29} // namespace events
30} // namespace phosphor