35 lines
962 B
C++
35 lines
962 B
C++
#ifndef COSMETICMANAGER_H
|
|
#define COSMETICMANAGER_H
|
|
|
|
#include "Cosmetic.h"
|
|
#include <string>
|
|
#include <ctime>
|
|
|
|
class CosmeticManager {
|
|
public:
|
|
CosmeticManager();
|
|
~CosmeticManager();
|
|
|
|
bool addCosmetic(const Cosmetic& cosmetic);
|
|
bool deleteCosmetic(const std::string& name);
|
|
Cosmetic* findCosmetic(const std::string& name);
|
|
bool modifyCosmetic(const std::string &name, double newPrice, bool newType, std::string string);
|
|
void loadFromFile();
|
|
void saveToFile();
|
|
void displayAll() const;
|
|
void displayExpiringCosmetics(int i) const; // 查找临期化妆品方法
|
|
bool isValidDate(const std::string &date);
|
|
//窗口显示
|
|
void launchWindow(std::string title,std::string info) const;
|
|
|
|
private:
|
|
Cosmetic** cosmetics; // 动态指针数组
|
|
int count; // 当前化妆品数量
|
|
int capacity; // 数组容量
|
|
|
|
void resizeArray(); // 动态扩容
|
|
};
|
|
|
|
#endif // COSMETICMANAGER_H
|
|
|