1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46
|
string dummy;
getline(InClientFile, dummy);
// Book(string title, string author, double price, int QoH, int QS, string ISBN, double cost)
std::string aTitle, aAuthor, aPrice, aQOH, aQS, aISBN, aCost;
while (
getline(InClientFile, dummy, '"')
and
getline(InClientFile, aTitle, '"')
and
getline(InClientFile, dummy, '"')
and
getline(InClientFile, aAuthor, '"')
and
getline(InClientFile, dummy, '"')
and
getline(InClientFile, aPrice, '"')
and
getline(InClientFile, dummy, '"')
and
getline(InClientFile, aQOH, '"')
and
getline(InClientFile, dummy, '"')
and
getline(InClientFile, aQS, '"')
and
getline(InClientFile, dummy, '"')
and
getline(InClientFile, aISBN, '"')
and
getline(InClientFile, dummy, '"')
and
getline(InClientFile, aCost, '"')
)
{
std::cout << "Book title: " << aTitle << '\n';
std::cout << " Author: " << aAuthor << '\n';
std::cout << " Price: " << aPrice << '\n';
std::cout << " QOH: " << aQOH << '\n';
std::cout << " QS: " << aQS << '\n';
std::cout << " ISBN: " << aISBN << '\n';
std::cout << " Cost: " << aCost << '\n';
}
| |