Dhruvaraj Subhashchandran | 6524b9d | 2017-10-18 01:41:51 -0500 | [diff] [blame] | 1 | #pragma once |
| 2 | |
Dhruvaraj Subhashchandran | 6524b9d | 2017-10-18 01:41:51 -0500 | [diff] [blame] | 3 | #include "config.h" |
| 4 | |
Patrick Venture | 3d6d318 | 2018-08-31 09:33:09 -0700 | [diff] [blame] | 5 | #include "event_entry.hpp" |
| 6 | |
| 7 | #include <experimental/filesystem> |
Andrew Geissler | ae4c95c | 2020-05-16 13:58:53 -0500 | [diff] [blame] | 8 | #include <string> |
Patrick Venture | 3d6d318 | 2018-08-31 09:33:09 -0700 | [diff] [blame] | 9 | |
Dhruvaraj Subhashchandran | 6524b9d | 2017-10-18 01:41:51 -0500 | [diff] [blame] | 10 | namespace phosphor |
| 11 | { |
| 12 | namespace events |
| 13 | { |
| 14 | |
| 15 | namespace fs = std::experimental::filesystem; |
| 16 | |
| 17 | /** @brief Serialize and persist event d-bus object |
| 18 | * @param[in] event - const reference to event entry. |
| 19 | * @param[in] eventName - Name of the event. |
| 20 | * @return fs::path - pathname of persisted events file |
| 21 | */ |
| 22 | fs::path serialize(const Entry& event, const std::string& eventName); |
| 23 | |
| 24 | /** @brief Deserialze a persisted event into a d-bus object |
| 25 | * @param[in] path - pathname of persisted event file |
| 26 | * @param[in] event - reference to event object which is the target of |
| 27 | * deserialization. |
| 28 | * @return bool - true if the deserialization was successful, false otherwise. |
| 29 | */ |
| 30 | bool deserialize(const fs::path& path, Entry& event); |
| 31 | |
| 32 | } // namespace events |
| 33 | } // namespace phosphor |