BVB Source Codes

mars Show time.hpp Source code

Return Download mars: download time.hpp Source code - Download mars Source code - Type:.hpp
  1. //  time.hpp  --------------------------------------------------------------//
  2.  
  3. //  Copyright 2010 Vicente J. Botet Escriba
  4. //  Copyright (c) Microsoft Corporation 2014
  5. //  Copyright 2015 Andrey Semashev
  6.  
  7. //  Distributed under the Boost Software License, Version 1.0.
  8. //  See http://www.boost.org/LICENSE_1_0.txt
  9.  
  10.  
  11. #ifndef BOOST_DETAIL_WINAPI_TIME_HPP
  12. #define BOOST_DETAIL_WINAPI_TIME_HPP
  13.  
  14. #include <boost/detail/winapi/basic_types.hpp>
  15. #include <boost/predef/platform.h>
  16.  
  17. #ifdef BOOST_HAS_PRAGMA_ONCE
  18. #pragma once
  19. #endif
  20.  
  21. #if !defined( BOOST_USE_WINDOWS_H )
  22. extern "C" {
  23. struct _FILETIME;
  24. struct _SYSTEMTIME;
  25.  
  26. BOOST_SYMBOL_IMPORT mars_boost::detail::winapi::VOID_ WINAPI
  27. GetSystemTime(::_SYSTEMTIME* lpSystemTime);
  28.  
  29. #ifdef BOOST_HAS_GETSYSTEMTIMEASFILETIME  // Windows CE does not define GetSystemTimeAsFileTime
  30. BOOST_SYMBOL_IMPORT mars_boost::detail::winapi::VOID_ WINAPI
  31. GetSystemTimeAsFileTime(::_FILETIME* lpSystemTimeAsFileTime);
  32. #endif
  33.  
  34. BOOST_SYMBOL_IMPORT mars_boost::detail::winapi::BOOL_ WINAPI
  35. SystemTimeToFileTime(
  36.     const ::_SYSTEMTIME* lpSystemTime,
  37.     ::_FILETIME* lpFileTime);
  38.  
  39. BOOST_SYMBOL_IMPORT mars_boost::detail::winapi::BOOL_ WINAPI
  40. FileTimeToSystemTime(
  41.     const ::_FILETIME* lpFileTime,
  42.     ::_SYSTEMTIME* lpSystemTime);
  43.  
  44. #if BOOST_PLAT_WINDOWS_DESKTOP
  45. BOOST_SYMBOL_IMPORT mars_boost::detail::winapi::BOOL_ WINAPI
  46. FileTimeToLocalFileTime(
  47.     const ::_FILETIME* lpFileTime,
  48.     ::_FILETIME* lpLocalFileTime);
  49.  
  50. BOOST_SYMBOL_IMPORT mars_boost::detail::winapi::BOOL_ WINAPI
  51. LocalFileTimeToFileTime(
  52.     const ::_FILETIME* lpLocalFileTime,
  53.     ::_FILETIME* lpFileTime);
  54.  
  55. BOOST_SYMBOL_IMPORT mars_boost::detail::winapi::DWORD_ WINAPI
  56. GetTickCount(BOOST_DETAIL_WINAPI_VOID);
  57. #endif
  58.  
  59. #if BOOST_USE_WINAPI_VERSION >= BOOST_WINAPI_VERSION_WIN6
  60. BOOST_SYMBOL_IMPORT mars_boost::detail::winapi::ULONGLONG_ WINAPI
  61. GetTickCount64(BOOST_DETAIL_WINAPI_VOID);
  62. #endif
  63. }
  64. #endif
  65.  
  66. namespace mars_boost {} namespace boost = mars_boost; namespace mars_boost {
  67. namespace detail {
  68. namespace winapi {
  69.  
  70. typedef struct BOOST_DETAIL_WINAPI_MAY_ALIAS _FILETIME {
  71.     DWORD_ dwLowDateTime;
  72.     DWORD_ dwHighDateTime;
  73. } FILETIME_, *PFILETIME_, *LPFILETIME_;
  74.  
  75. typedef struct BOOST_DETAIL_WINAPI_MAY_ALIAS _SYSTEMTIME {
  76.     WORD_ wYear;
  77.     WORD_ wMonth;
  78.     WORD_ wDayOfWeek;
  79.     WORD_ wDay;
  80.     WORD_ wHour;
  81.     WORD_ wMinute;
  82.     WORD_ wSecond;
  83.     WORD_ wMilliseconds;
  84. } SYSTEMTIME_, *PSYSTEMTIME_, *LPSYSTEMTIME_;
  85.  
  86. #if BOOST_PLAT_WINDOWS_DESKTOP
  87. using ::GetTickCount;
  88. #endif
  89. #if BOOST_USE_WINAPI_VERSION >= BOOST_WINAPI_VERSION_WIN6
  90. using ::GetTickCount64;
  91. #endif
  92.  
  93. BOOST_FORCEINLINE VOID_ GetSystemTime(LPSYSTEMTIME_ lpSystemTime)
  94. {
  95.     ::GetSystemTime(reinterpret_cast< ::_SYSTEMTIME* >(lpSystemTime));
  96. }
  97.  
  98. #if defined( BOOST_HAS_GETSYSTEMTIMEASFILETIME )
  99. BOOST_FORCEINLINE VOID_ GetSystemTimeAsFileTime(LPFILETIME_ lpSystemTimeAsFileTime)
  100. {
  101.     ::GetSystemTimeAsFileTime(reinterpret_cast< ::_FILETIME* >(lpSystemTimeAsFileTime));
  102. }
  103. #else
  104. // Windows CE does not define GetSystemTimeAsFileTime
  105. BOOST_FORCEINLINE VOID_ GetSystemTimeAsFileTime(FILETIME_* lpFileTime)
  106. {
  107.     mars_boost::detail::winapi::SYSTEMTIME_ st;
  108.     mars_boost::detail::winapi::GetSystemTime(&st);
  109.     mars_boost::detail::winapi::SystemTimeToFileTime(&st, lpFileTime);
  110. }
  111. #endif
  112.  
  113. BOOST_FORCEINLINE BOOL_ SystemTimeToFileTime(const SYSTEMTIME_* lpSystemTime, FILETIME_* lpFileTime)
  114. {
  115.     return ::SystemTimeToFileTime(reinterpret_cast< const ::_SYSTEMTIME* >(lpSystemTime), reinterpret_cast< ::_FILETIME* >(lpFileTime));
  116. }
  117.  
  118. BOOST_FORCEINLINE BOOL_ FileTimeToSystemTime(const FILETIME_* lpFileTime, SYSTEMTIME_* lpSystemTime)
  119. {
  120.     return ::FileTimeToSystemTime(reinterpret_cast< const ::_FILETIME* >(lpFileTime), reinterpret_cast< ::_SYSTEMTIME* >(lpSystemTime));
  121. }
  122.  
  123. #if BOOST_PLAT_WINDOWS_DESKTOP
  124. BOOST_FORCEINLINE BOOL_ FileTimeToLocalFileTime(const FILETIME_* lpFileTime, FILETIME_* lpLocalFileTime)
  125. {
  126.     return ::FileTimeToLocalFileTime(reinterpret_cast< const ::_FILETIME* >(lpFileTime), reinterpret_cast< ::_FILETIME* >(lpLocalFileTime));
  127. }
  128.  
  129. BOOST_FORCEINLINE BOOL_ LocalFileTimeToFileTime(const FILETIME_* lpLocalFileTime, FILETIME_* lpFileTime)
  130. {
  131.     return ::LocalFileTimeToFileTime(reinterpret_cast< const ::_FILETIME* >(lpLocalFileTime), reinterpret_cast< ::_FILETIME* >(lpFileTime));
  132. }
  133. #endif
  134.  
  135. }
  136. }
  137. }
  138.  
  139. #endif // BOOST_DETAIL_WINAPI_TIME_HPP
  140.  
