📄 item.h
字号:
#ifndef ITEM_H
#define ITEM_H
#include <iostream>
#include <string>
#include "AppException.h"
using namespace std;
class Item {
friend ostream& operator<<(ostream& os, const Item& item);
public:
Item(string name);
Item(string name, int count, int seq);
virtual ~Item() {};
bool operator<(const Item& anotherItem) const;
bool operator>(const Item& anotherItem) const;
string getName() const;
int getCount() const;
int getSeq() const;
void incrementCount();
void setCount(int i);
private:
string mName;
int mCount;
int mSeq;
};
inline ostream& operator<<(ostream& os, const Item& item) {
os << "Name: " << item.getName();
os << " Count: " << item.getCount();
return os;
};
#endif /* ITEM_H */
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -