util: move read_file to readPropertyFile
Move a method that reads a file and discards any trailing nul-terminator
found. This is expected in dts property files.
Tested: Only ran unit-tests.
Change-Id: I4a551c0098862bcc1cfb7b20d518d7e2fa890a85
Signed-off-by: Patrick Venture <venture@google.com>
diff --git a/util.hpp b/util.hpp
index d98a6cc..760a1b2 100644
--- a/util.hpp
+++ b/util.hpp
@@ -17,5 +17,13 @@
*/
nlohmann::json parseConfig(const std::string& file);
+/**
+ * Read a dts property file and return the contents.
+ *
+ * @param[in] file - the path to the file to parse.
+ * @return the property value or an empty string on failure.
+ */
+std::string readPropertyFile(const std::string& fileName);
+
} // namespace ipmi
} // namespace google