diff options
Autocommit at 30.05.2022 @ 20:53
1 files changed, 2 insertions, 3 deletions
| -rw-r--r-- | src/Models/Table.cpp | 5 |
diff --git a/src/Models/Table.cpp b/src/Models/Table.cpp index 6ba20a4..0542991 100644 --- a/src/Models/Table.cpp +++ b/src/Models/Table.cpp @@ -32,7 +32,7 @@ void Table::readFromFile(std::ifstream& inFile) { unsigned commaCount = countOfCommas(inFile); unsigned colInd = 0; cells.add(List<Cell*>()); - while (!inFile.eof()) { + while (inFile.peek() != EOF) { while (inFile.peek() == ' ') inFile.get(); // Entering a new cell on the current row @@ -103,8 +103,7 @@ void Table::readFromFile(std::ifstream& inFile) { #include <iostream> Table::Table(const char* filePath) { std::ifstream inFile(filePath); - std::cout << filePath << std::endl; - if (inFile.is_open()) + if (!inFile.is_open()) throw std::logic_error("Could not open file!"); cells = List<List<Cell*>>(); readFromFile(inFile); |
