summaryrefslogtreecommitdiffstats
path: root/phosphor-ldap-mapper/ldap_mapper_serialize.hpp
blob: 5ab71c000895b62dde1e2a8fb50b75cdd053a68f (plain)
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
#pragma once

#include <experimental/filesystem>
#include "config.h"
#include "ldap_mapper_entry.hpp"

namespace phosphor
{
namespace user
{

namespace fs = std::experimental::filesystem;

/** @brief Serialize and persist LDAP privilege mapper D-Bus object
 *
 *  @param[in] entry - LDAP privilege mapper entry
 *  @param[in] id - filename of the persisted LDAP mapper entry
 *  @param[in] dir - pathname of directory where the serialized privilege
 *                   mappings are stored.
 *
 *  @return fs::path - pathname of persisted error file
 */
fs::path serialize(const LDAPMapperEntry& entry, Id id, const fs::path& dir);

/** @brief Deserialize a persisted LDAP privilege mapper into a D-Bus object
 *
 *  @param[in] path - pathname of persisted file
 *  @param[in/out] entry - reference to  LDAP privilege mapper entry object
 *                         which is the target of deserialization.
 *
 *  @return bool - true if the deserialization was successful, false otherwise.
 */
bool deserialize(const fs::path& path, LDAPMapperEntry& entry);

} // namespace user
} // namespace phosphor
OpenPOWER on IntegriCloud