Tom Joseph | 0b14c47 | 2018-09-30 01:42:59 +0530 | [diff] [blame] | 1 | #pragma once |
| 2 | |
| 3 | #include <experimental/filesystem> |
| 4 | #include "ldap_mapper_entry.hpp" |
| 5 | |
| 6 | namespace phosphor |
| 7 | { |
| 8 | namespace user |
| 9 | { |
| 10 | |
| 11 | namespace fs = std::experimental::filesystem; |
| 12 | |
| 13 | /** @brief Serialize and persist LDAP privilege mapper D-Bus object |
| 14 | * |
| 15 | * @param[in] entry - LDAP privilege mapper entry |
| 16 | * @param[in] id - filename of the persisted LDAP mapper entry |
| 17 | * |
| 18 | * @return fs::path - pathname of persisted error file |
| 19 | */ |
| 20 | fs::path serialize(const LDAPMapperEntry& entry, Id id); |
| 21 | |
| 22 | /** @brief Deserialize a persisted LDAP privilege mapper into a D-Bus object |
| 23 | * |
| 24 | * @param[in] path - pathname of persisted file |
| 25 | * @param[in/out] entry - reference to LDAP privilege mapper entry object |
| 26 | * which is the target of deserialization. |
| 27 | * |
| 28 | * @return bool - true if the deserialization was successful, false otherwise. |
| 29 | */ |
| 30 | bool deserialize(const fs::path& path, LDAPMapperEntry& entry); |
| 31 | |
| 32 | } // namespace user |
| 33 | } // namespace phosphor |