blob: b2f55e11ccde5efdcba96c5b04f0482840740d8a [file] [log] [blame]
#pragma once
#include "config.h"
#include "event_entry.hpp"
#include <filesystem>
#include <string>
namespace phosphor
{
namespace events
{
namespace fs = std::filesystem;
/** @brief Serialize and persist event d-bus object
* @param[in] event - const reference to event entry.
* @param[in] eventName - Name of the event.
* @return fs::path - pathname of persisted events file
*/
fs::path serialize(const Entry& event, const std::string& eventName);
/** @brief Deserialze a persisted event into a d-bus object
* @param[in] path - pathname of persisted event file
* @param[in] event - reference to event object which is the target of
* deserialization.
* @return bool - true if the deserialization was successful, false otherwise.
*/
bool deserialize(const fs::path& path, Entry& event);
} // namespace events
} // namespace phosphor