X-Git-Url: https://main.carlh.net/gitweb/?p=dcpomatic.git;a=blobdiff_plain;f=src%2Flib%2Fdcpomatic_time.cc;h=6563c6e5f9a2835082082a0116ebe489e16a3e72;hp=f96688979c9504646437846b438738e719d5689f;hb=b1dc9c3a2f7e55c9afc5bf2d5b465371b048e14f;hpb=4a0ae92e28d7d1f0dd648d1b620efc324fdef161 diff --git a/src/lib/dcpomatic_time.cc b/src/lib/dcpomatic_time.cc index f96688979..6563c6e5f 100644 --- a/src/lib/dcpomatic_time.cc +++ b/src/lib/dcpomatic_time.cc @@ -1,5 +1,5 @@ /* - Copyright (C) 2014 Carl Hetherington + Copyright (C) 2014-2016 Carl Hetherington This file is part of DCP-o-matic. @@ -19,8 +19,9 @@ */ #include "dcpomatic_time.h" +#include -using std::ostream; +using std::string; template <> Time::Time (DCPTime d, FrameRateChange f) @@ -76,23 +77,26 @@ max (ContentTime a, ContentTime b) return b; } -ostream & -operator<< (ostream& s, ContentTime t) +string +to_string (ContentTime t) { - s << "[CONT " << t.get() << " " << t.seconds() << "s]"; - return s; + char buffer[64]; + snprintf (buffer, sizeof(buffer), "[CONT %" PRId64 " %fs]", t.get(), t.seconds()); + return buffer; } -ostream & -operator<< (ostream& s, DCPTime t) +string +to_string (DCPTime t) { - s << "[DCP " << t.get() << " " << t.seconds() << "s]"; - return s; + char buffer[64]; + snprintf (buffer, sizeof(buffer), "[DCP %" PRId64 " %fs]", t.get(), t.seconds()); + return buffer; } -ostream & -operator<< (ostream& s, DCPTimePeriod p) +string +to_string (DCPTimePeriod p) { - s << "[DCP " << p.from.get() << " " << p.from.seconds() << "s -> " << p.to.get() << " " << p.to.seconds() << "s]"; - return s; + char buffer[64]; + snprintf (buffer, sizeof(buffer), "[DCP %" PRId64 " %fs -> %" PRId64 " %fs]", p.from.get(), p.from.seconds(), p.to.get(), p.to.seconds()); + return buffer; }