Convert this Time object to a formatted string. @function tostring @tparam Time this Time object. @treturn string A string showing time in "HH:MM:SS.CC" format.
| 163 | // @tparam Time this Time object. |
| 164 | // @treturn string A string showing time in "HH:MM:SS.CC" format. |
| 165 | std::string Time::ToString() const |
| 166 | { |
| 167 | auto hmsc = GetHmsc(); |
| 168 | |
| 169 | auto stream = std::ostringstream(); |
| 170 | stream << std::setw(2) << std::setfill('0') << hmsc.Hours << ":" |
| 171 | << std::setw(2) << std::setfill('0') << hmsc.Minutes << ":" |
| 172 | << std::setw(2) << std::setfill('0') << hmsc.Seconds << "." |
| 173 | << std::setw(2) << std::setfill('0') << hmsc.Centiseconds; |
| 174 | return stream.str(); |
| 175 | } |
| 176 | |
| 177 | Time& Time::operator ++() |
| 178 | { |