Check whether failbit or badbit are set in filefuncs.cpp
This commit is contained in:
parent
c7f6a3eba9
commit
379a230765
|
@ -6,7 +6,7 @@ using namespace std;
|
||||||
string getFileContent(const string& file)
|
string getFileContent(const string& file)
|
||||||
{
|
{
|
||||||
ifstream fileStream(file, ios::in);
|
ifstream fileStream(file, ios::in);
|
||||||
if (not fileStream.fail()) {
|
if (fileStream) {
|
||||||
string lineinput, fullinput;
|
string lineinput, fullinput;
|
||||||
while (getline(fileStream, lineinput)) {
|
while (getline(fileStream, lineinput)) {
|
||||||
fullinput.append(lineinput += '\n');
|
fullinput.append(lineinput += '\n');
|
||||||
|
|
Loading…
Reference in New Issue