-
Notifications
You must be signed in to change notification settings - Fork 0
/
Stock.h
55 lines (41 loc) · 849 Bytes
/
Stock.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
52
53
54
55
#ifndef STOCK_H
#define STOCK_H
#include <string>
#include "Item.h"
#include <iostream>
#include <fstream>
using namespace std;
class Stock
{
private:
Item* items;
int size;
int capacity;
void resize();
public:
Stock(int capacity = 1);
Stock(const Stock& stock);
~Stock();
const Item* getItems() const;
Item getItem(int) const;
int getSize() const;
int getCapacity() const;
void setItems(Item*);
void setSize(int);
void setCapacity(int);
void setItem(Item, int);
void saveStock();
void loadStock();
void addItem(Item);
void removeItem(string);
int updateItem(string);
void updateItem(int, string);
int searchItem(string);
int searchItemName(string);
void printStock();
char getValidChoice();
Stock operator=(const Stock& stock);
//overload index operator
Item& operator[](const int index) const;
};
#endif