From 89547bdeabefaa2c8055cc74fd3eac81b5e201be Mon Sep 17 00:00:00 2001 From: Syndamia Date: Mon, 30 May 2022 20:53:33 +0300 Subject: Autocommit at 30.05.2022 @ 20:53 --- src/Models/Table.cpp | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) (limited to 'src/Models/Table.cpp') 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()); - 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 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>(); readFromFile(inFile); -- cgit v1.3.1-23-gd82d