1 #pragma once 2 3 #include <filesystem> 4 #include "config.h" 5 #include "ldap_mapper_entry.hpp" 6 7 namespace phosphor 8 { 9 namespace ldap 10 { 11 12 namespace fs = std::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] path - pathname of persisted LDAP mapper entry 18 * 19 * @return fs::path - pathname of persisted error file 20 */ 21 fs::path serialize(const LDAPMapperEntry& entry, const fs::path& dir); 22 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 */ 31 bool deserialize(const fs::path& path, LDAPMapperEntry& entry); 32 33 } // namespace ldap 34 } // namespace phosphor 35