videotype.h

来自「data+structures+using+c的源码」· C头文件 代码 · 共 46 行

H
46 行
字号
#ifndef H_videoType
#define H_videoType
#include <iostream>
#include <string>

using namespace std;

class videoType
{
	friend ostream& operator<<(ostream&, const videoType&);
public:
    void setVideoInfo(string title, string star1, 
					  string star2, string producer, 
					  string director, string productionCo, 
					  int setInStock);
    int getNoOfCopiesInStock() const;
    void checkOut();
	void checkIn();
    void printTitle() const;
    void printInfo() const;
    bool checkTitle(string title);
    void updateInStock(int num);
    void setCopiesInStock(int num);
    string getTitle();
    videoType(string title = "" , string star1 = "", 
			  string star2 = "", string producer = "", 
			  string director = "", string productionCo = "", 
      		  int setInStock = 0);
    bool operator==(const videoType&) const;
    bool operator!=(const videoType&) const;
	bool operator<(const videoType&) const;
	bool operator<=(const videoType&) const;
	bool operator>(const videoType&) const;
	bool operator>=(const videoType&) const;

private:
    string videoTitle;	
    string movieStar1;	
    string movieStar2;	
    string movieProducer;  
    string movieDirector; 
    string movieProductionCo;  
    int copiesInStock; 
};

#endif

⌨️ 快捷键说明

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