Enable support to handle InternalFailure type dump, during elog restore

Resolves openbmc/openbmc#2078

Change-Id: Iea47b9b7c0cd6cae21642057b21c4e99d85be1e8
Signed-off-by: Jayanth Othayoth <ojayanth@in.ibm.com>
diff --git a/dump_serialize.hpp b/dump_serialize.hpp
new file mode 100644
index 0000000..ecfc934
--- /dev/null
+++ b/dump_serialize.hpp
@@ -0,0 +1,34 @@
+#pragma once
+
+#include <experimental/filesystem>
+
+#include "elog_watch.hpp"
+#include "config.h"
+
+namespace phosphor
+{
+namespace dump
+{
+namespace elog
+{
+
+namespace fs = std::experimental::filesystem;
+
+/** @brief Serialize and persist list of ids.
+ *  @param[in] list - elog id list.
+ *  @param[in] dir - pathname of file where the serialized elog id's will
+ *                   be placed.
+ */
+void serialize(const ElogList& list,
+               const fs::path& dir = fs::path(ELOG_ID_PERSIST_PATH));
+
+/** @brief Deserialze a persisted list of ids into list
+ *  @param[in] path - pathname of persisted error file
+ *  @param[out] list - elog id list
+ *  @return bool - true if the deserialization was successful, false otherwise.
+ */
+bool deserialize(const fs::path& path, ElogList& list);
+
+} // namespace elog
+} // namespace dump
+} // namespace phosphor