⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 catalog.h

📁 通讯录系统
💻 H
字号:
//Catalog.h
#ifndef CATALOG_H
#define CATALOG_H
#include "Item.h"
#include <iterator>
#include <vector>
//Catalog类
class Catalog {
	std::vector<Item> items;						//存储Item的容器
	static int itemNum;								//Item数量
public:
	Catalog(){};									//构造函数
	void addItem(const Item& newItem);				//增加Item
	Item getItem(int i);							//得到Item
	void removeItemName(std::string name);			//通过姓名删除Item
	void removeItemTel(std::string tel);			//通过电话删除Item	
	std::vector<Item> FindName(std::string);		//通过姓名查找Item
	std::vector<Item> FindTel(std::string);			//通过电话查找Item
	void display();									//打印
	void display(std::vector<Item>& vi);			//打印
	//重载操作符
	Item& operator [](int i) {
		return items[i];
	}
	//得到Item数量
	int getItemNum() {
		return itemNum;
	}
};

#endif

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -