mirror of
https://github.com/ethereum/solidity
synced 2023-10-03 13:03:40 +00:00
readFileAsString(): Accept path as boost::filesystem::path instead of string
This commit is contained in:
@@ -35,8 +35,6 @@
|
||||
#include <libsolutil/CommonData.h>
|
||||
#include <libsolutil/CommonIO.h>
|
||||
|
||||
#include <boost/filesystem.hpp>
|
||||
|
||||
#include <iostream>
|
||||
|
||||
using namespace std;
|
||||
@@ -405,12 +403,12 @@ vector<Program> ProgramFactory::build(Options const& _options)
|
||||
return inputPrograms;
|
||||
}
|
||||
|
||||
CharStream ProgramFactory::loadSource(string const& _sourcePath)
|
||||
CharStream ProgramFactory::loadSource(boost::filesystem::path const& _sourcePath)
|
||||
{
|
||||
assertThrow(boost::filesystem::exists(_sourcePath), MissingFile, "Source file does not exist: " + _sourcePath);
|
||||
assertThrow(boost::filesystem::exists(_sourcePath), MissingFile, "Source file does not exist: " + _sourcePath.string());
|
||||
|
||||
string sourceCode = readFileAsString(_sourcePath);
|
||||
return CharStream(sourceCode, _sourcePath);
|
||||
return CharStream(sourceCode, _sourcePath.string());
|
||||
}
|
||||
|
||||
void Phaser::main(int _argc, char** _argv)
|
||||
|
||||
Reference in New Issue
Block a user