blob: f48f73cd2dd33f4eb408ed6ade120333e7195dc8 [file] [log] [blame]
Tom Joseph0b14c472018-09-30 01:42:59 +05301#pragma once
2
3#include <experimental/filesystem>
4#include "ldap_mapper_entry.hpp"
5
6namespace phosphor
7{
8namespace user
9{
10
11namespace fs = std::experimental::filesystem;
12
13/** @brief Serialize and persist LDAP privilege mapper D-Bus object
14 *
15 * @param[in] entry - LDAP privilege mapper entry
16 * @param[in] id - filename of the persisted LDAP mapper entry
17 *
18 * @return fs::path - pathname of persisted error file
19 */
20fs::path serialize(const LDAPMapperEntry& entry, Id id);
21
22/** @brief Deserialize a persisted LDAP privilege mapper into a D-Bus object
23 *
24 * @param[in] path - pathname of persisted file
25 * @param[in/out] entry - reference to LDAP privilege mapper entry object
26 * which is the target of deserialization.
27 *
28 * @return bool - true if the deserialization was successful, false otherwise.
29 */
30bool deserialize(const fs::path& path, LDAPMapperEntry& entry);
31
32} // namespace user
33} // namespace phosphor