Bump version
[libdcp.git] / src / local_time.cc
index 32e8e093bd2702b64fb828ccddc5320ccc8d6364..b8feb849a91f02c3bc79146e6a1ab7b86beaf00e 100644 (file)
@@ -29,6 +29,7 @@
 #include <cstdio>
 
 using std::string;
+using std::ostream;
 using boost::lexical_cast;
 using namespace dcp;
 
@@ -83,7 +84,7 @@ LocalTime::LocalTime (string s)
 {
        /* 2013-01-05T18:06:59+04:00 or 2013-01-05T18:06:59.123+04:00 */
         /* 0123456789012345678901234 or 01234567890123456789012345678 */
-       
+
        if (s.length() < 25) {
                throw TimeFormatError (s);
        }
@@ -156,3 +157,24 @@ LocalTime::time_of_day (bool with_millisecond) const
        }
        return buffer;
 }
+
+bool
+LocalTime::operator== (LocalTime const & other) const
+{
+       return _year == other._year && _month == other._month && _day == other._day &&
+               _hour == other._hour && _second == other._second && _millisecond == other._millisecond &&
+               _tz_hour == other._tz_hour && _tz_minute == other._tz_minute;
+}
+
+bool
+LocalTime::operator!= (LocalTime const & other) const
+{
+       return !(*this == other);
+}
+
+ostream&
+dcp::operator<< (ostream& s, LocalTime const & t)
+{
+       s << t.as_string ();
+       return s;
+}