#pragma once #include #include "config.h" #include "ldap_mapper_entry.hpp" namespace phosphor { namespace user { namespace fs = std::experimental::filesystem; /** @brief Serialize and persist LDAP privilege mapper D-Bus object * * @param[in] entry - LDAP privilege mapper entry * @param[in] id - filename of the persisted LDAP mapper entry * @param[in] dir - pathname of directory where the serialized privilege * mappings are stored. * * @return fs::path - pathname of persisted error file */ fs::path serialize(const LDAPMapperEntry& entry, Id id, const fs::path& dir); /** @brief Deserialize a persisted LDAP privilege mapper into a D-Bus object * * @param[in] path - pathname of persisted file * @param[in/out] entry - reference to LDAP privilege mapper entry object * which is the target of deserialization. * * @return bool - true if the deserialization was successful, false otherwise. */ bool deserialize(const fs::path& path, LDAPMapperEntry& entry); } // namespace user } // namespace phosphor