downloadtime.hpp Source code - Download mars Source code
Related Source Codes/Software:
Hero - Elegant transition library for iOS & tvOS 2017-06-09
deep-photo-styletransfer - Code and data for paper "Deep Photo Style Transfer... 2017-06-09
mastodon - A GNU Social-compatible microblogging server ... 2017-06-09
plyr - A simple HTML5, YouTube and Vimeo player ... 2017-06-08
prepack - Prepack is a partial evaluator for JavaScript. Pre... 2017-06-08
Public-APIs - 2017-06-09
lottie-ios - An iOS library to natively render After Effects ve... 2017-06-09
Awesome-Hacking - A collection of various awesome lists for hackers,... 2017-06-09
algorithms - Minimal examples of data structures and algorithms... 2017-06-10
lectures - Oxford Deep NLP 2017 course 2017-06-10
CRYENGINE - CRYENGINE is a powerful real-time game development... 2017-06-11
postal - 2017-06-11
reactide - Reactide is the first dedicated IDE for React web ... 2017-06-11
rkt - rkt is a pod-native container engine for Linux. It... 2017-06-11
uWebSockets - Tiny WebSockets https://for... 2017-06-11
realworld - TodoMVC for the RealWorld - Exemplary fullstack Me... 2017-06-11
goreplay - GoReplay is an open-source tool for capturing and ... 2017-06-10
pyenv - Simple Python version management 2017-06-10
redux-saga - An alternative side effect model for Redux apps ... 2017-06-10
angular-starter - 2017-06-10

 Back to top