blob: 64fac79bd4d1c2b2823e11d32933e8bfa98c2be0 [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
17 *
18 * @return std::optional<std::string> - The JSON string if it could be created,
19 * else std::nullopt.
20 */
21std::optional<std::string> getJSON(uint16_t componentID, uint8_t subType,
22 uint8_t version,
23 const std::vector<uint8_t>& data);
24
25} // namespace openpower::pels::user_data