| 61 | } |
| 62 | |
| 63 | void Timestamp::setTime(const std::string& stime) { |
| 64 | std::string::size_type p = stime.find('.'); |
| 65 | if (p == std::string::npos) { |
| 66 | m_secs = atol(stime.c_str()); |
| 67 | m_usecs = 0; |
| 68 | } else { |
| 69 | m_secs = atol(stime.substr(0, p).c_str()); |
| 70 | |
| 71 | std::string s_usecs = stime.substr(p + 1, 6); |
| 72 | m_usecs = atol(stime.substr(p + 1).c_str()); |
| 73 | m_usecs *= (unsigned long)pow(10.0, double(6 - s_usecs.length())); |
| 74 | } |
| 75 | } |
| 76 | |
| 77 | void Timestamp::setTime(double s) { |
| 78 | m_secs = (unsigned long)s; |