diff options
Diffstat (limited to 'src/dcp_time.cc')
| -rw-r--r-- | src/dcp_time.cc | 22 |
1 files changed, 22 insertions, 0 deletions
diff --git a/src/dcp_time.cc b/src/dcp_time.cc index 2e79e742..5e8bf801 100644 --- a/src/dcp_time.cc +++ b/src/dcp_time.cc @@ -28,6 +28,28 @@ libdcp::operator== (Time const & a, Time const & b) return (a.h == b.h && a.m == b.m && a.s == b.s && a.ms == b.ms); } +bool +libdcp::operator<= (Time const & a, Time const & b) +{ + if (a.h != b.h) { + return a.h <= b.h; + } + + if (a.m != b.m) { + return a.m <= b.m; + } + + if (a.s != b.s) { + return a.s <= b.s; + } + + if (a.ms != b.ms) { + return a.ms <= b.ms; + } + + return true; +} + ostream & libdcp::operator<< (ostream& s, Time const & t) { |
