-
Notifications
You must be signed in to change notification settings - Fork 1
/
Inventory.h
51 lines (44 loc) · 1.24 KB
/
Inventory.h
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
47
48
49
50
51
#define _CRT_SECURE_NO_WARNINGS
#ifndef INVENTORY_H
#define INVENTORY_H
#include "InventoryBook.h"
#include <fstream>
#include <iostream>
#include <iomanip>
#include <cstring>
#include <string>
#include <vector>
using namespace std;
/*
Inventory Class
Private member variables:
fstream object for the data file
C-string for the file name
Vector of InventoryBook objects
Public member functions:
Default constructor and constructor with C-string parameter
Exception class InvalidFile
addBook with InventoryBook pointer parameter
Search by partial title and partial ISBN
*/
class Inventory
{
private:
fstream dataFile;
char fileName[128];
vector<InventoryBook> books;
public:
Inventory();
Inventory(char *f);
class InvalidFile {};
void addBook(InventoryBook &b);
InventoryBook *searchBookByPartialIsbn(const char *partial_isbn);
InventoryBook *searchBookByPartialTitle(const char *partial_title);
void writeToFile();
friend ostream& operator<< (ostream &out, Inventory &database);
friend class Report;
friend class RingUp;
void editBook(InventoryBook *bookPtr);
void deleteBook(InventoryBook *partial_search);
};
#endif