-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathFormat.hpp
More file actions
34 lines (24 loc) · 1.19 KB
/
Copy pathFormat.hpp
File metadata and controls
34 lines (24 loc) · 1.19 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
////////////////////////////////////////////////////////////////////////////////
//! \file Format.hpp
//! \brief Helper functions for parsing and formatting WMI values.
//! \author Chris Oldwood
// Check for previous inclusion
#ifndef APP_FORMAT_HPP
#define APP_FORMAT_HPP
#if _MSC_VER > 1000
#pragma once
#endif
#include <WCL/Variant.hpp>
////////////////////////////////////////////////////////////////////////////////
// Try and convert a string into a datetime. The format of a WMI datetime is:-
// YYYYMMDDHHMMSS.FFFFFF+TZO e.g. 20101008181758.546000+060
bool tryConvertDateTime(const tstring& value, tstring& datetime);
////////////////////////////////////////////////////////////////////////////////
// Try and convert a string into a 64-bit integer. WMI appears to return sint64
// and uint64 values as strings (VT_BSTR).
bool tryConvert64BitInteger(const tstring& value, tstring& integer);
////////////////////////////////////////////////////////////////////////////////
// Format the value. If enabled it will look for strings that appear to be
// WMI style datetimes and reformat them as a normal datetime.
tstring formatValue(const WCL::Variant& value, bool detectDates);
#endif // APP_FORMAT_HPP