So I'm trying to loop and read in values from my csv while there are values to be read. What do I use for the while condition?
I tried all manner of things.....
void load()
{//read from file
ifstream inFile("csv.txt");
string line;
if(inFile.is_open())
{
}
else
{
cout << "Error opening file!" << endl;
}
while()
{
aircraft temp;
stringstream stream(line);
stream >> temp.serial;
stream.ignore ( std::numeric_limits<std::streamsize>::max(), ',' );
getline(stream,temp.name,',');
stream.ignore ( std::numeric_limits<std::streamsize>::max(), ',' );
getline(stream,temp.manufacturer, ',');
stream >> temp.registration;
stream.ignore ( std::numeric_limits<std::streamsize>::max(), ',' );
getline(stream,temp.owner, ',');
getline(stream,temp.productionDate, ',');
getline(stream,temp.stdInspection, ',');
getline(stream,temp.extraInspection, ',');
mainList.push_front(temp);
}
inFile.close();
}