MCPcopy Create free account
hub / github.com/CobaltFusion/DebugViewPP / ReadLocalTime

Function ReadLocalTime

DebugView++Lib/FileIO.cpp:193–208  ·  view source on GitHub ↗

read localtime in format "HH:mm:ss"

Source from the content-addressed store, hash-verified

191
192// read localtime in format "HH:mm:ss"
193bool ReadLocalTime(const std::string& text, FILETIME& ft)
194{
195 std::istringstream is(text);
196 WORD h, m, s;
197 char c1, c2;
198 if (!((is >> h >> c1 >> m >> c2 >> s) && c1 == ':' && c2 == ':'))
199 return false;
200
201 SYSTEMTIME st = Win32::FileTimeToSystemTime(FILETIME());
202 st.wHour = h;
203 st.wMinute = m;
204 st.wSecond = s;
205 st.wMilliseconds = 0;
206 ft = Win32::LocalFileTimeToFileTime(Win32::SystemTimeToFileTime(st));
207 return true;
208}
209
210std::istream& ReadLogFileMessage(std::istream& is, Line& line)
211{

Callers 1

Calls 3

FileTimeToSystemTimeFunction · 0.85
LocalFileTimeToFileTimeFunction · 0.85
SystemTimeToFileTimeFunction · 0.85

Tested by

no test coverage detected