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

📄 time.h

📁 标准C++编写的小小CRM软件,无任何平台依赖.采用标准XML作为数据库.只需重新纺译,可在任何平台上运行.目前测试过在GCC和VC下都可以编译通过
💻 H
字号:
// Time.h: interface for the Time class.
//
//////////////////////////////////////////////////////////////////////
#pragma once
#ifndef _TIME_
#define _TIME_

#include <iostream>
#include <strstream>

using namespace std;

class Time{
	friend istream& operator >> ( istream& is, Time& t );
	friend ostream& operator << ( ostream& is, Time& t );
	friend class DateTime;
public:
	Time();
	Time( unsigned h,unsigned m,unsigned s );
	Time( const Time& t );
	Time( char* t );
	void setTime( unsigned h,unsigned m,unsigned s );
	virtual ~Time();
public:
	unsigned getHour()		{	return hour;	}
	unsigned getMinute()	{	return minute;	}
	unsigned getSecond()	{	return second;	}
	bool operator == (const Time& t);	// check the first time equal to the other.
	bool operator >  (const Time& t);	// check the first time later than the follow
	bool operator <  (const Time& t);	// check the first time earlier than the follow
private:
	unsigned hour:5;
	unsigned minute:6;
	unsigned second:6;
};

istream& operator >> ( istream& is, Time& t);
ostream& operator << ( ostream& os, Time& t);

#endif

⌨️ 快捷键说明

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