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