blob: 0bc76847ede70c409fb07420653386812b459f10 [file] [log] [blame]
Dhruvaraj Subhashchandran3f475242017-07-12 00:44:27 -05001#pragma once
2
3#include <string>
4#include <vector>
5#include <experimental/filesystem>
6#include "host_state_manager.hpp"
7#include "config.h"
8
9namespace phosphor
10{
11namespace state
12{
13namespace manager
14{
15
16namespace fs = std::experimental::filesystem;
17
18/** @brief Serialize and persist requested host state
19 * @param[in] host - const reference to host state.
20 * @param[in] dir - pathname of file where the serialized host state will
21 * be placed.
22 * @return fs::path - pathname of persisted requested host state.
23 */
24fs::path serialize(const Host& host,
25 const fs::path& dir = fs::path(HOST_STATE_PERSIST_PATH));
26
27/** @brief Deserialze a persisted requested host state.
28 * @param[in] path - pathname of persisted host state file
29 * @param[in] host - reference to host state object which is the target of
30 * deserialization.
31 * @return bool - true if the deserialization was successful, false otherwise.
32 */
33bool deserialize(const fs::path& path, Host& host);
34
35} // namespace manager
36} // namespace state
37} // namespace phosphor