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
|
Library::Library(ifstream& inbookfile, ifstream& incardfile)
{
//temporary variables
string title, author, name, isbn;
int status, holderID, cardnum, booksout, ch;
string phonenum;
while((ch = inbookfile.get()) != EOF)
{
for(int i = 0; i < numBooks; i++)
{
//reading Books
getline(inbookfile, title); //reads title
getline(inbookfile, author);
getline(inbookfile,isbn); //reads author
inbookfile >> status >> holderID;
inbooks = new Book[numBooks];
inbooks->setTitle(title);
inbooks->setAuthor(author);
inbooks->setISBN(isbn);
delete inbooks;
}
//booklist.push_back(Book(title,author,isbn,status,holderID));
}
while((ch = incardfile.get()) != EOF)
{
for(int i = 0; i < 10; i++)
{
//reading Cards
getline(incardfile, name);
getline(incardfile, phonenum);
incardfile >> cardnum >> booksout;
incards.setname(name);
incards.setphonenum(phonenum);
incards.setcardnum(cardnum);
incards.setbooksout(booksout);
//cardlist.push_back(Card(name, phonenum,cardnum,booksout));
}
}
}
|