summaryrefslogtreecommitdiff
path: root/src/dcp_time.cc
diff options
context:
space:
mode:
authorCarl Hetherington <cth@carlh.net>2012-08-13 02:14:00 +0100
committerCarl Hetherington <cth@carlh.net>2012-08-13 02:14:00 +0100
commitcadec42b9547665ac03a7180af374ebb40df7c78 (patch)
treefed45715e96ce2b0046fd956963efb6625407f78 /src/dcp_time.cc
parent4c987f7feb504fe4011b52ffeb231e3b25823de1 (diff)
Subtitles at method.
Diffstat (limited to 'src/dcp_time.cc')
-rw-r--r--src/dcp_time.cc22
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)
{