Ratan Gupta | fd761da | 2019-04-12 21:48:57 +0530 | [diff] [blame] | 1 | #pragma once |
| 2 | |
Ratan Gupta | 7b04c35 | 2019-04-12 21:46:29 +0530 | [diff] [blame] | 3 | #include <filesystem> |
Ratan Gupta | fd761da | 2019-04-12 21:48:57 +0530 | [diff] [blame] | 4 | #include "config.h" |
| 5 | #include "ldap_mapper_entry.hpp" |
| 6 | |
| 7 | namespace phosphor |
| 8 | { |
Ratan Gupta | 7b04c35 | 2019-04-12 21:46:29 +0530 | [diff] [blame] | 9 | namespace ldap |
Ratan Gupta | fd761da | 2019-04-12 21:48:57 +0530 | [diff] [blame] | 10 | { |
| 11 | |
Ratan Gupta | 7b04c35 | 2019-04-12 21:46:29 +0530 | [diff] [blame] | 12 | namespace fs = std::filesystem; |
Ratan Gupta | fd761da | 2019-04-12 21:48:57 +0530 | [diff] [blame] | 13 | |
| 14 | /** @brief Serialize and persist LDAP privilege mapper D-Bus object |
| 15 | * |
| 16 | * @param[in] entry - LDAP privilege mapper entry |
Ratan Gupta | 7b04c35 | 2019-04-12 21:46:29 +0530 | [diff] [blame] | 17 | * @param[in] path - pathname of persisted LDAP mapper entry |
Ratan Gupta | fd761da | 2019-04-12 21:48:57 +0530 | [diff] [blame] | 18 | * |
| 19 | * @return fs::path - pathname of persisted error file |
| 20 | */ |
Ratan Gupta | 7b04c35 | 2019-04-12 21:46:29 +0530 | [diff] [blame] | 21 | fs::path serialize(const LDAPMapperEntry& entry, const fs::path& dir); |
Ratan Gupta | fd761da | 2019-04-12 21:48:57 +0530 | [diff] [blame] | 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 | |
Ratan Gupta | 7b04c35 | 2019-04-12 21:46:29 +0530 | [diff] [blame] | 33 | } // namespace ldap |
Ratan Gupta | fd761da | 2019-04-12 21:48:57 +0530 | [diff] [blame] | 34 | } // namespace phosphor |