File indexing completed on 2025-01-18 09:53:48
0001
0002
0003
0004
0005
0006
0007
0008
0009
0010 #ifndef BOOST_WINAPI_TIME_HPP_INCLUDED_
0011 #define BOOST_WINAPI_TIME_HPP_INCLUDED_
0012
0013 #include <boost/winapi/basic_types.hpp>
0014 #include <boost/winapi/detail/header.hpp>
0015
0016 #ifdef BOOST_HAS_PRAGMA_ONCE
0017 #pragma once
0018 #endif
0019
0020 #if !defined( BOOST_USE_WINDOWS_H )
0021 extern "C" {
0022 struct _FILETIME;
0023 struct _SYSTEMTIME;
0024
0025 BOOST_WINAPI_IMPORT_EXCEPT_WM boost::winapi::VOID_ BOOST_WINAPI_WINAPI_CC
0026 GetSystemTime(::_SYSTEMTIME* lpSystemTime);
0027
0028 #ifdef BOOST_HAS_GETSYSTEMTIMEASFILETIME
0029 BOOST_WINAPI_IMPORT boost::winapi::VOID_ BOOST_WINAPI_WINAPI_CC
0030 GetSystemTimeAsFileTime(::_FILETIME* lpSystemTimeAsFileTime);
0031 #endif
0032
0033 BOOST_WINAPI_IMPORT_EXCEPT_WM boost::winapi::BOOL_ BOOST_WINAPI_WINAPI_CC
0034 SystemTimeToFileTime(
0035 const ::_SYSTEMTIME* lpSystemTime,
0036 ::_FILETIME* lpFileTime);
0037
0038 BOOST_WINAPI_IMPORT_EXCEPT_WM boost::winapi::BOOL_ BOOST_WINAPI_WINAPI_CC
0039 FileTimeToSystemTime(
0040 const ::_FILETIME* lpFileTime,
0041 ::_SYSTEMTIME* lpSystemTime);
0042
0043 #if BOOST_WINAPI_PARTITION_APP_SYSTEM
0044
0045 BOOST_WINAPI_IMPORT_EXCEPT_WM boost::winapi::BOOL_ BOOST_WINAPI_WINAPI_CC
0046 FileTimeToLocalFileTime(
0047 const ::_FILETIME* lpFileTime,
0048 ::_FILETIME* lpLocalFileTime);
0049
0050 BOOST_WINAPI_IMPORT_EXCEPT_WM boost::winapi::BOOL_ BOOST_WINAPI_WINAPI_CC
0051 LocalFileTimeToFileTime(
0052 const ::_FILETIME* lpLocalFileTime,
0053 ::_FILETIME* lpFileTime);
0054
0055 #endif
0056
0057 #if BOOST_WINAPI_PARTITION_DESKTOP_SYSTEM
0058 BOOST_WINAPI_IMPORT_EXCEPT_WM boost::winapi::DWORD_ BOOST_WINAPI_WINAPI_CC
0059 GetTickCount(BOOST_WINAPI_DETAIL_VOID);
0060 #endif
0061
0062 #if BOOST_USE_WINAPI_VERSION >= BOOST_WINAPI_VERSION_WIN6
0063 BOOST_WINAPI_IMPORT boost::winapi::ULONGLONG_ BOOST_WINAPI_WINAPI_CC
0064 GetTickCount64(BOOST_WINAPI_DETAIL_VOID);
0065 #endif
0066
0067 }
0068 #endif
0069
0070 namespace boost {
0071 namespace winapi {
0072
0073 typedef struct BOOST_MAY_ALIAS _FILETIME {
0074 DWORD_ dwLowDateTime;
0075 DWORD_ dwHighDateTime;
0076 } FILETIME_, *PFILETIME_, *LPFILETIME_;
0077
0078 typedef struct BOOST_MAY_ALIAS _SYSTEMTIME {
0079 WORD_ wYear;
0080 WORD_ wMonth;
0081 WORD_ wDayOfWeek;
0082 WORD_ wDay;
0083 WORD_ wHour;
0084 WORD_ wMinute;
0085 WORD_ wSecond;
0086 WORD_ wMilliseconds;
0087 } SYSTEMTIME_, *PSYSTEMTIME_, *LPSYSTEMTIME_;
0088
0089 #if BOOST_WINAPI_PARTITION_DESKTOP_SYSTEM
0090 using ::GetTickCount;
0091 #endif
0092 #if BOOST_USE_WINAPI_VERSION >= BOOST_WINAPI_VERSION_WIN6
0093 using ::GetTickCount64;
0094 #endif
0095
0096 BOOST_FORCEINLINE VOID_ GetSystemTime(LPSYSTEMTIME_ lpSystemTime)
0097 {
0098 ::GetSystemTime(reinterpret_cast< ::_SYSTEMTIME* >(lpSystemTime));
0099 }
0100
0101 BOOST_FORCEINLINE BOOL_ SystemTimeToFileTime(const SYSTEMTIME_* lpSystemTime, FILETIME_* lpFileTime)
0102 {
0103 return ::SystemTimeToFileTime(reinterpret_cast< const ::_SYSTEMTIME* >(lpSystemTime), reinterpret_cast< ::_FILETIME* >(lpFileTime));
0104 }
0105
0106 BOOST_FORCEINLINE BOOL_ FileTimeToSystemTime(const FILETIME_* lpFileTime, SYSTEMTIME_* lpSystemTime)
0107 {
0108 return ::FileTimeToSystemTime(reinterpret_cast< const ::_FILETIME* >(lpFileTime), reinterpret_cast< ::_SYSTEMTIME* >(lpSystemTime));
0109 }
0110
0111 #if BOOST_WINAPI_PARTITION_APP_SYSTEM
0112 BOOST_FORCEINLINE BOOL_ FileTimeToLocalFileTime(const FILETIME_* lpFileTime, FILETIME_* lpLocalFileTime)
0113 {
0114 return ::FileTimeToLocalFileTime(reinterpret_cast< const ::_FILETIME* >(lpFileTime), reinterpret_cast< ::_FILETIME* >(lpLocalFileTime));
0115 }
0116
0117 BOOST_FORCEINLINE BOOL_ LocalFileTimeToFileTime(const FILETIME_* lpLocalFileTime, FILETIME_* lpFileTime)
0118 {
0119 return ::LocalFileTimeToFileTime(reinterpret_cast< const ::_FILETIME* >(lpLocalFileTime), reinterpret_cast< ::_FILETIME* >(lpFileTime));
0120 }
0121 #endif
0122
0123 #if defined( BOOST_HAS_GETSYSTEMTIMEASFILETIME )
0124 BOOST_FORCEINLINE VOID_ GetSystemTimeAsFileTime(LPFILETIME_ lpSystemTimeAsFileTime)
0125 {
0126 ::GetSystemTimeAsFileTime(reinterpret_cast< ::_FILETIME* >(lpSystemTimeAsFileTime));
0127 }
0128 #else
0129
0130 BOOST_FORCEINLINE VOID_ GetSystemTimeAsFileTime(FILETIME_* lpFileTime)
0131 {
0132 boost::winapi::SYSTEMTIME_ st;
0133 boost::winapi::GetSystemTime(&st);
0134 boost::winapi::SystemTimeToFileTime(&st, lpFileTime);
0135 }
0136 #endif
0137
0138 }
0139 }
0140
0141 #include <boost/winapi/detail/footer.hpp>
0142
0143 #endif