PEL: Repository: Add write() function

Pull the code that writes a PEL object to a file into a separate
function so that it can be called in multiple places.

Signed-off-by: Matt Spinler <spinler@us.ibm.com>
Change-Id: Ic5701fdfb03cca915520222bbbd8bb92a9c47c49
diff --git a/extensions/openpower-pels/repository.hpp b/extensions/openpower-pels/repository.hpp
index 5c31fed..0832f58 100644
--- a/extensions/openpower-pels/repository.hpp
+++ b/extensions/openpower-pels/repository.hpp
@@ -293,6 +293,16 @@
     void restore();
 
     /**
+     * @brief Stores a PEL object in the filesystem.
+     *
+     * @param[in] pel - The PEL to write
+     * @param[in] path - The file to write to
+     *
+     * Throws exceptions on failures.
+     */
+    void write(const PEL& pel, const std::filesystem::path& path);
+
+    /**
      * @brief The filesystem path to the PEL logs.
      */
     const std::filesystem::path _logPath;