3 This file is part of libmspcore
4 Copyright © 2006 Mikko Rasa, Mikkosoft Productions
5 Distributed under the LGPL
10 #include "timedelta.h"
17 using Msp::Time::RawTime;
19 void print_part(ostream &out, RawTime &value, RawTime unit, char sep, bool &first)
21 if(value<unit && first)
37 ostream &operator<<(ostream &out, const TimeDelta &td)
42 RawTime value=td.raw();
54 else if(value<1000000)
59 ss<<'.'<<setw(3)<<value;
65 print_part(ss, value, 86400000000LL, 0, first);
66 print_part(ss, value, 3600000000LL, '-', first);
67 print_part(ss, value, 60000000LL, ':', first);
68 print_part(ss, value, 1000000LL, ':', first);
76 ss<<setw(3)<<value/1000;