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