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

📄 cstytime.cpp

📁 特别好玩有启发的东西
💻 CPP
字号:
#include "cstytime.h"


inline bool	
CStyTime::IsHere (const struct tm & t) const
{
	if( t.tm_min > 30 ){
		return tTime.test (t.tm_hour * 2 + 1);
	}
	else{
		return tTime.test (t.tm_hour * 2);
	}
}

inline bool	
CStyTime::IsHere (const int hour, const int minute) const
{
	if( minute > 30 ){
		return tTime.test (hour * 2 + 1);
	}
	else{
		return tTime.test (hour * 2);
	}
}

inline void	
CStyTime::Clear ()
{
	tTime.reset ();
}

inline void	
CStyTime::SetHour (const int hour, bool value)
{
	tTime.set(hour * 2, value);
}

int CStyTime::SetTimeSeg(std::string strTime)
{
	int i;
	int len;
	len = strTime.length();
	if(len != 7*24)
		return -1;
	std::string::iterator it;
	for(it = strTime.begin(),i = 0; it != strTime.end()  &&  i < (7*24); ++it,++i){
		if(*it == '0')
			tTime.set(i,0);
		else if(*it == '1')
			 tTime.set(i,1);
		else return -1;
	}
	return 0;
}

⌨️ 快捷键说明

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