blob: bc6cdd81371a88caff372c497d65e5b1ad765460 [file] [log] [blame]
Ratan Guptafd761da2019-04-12 21:48:57 +05301#pragma once
2
Ratan Guptafd761da2019-04-12 21:48:57 +05303#include "config.h"
Patrick Williams9638afb2021-02-22 17:16:24 -06004
Ratan Guptafd761da2019-04-12 21:48:57 +05305#include "ldap_mapper_entry.hpp"
6
Patrick Williams9638afb2021-02-22 17:16:24 -06007#include <filesystem>
8
Ratan Guptafd761da2019-04-12 21:48:57 +05309namespace phosphor
10{
Ratan Gupta7b04c352019-04-12 21:46:29 +053011namespace ldap
Ratan Guptafd761da2019-04-12 21:48:57 +053012{
13
Ratan Gupta7b04c352019-04-12 21:46:29 +053014namespace fs = std::filesystem;
Ratan Guptafd761da2019-04-12 21:48:57 +053015
16/** @brief Serialize and persist LDAP privilege mapper D-Bus object
17 *
18 * @param[in] entry - LDAP privilege mapper entry
Ratan Gupta7b04c352019-04-12 21:46:29 +053019 * @param[in] path - pathname of persisted LDAP mapper entry
Ratan Guptafd761da2019-04-12 21:48:57 +053020 *
21 * @return fs::path - pathname of persisted error file
22 */
Ratan Gupta7b04c352019-04-12 21:46:29 +053023fs::path serialize(const LDAPMapperEntry& entry, const fs::path& dir);
Ratan Guptafd761da2019-04-12 21:48:57 +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
Ratan Gupta7b04c352019-04-12 21:46:29 +053035} // namespace ldap
Ratan Guptafd761da2019-04-12 21:48:57 +053036} // namespace phosphor