readFileAsString(): Accept path as boost::filesystem::path instead of string

This commit is contained in:
Kamil Śliwak
2021-08-17 12:58:33 +02:00
parent 790d08f24b
commit cb1a0f08ca
9 changed files with 25 additions and 27 deletions
+3 -1
View File
@@ -24,6 +24,8 @@
#pragma once
#include <boost/filesystem.hpp>
#include <libsolutil/Common.h>
#include <iostream>
#include <sstream>
@@ -36,7 +38,7 @@ namespace solidity::util
/// If the file doesn't exist, it will throw a FileNotFound exception.
/// If the file exists but is not a regular file, it will throw NotAFile exception.
/// If the file is empty, returns an empty string.
std::string readFileAsString(std::string const& _file);
std::string readFileAsString(boost::filesystem::path const& _file);
/// Retrieves and returns the whole content of the specified input stream (until EOF).
std::string readUntilEnd(std::istream& _stdin);