blob: 930e378b954ccd161763883e53dbc31f90168991 [file] [log] [blame]
Matt Spinleracb7c102020-01-10 13:49:22 -06001#pragma once
2
Matt Spinler81bc5612023-06-01 16:48:19 -05003#include <cstdint>
Matt Spinleracb7c102020-01-10 13:49:22 -06004#include <optional>
5#include <string>
6#include <vector>
7
8namespace 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
Harisuddin Mohamed Isaf67bafd2020-07-06 17:51:21 +080018 * @param[in] creatorID - Creator Subsystem ID from Private Header
Harisuddin Mohamed Isa3fdcd4e2020-08-26 11:56:42 +080019 * @param[in] plugins - Vector of strings of plugins found in filesystem
Matt Spinleracb7c102020-01-10 13:49:22 -060020 * @return std::optional<std::string> - The JSON string if it could be created,
21 * else std::nullopt.
22 */
23std::optional<std::string> getJSON(uint16_t componentID, uint8_t subType,
24 uint8_t version,
Harisuddin Mohamed Isaf67bafd2020-07-06 17:51:21 +080025 const std::vector<uint8_t>& data,
Harisuddin Mohamed Isa3fdcd4e2020-08-26 11:56:42 +080026 uint8_t creatorID,
27 const std::vector<std::string>& plugins);
Matt Spinleracb7c102020-01-10 13:49:22 -060028
29} // namespace openpower::pels::user_data