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