26 #ifndef __SYNFIG_TIME_H
27 #define __SYNFIG_TIME_H
76 Time(
int hour,
int minute,
float second):value_(static_cast<
value_type>(second+hour*3600+minute*60)) { }
104 const char *c_str()
const;
113 bool is_equal(
const Time& rhs)
const {
return (value_>rhs.value_)?value_-rhs.value_<=epsilon_():rhs.value_-value_<=epsilon_(); }
117 operator double()
const {
return value_; }
119 template<
typename U>
bool operator<(
const U& rhs)
const {
return value_<rhs; }
120 template<
typename U>
bool operator>(
const U& rhs)
const {
return value_>rhs; }
121 template<
typename U>
bool operator<=(
const U& rhs)
const {
return value_<=rhs; }
122 template<
typename U>
bool operator>=(
const U& rhs)
const {
return value_>=rhs; }
123 template<
typename U>
bool operator==(
const U& rhs)
const {
return value_==rhs; }
124 template<
typename U>
bool operator!=(
const U& rhs)
const {
return value_!=rhs; }
127 bool operator<(
const Time& rhs)
const {
return value_<rhs.value_; }
128 bool operator>(
const Time& rhs)
const {
return value_>rhs.value_; }
129 bool operator<=(
const Time& rhs)
const {
return value_<=rhs.value_; }
130 bool operator>=(
const Time& rhs)
const {
return value_>=rhs.value_; }
131 bool operator==(
const Time& rhs)
const {
return value_==rhs.value_; }
132 bool operator!=(
const Time& rhs)
const {
return value_!=rhs.value_; }
158 {
return static_cast<Time::Format>((int)lhs|(
int)rhs); }
165 {
return (static_cast<int>(lhs) & static_cast<int>(rhs))==
static_cast<int>(rhs); }