summaryrefslogtreecommitdiffstats
path: root/phosphor-ldap-mapper/ldap_mapper_serialize.hpp
diff options
context:
space:
mode:
Diffstat (limited to 'phosphor-ldap-mapper/ldap_mapper_serialize.hpp')
-rw-r--r--phosphor-ldap-mapper/ldap_mapper_serialize.hpp33
1 files changed, 33 insertions, 0 deletions
diff --git a/phosphor-ldap-mapper/ldap_mapper_serialize.hpp b/phosphor-ldap-mapper/ldap_mapper_serialize.hpp
new file mode 100644
index 0000000..f48f73c
--- /dev/null
+++ b/phosphor-ldap-mapper/ldap_mapper_serialize.hpp
@@ -0,0 +1,33 @@
+#pragma once
+
+#include <experimental/filesystem>
+#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
+ *
+ * @return fs::path - pathname of persisted error file
+ */
+fs::path serialize(const LDAPMapperEntry& entry, Id id);
+
+/** @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
OpenPOWER on IntegriCloud