blob: 9d6b79d34ce73b5cee43dd1af16bd16d10d427d9 [file] [log] [blame]
Matt Spinleracb7c102020-01-10 13:49:22 -06001#pragma once
2
3#include <optional>
4#include <string>
5#include <vector>
6
7namespace openpower::pels::user_data
8{
9
10/**
11 * @brief Returns the UserData contents as a formatted JSON string.
12 *
13 * @param[in] componentID - The comp ID from the UserData section header
14 * @param[in] subType - The subtype from the UserData section header
15 * @param[in] version - The version from the UserData section header
16 * @param[in] data - The section data
Harisuddin Mohamed Isaf67bafd2020-07-06 17:51:21 +080017 * @param[in] creatorID - Creator Subsystem ID from Private Header
Harisuddin Mohamed Isa3fdcd4e2020-08-26 11:56:42 +080018 * @param[in] plugins - Vector of strings of plugins found in filesystem
Matt Spinleracb7c102020-01-10 13:49:22 -060019 * @return std::optional<std::string> - The JSON string if it could be created,
20 * else std::nullopt.
21 */
22std::optional<std::string> getJSON(uint16_t componentID, uint8_t subType,
23 uint8_t version,
Harisuddin Mohamed Isaf67bafd2020-07-06 17:51:21 +080024 const std::vector<uint8_t>& data,
Harisuddin Mohamed Isa3fdcd4e2020-08-26 11:56:42 +080025 uint8_t creatorID,
26 const std::vector<std::string>& plugins);
Matt Spinleracb7c102020-01-10 13:49:22 -060027
28} // namespace openpower::pels::user_data