Dhruvaraj Subhashchandran | 6524b9d | 2017-10-18 01:41:51 -0500 | [diff] [blame] | 1 | #pragma once |
| 2 | |
| 3 | #include <experimental/filesystem> |
| 4 | #include "event_entry.hpp" |
| 5 | #include "config.h" |
| 6 | |
| 7 | namespace phosphor |
| 8 | { |
| 9 | namespace events |
| 10 | { |
| 11 | |
| 12 | namespace 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 | */ |
| 19 | fs::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 | */ |
| 27 | bool deserialize(const fs::path& path, Entry& event); |
| 28 | |
| 29 | } // namespace events |
| 30 | } // namespace phosphor |