PEL: user header in JSON

The PELTool application is able to convert sections to JSON. This commit
takes care of converting the user header section to JSON.

user header section in JSON sample:

"User Header":[
 {"Section Version": "1"},
 {"Sub-section type": "0"},
 {"Log Committed by": "0x2000"},
 {"Subsystem": "bmc_firmware"},
 {"Event Scope": "entire_platform"},
 {"Event Severity":"unrecoverable"},
 {"Event Type": "na"}
]

Signed-off-by: Aatir Manzur <aatrapps@gmail.com>
Change-Id: I0dca1d87019b9e62d711ee6d034f2e8bc0574c2e
diff --git a/extensions/openpower-pels/section.hpp b/extensions/openpower-pels/section.hpp
index 9fe3893..6353e2d 100644
--- a/extensions/openpower-pels/section.hpp
+++ b/extensions/openpower-pels/section.hpp
@@ -1,11 +1,13 @@
 #pragma once
+
 #include "section_header.hpp"
 
+#include <optional>
+
 namespace openpower
 {
 namespace pels
 {
-
 /**
  * @class Section
  *
@@ -46,6 +48,16 @@
      */
     virtual void flatten(Stream& stream) const = 0;
 
+    /**
+     * @brief Get section in JSON. Derived classes to override when required to.
+     * @return std::optional<std::string> - If a section comes with a JSON
+     * repressentation, this would return the string for it.
+     */
+    virtual std::optional<std::string> getJSON() const
+    {
+        return std::nullopt;
+    }
+
   protected:
     /**
      * @brief Returns the flattened size of the section header