1 #pragma once 2 3 #include "config.h" 4 5 #include "elog_entry.hpp" 6 7 #include <experimental/filesystem> 8 #include <string> 9 #include <vector> 10 11 namespace phosphor 12 { 13 namespace logging 14 { 15 16 namespace fs = std::experimental::filesystem; 17 18 /** @brief Serialize and persist error d-bus object 19 * @param[in] a - const reference to error entry. 20 * @param[in] dir - pathname of directory where the serialized error will 21 * be placed. 22 * @return fs::path - pathname of persisted error file 23 */ 24 fs::path serialize(const Entry& e, 25 const fs::path& dir = fs::path(ERRLOG_PERSIST_PATH)); 26 27 /** @brief Deserialze a persisted error into a d-bus object 28 * @param[in] path - pathname of persisted error file 29 * @param[in] e - reference to error object which is the target of 30 * deserialization. 31 * @return bool - true if the deserialization was successful, false otherwise. 32 */ 33 bool deserialize(const fs::path& path, Entry& e); 34 35 } // namespace logging 36 } // namespace phosphor 37