blob: d8c8bbdc5ef4ab83fd2b51d3e353694eb6ff95ac [file] [log] [blame]
Patrick Ventureab650002019-03-16 09:08:47 -07001#pragma once
2
Patrick Venture3fb74292019-03-16 11:32:16 -07003#include <cstdint>
Patrick Ventureab650002019-03-16 09:08:47 -07004#include <nlohmann/json.hpp>
5#include <string>
Patrick Venture3fb74292019-03-16 11:32:16 -07006#include <tuple>
7#include <vector>
Patrick Ventureab650002019-03-16 09:08:47 -07008
9namespace google
10{
11namespace ipmi
12{
13
14/**
15 * Parse a file and return the json object.
16 *
17 * @param[in] file - the path to the file to parse.
18 * @return the json object if valid.
19 * @throw elog<InternalFailure> on failures.
20 */
21nlohmann::json parseConfig(const std::string& file);
22
Patrick Venture8d5c9ce2019-03-16 11:20:12 -070023/**
24 * Read a dts property file and return the contents.
25 *
26 * @param[in] file - the path to the file to parse.
27 * @return the property value or an empty string on failure.
28 */
29std::string readPropertyFile(const std::string& fileName);
30
Patrick Venture3fb74292019-03-16 11:32:16 -070031/**
32 * Build a map of the i2c bus numbers to their PCIe slot names.
33 *
34 * @return list of pairs of i2c bus with their corresponding slot names.
35 */
36std::vector<std::tuple<std::uint32_t, std::string>> buildPcieMap();
37
Patrick Ventureab650002019-03-16 09:08:47 -070038} // namespace ipmi
39} // namespace google