34 lines
858 B
C++
34 lines
858 B
C++
#ifndef COSMETIC_H
|
||
#define COSMETIC_H
|
||
|
||
#include <string>
|
||
#include <ctime>
|
||
|
||
class Cosmetic {
|
||
public:
|
||
Cosmetic(std::string name = "", double price = 0.0, bool type = true, std::string expirationDate = "");
|
||
|
||
// Getter方法
|
||
std::string getName() const;
|
||
double getPrice() const;
|
||
bool getType() const;
|
||
std::string getExpirationDate() const;
|
||
|
||
// Setter方法
|
||
void setName(std::string name);
|
||
void setPrice(double price);
|
||
void setType(bool type);
|
||
// 获取当前时间
|
||
static std::string getTime();
|
||
// 获取当前时间+days天
|
||
static std::string getTimeAdd(int days = 60);
|
||
|
||
private:
|
||
std::string name; // 品牌名称
|
||
double price; // 单价
|
||
bool type; // 类型(true:国产, false:进口)
|
||
std::string expirationDate; // 新增过期日期成员
|
||
};
|
||
|
||
#endif // COSMETIC_H
|