Basic writer.
[libsub.git] / src / sub_time.cc
index 6de245681c99fb5f35fe9b298baaf35652cc4d71..a8e3a31b57a620de237ebaa080c80a99947b5d84 100644 (file)
 */
 
 #include "sub_time.h"
+#include "compose.hpp"
 #include <iostream>
 
 using std::ostream;
+using std::string;
 using namespace sub;
 
 bool
@@ -35,3 +37,9 @@ sub::operator<< (ostream& s, Time const & t)
        s << t._hours << ":" << t._minutes << ":" << t._seconds << ":" << t._frames;
        return s;
 }
+
+string
+Time::timecode () const
+{
+       return String::compose ("%1:%2:%3:%4", _hours, _minutes, _seconds, _frames);
+}