-
Notifications
You must be signed in to change notification settings - Fork 34
/
elog_serialize.hpp
46 lines (37 loc) · 1.34 KB
/
elog_serialize.hpp
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
#pragma once
#include "config.h"
#include "elog_entry.hpp"
#include "paths.hpp"
#include <filesystem>
#include <string>
#include <vector>
namespace phosphor
{
namespace logging
{
namespace fs = std::filesystem;
/** @brief Serialize and persist error d-bus object
* @param[in] a - const reference to error entry.
* @param[in] dir - pathname of directory where the serialized error will
* be placed.
* @return fs::path - pathname of persisted error file
*/
fs::path serialize(const Entry& e,
const fs::path& dir = fs::path(paths::error()));
/** @brief Deserialze a persisted error into a d-bus object
* @param[in] path - pathname of persisted error file
* @param[in] e - reference to error object which is the target of
* deserialization.
* @return bool - true if the deserialization was successful, false otherwise.
*/
bool deserialize(const fs::path& path, Entry& e);
/** @brief Return the path to serialize a log entry to
* @param[in] id - log entry ID
* @param[in] dir - pathname of directory where the serialized error will
* be placed.
* @return fs::path - pathname of persisted error file
*/
fs::path getEntrySerializePath(uint32_t id,
const fs::path& dir = fs::path(paths::error()));
} // namespace logging
} // namespace phosphor