Patrick Venture | ab65000 | 2019-03-16 09:08:47 -0700 | [diff] [blame] | 1 | #pragma once |
| 2 | |
| 3 | #include <nlohmann/json.hpp> |
| 4 | #include <string> |
| 5 | |
| 6 | namespace google |
| 7 | { |
| 8 | namespace ipmi |
| 9 | { |
| 10 | |
| 11 | /** |
| 12 | * Parse a file and return the json object. |
| 13 | * |
| 14 | * @param[in] file - the path to the file to parse. |
| 15 | * @return the json object if valid. |
| 16 | * @throw elog<InternalFailure> on failures. |
| 17 | */ |
| 18 | nlohmann::json parseConfig(const std::string& file); |
| 19 | |
Patrick Venture | 8d5c9ce | 2019-03-16 11:20:12 -0700 | [diff] [blame^] | 20 | /** |
| 21 | * Read a dts property file and return the contents. |
| 22 | * |
| 23 | * @param[in] file - the path to the file to parse. |
| 24 | * @return the property value or an empty string on failure. |
| 25 | */ |
| 26 | std::string readPropertyFile(const std::string& fileName); |
| 27 | |
Patrick Venture | ab65000 | 2019-03-16 09:08:47 -0700 | [diff] [blame] | 28 | } // namespace ipmi |
| 29 | } // namespace google |