read localtime in format "HH:mm:ss.ms"
| 173 | |
| 174 | // read localtime in format "HH:mm:ss.ms" |
| 175 | bool ReadLocalTimeMs(const std::string& text, FILETIME& ft) |
| 176 | { |
| 177 | std::istringstream is(text); |
| 178 | WORD h, m, s, ms; |
| 179 | char c1, c2, d1; |
| 180 | if (!((is >> h >> c1 >> m >> c2 >> s >> d1 >> ms) && c1 == ':' && c2 == ':' && d1 == '.')) |
| 181 | return false; |
| 182 | |
| 183 | SYSTEMTIME st = Win32::FileTimeToSystemTime(FILETIME()); |
| 184 | st.wHour = h; |
| 185 | st.wMinute = m; |
| 186 | st.wSecond = s; |
| 187 | st.wMilliseconds = ms; |
| 188 | ft = Win32::LocalFileTimeToFileTime(Win32::SystemTimeToFileTime(st)); |
| 189 | return true; |
| 190 | } |
| 191 | |
| 192 | // read localtime in format "HH:mm:ss" |
| 193 | bool ReadLocalTime(const std::string& text, FILETIME& ft) |
no test coverage detected