1 #pragma once 2 3 #include "config.h" 4 5 #include "ldap_mapper_entry.hpp" 6 7 #include <filesystem> 8 9 namespace phosphor 10 { 11 namespace ldap 12 { 13 14 namespace fs = std::filesystem; 15 16 /** @brief Serialize and persist LDAP privilege mapper D-Bus object 17 * 18 * @param[in] entry - LDAP privilege mapper entry 19 * @param[in] path - pathname of persisted LDAP mapper entry 20 * 21 * @return fs::path - pathname of persisted error file 22 */ 23 fs::path serialize(const LDAPMapperEntry& entry, const fs::path& dir); 24 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 */ 33 bool deserialize(const fs::path& path, LDAPMapperEntry& entry); 34 35 } // namespace ldap 36 } // namespace phosphor 37