Initialize the fileStream local variable instead of calling ifstream::open in filefuncs.cpp
This commit is contained in:
parent
5cea9251bd
commit
613e2f7019
@ -4,9 +4,8 @@ using namespace std;
|
||||
|
||||
string getFileContent(const string& file)
|
||||
{
|
||||
ifstream fileStream;
|
||||
ifstream fileStream(file, ios::in);
|
||||
string lineinput, fullinput;
|
||||
fileStream.open(file, ios::in);
|
||||
if (fileStream.is_open()) while (getline(fileStream, lineinput)) {
|
||||
fullinput.append(lineinput += '\n');
|
||||
} else throw Yerbacon::Exception("Could not open \"" + file + "\".");
|
||||
|
Loading…
Reference in New Issue
Block a user