blob: 371a55679b4c1010a9a7f454b02a45b38865c919 [file] [log] [blame]
Ratan Guptafd761da2019-04-12 21:48:57 +05301#pragma once
2
Ratan Gupta7b04c352019-04-12 21:46:29 +05303#include <filesystem>
Ratan Guptafd761da2019-04-12 21:48:57 +05304#include "config.h"
5#include "ldap_mapper_entry.hpp"
6
7namespace phosphor
8{
Ratan Gupta7b04c352019-04-12 21:46:29 +05309namespace ldap
Ratan Guptafd761da2019-04-12 21:48:57 +053010{
11
Ratan Gupta7b04c352019-04-12 21:46:29 +053012namespace fs = std::filesystem;
Ratan Guptafd761da2019-04-12 21:48:57 +053013
14/** @brief Serialize and persist LDAP privilege mapper D-Bus object
15 *
16 * @param[in] entry - LDAP privilege mapper entry
Ratan Gupta7b04c352019-04-12 21:46:29 +053017 * @param[in] path - pathname of persisted LDAP mapper entry
Ratan Guptafd761da2019-04-12 21:48:57 +053018 *
19 * @return fs::path - pathname of persisted error file
20 */
Ratan Gupta7b04c352019-04-12 21:46:29 +053021fs::path serialize(const LDAPMapperEntry& entry, const fs::path& dir);
Ratan Guptafd761da2019-04-12 21:48:57 +053022
23/** @brief Deserialize a persisted LDAP privilege mapper into a D-Bus object
24 *
25 * @param[in] path - pathname of persisted file
26 * @param[in/out] entry - reference to LDAP privilege mapper entry object
27 * which is the target of deserialization.
28 *
29 * @return bool - true if the deserialization was successful, false otherwise.
30 */
31bool deserialize(const fs::path& path, LDAPMapperEntry& entry);
32
Ratan Gupta7b04c352019-04-12 21:46:29 +053033} // namespace ldap
Ratan Guptafd761da2019-04-12 21:48:57 +053034} // namespace phosphor