Exemplo n.º 1
0
bool TableReader::getNextRow(VecStr & row){
	std::string currentLine = "";
	row.clear();
	if(njh::files::crossPlatGetline(*in_, currentLine)){
		row = tokenizeString(currentLine, tabOpts_.inDelim_, true);
		if(row.size() != header_.nCol()){
			std::stringstream ss;
			ss << __PRETTY_FUNCTION__ << ", error the row has a different number of columns than the first line" << "\n";
			ss << "rowSize: " << row.size() << ", firstLineSize: " << header_.nCol() << "\n";
			ss << "row: " << currentLine << "\n";
			throw std::runtime_error{ss.str()};
		}
		return true;
	}
	return false;
}