1 #pragma once 2 3 #include <cstdint> 4 #include <optional> 5 #include <string> 6 #include <vector> 7 8 namespace openpower::pels::user_data 9 { 10 11 /** 12 * @brief Returns the UserData contents as a formatted JSON string. 13 * 14 * @param[in] componentID - The comp ID from the UserData section header 15 * @param[in] subType - The subtype from the UserData section header 16 * @param[in] version - The version from the UserData section header 17 * @param[in] data - The section data 18 * @param[in] creatorID - Creator Subsystem ID from Private Header 19 * @param[in] plugins - Vector of strings of plugins found in filesystem 20 * @return std::optional<std::string> - The JSON string if it could be created, 21 * else std::nullopt. 22 */ 23 std::optional<std::string> 24 getJSON(uint16_t componentID, uint8_t subType, uint8_t version, 25 const std::vector<uint8_t>& data, uint8_t creatorID, 26 const std::vector<std::string>& plugins); 27 28 } // namespace openpower::pels::user_data 29