27 #ifndef TOMOGRAPHER_TOOLS_FMT_H
28 #define TOMOGRAPHER_TOOLS_FMT_H
74 const char * what()
const throw() {
92 char * buffer =
new char[size];
104 buffer =
new char[size];
122 inline
std::
string fmts(const
char * fmt, ...)
143 #define streamstr(tokens) \
144 dynamic_cast<std::ostringstream&>( \
145 std::ostringstream().seekp(0) << tokens \
155 #define streamcstr(tokens) streamstr(tokens).c_str()
174 double dt_f =
std::modf(seconds, &dt_i_d);
175 int dt_i = (int)(dt_i_d+0.5);
177 return fmts(
"%d:%02d:%02d.%03d", dt_i/3600, (dt_i/60)%60, dt_i%60, (
int)(dt_f*1000+0.5));
189 template<
typename Rep,
typename Period>
195 double seconds = (double)dt.
count() * Duration::period::num / Duration::period::den ;
Base namespace for the Tomographer project.