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