x
Yes
No
Do you want to visit DriveHQ English website?
首页
产品服务
价格
免费试用
下载客户端
关于我们
云文件服务
|
云备份服务
|
FTP服务
|
企业邮箱服务
|
网站托管
|
客户端软件
云文件服务
云备份服务
FTP服务
企业级邮箱服务
网站托管
客户端软件
filetime_functions.hpp - Hosted on DriveHQ Cloud IT Platform
返回上层目录
上传
下载
共享
发布
新建文件夹
新建文件
复制
剪切
删除
粘贴
评论
升级服务
路径: \\game3dprogramming\materials\GameFactory\GameFactoryDemo\references\boost_1_35_0\boost\date_time\filetime_functions.hpp
旋转
特效
属性
历史版本
#ifndef DATE_TIME_FILETIME_FUNCTIONS_HPP__ #define DATE_TIME_FILETIME_FUNCTIONS_HPP__ /* Copyright (c) 2004 CrystalClear Software, Inc. * Use, modification and distribution is subject to the * Boost Software License, Version 1.0. (See accompanying * file LICENSE_1_0.txt or http://www.boost.org/LICENSE_1_0.txt) * Author: Jeff Garland, Bart Garst * $Date: 2008-02-27 15:00:24 -0500 (Wed, 27 Feb 2008) $ */ /*! @file filetime_functions.hpp * Function(s) for converting between a FILETIME structure and a * time object. This file is only available on systems that have * BOOST_HAS_FTIME defined. */ #include
#if defined(BOOST_HAS_FTIME) // skip this file if no FILETIME #include
#include
#include
namespace boost { namespace date_time { //! Create a time object from an initialized FILETIME struct. /*! Create a time object from an initialized FILETIME struct. * A FILETIME struct holds 100-nanosecond units (0.0000001). When * built with microsecond resolution the FILETIME's sub second value * will be truncated. Nanosecond resolution has no truncation. */ template
inline time_type time_from_ftime(const FILETIME& ft){ typedef typename time_type::date_type date_type; typedef typename time_type::date_duration_type date_duration_type; typedef typename time_type::time_duration_type time_duration_type; /* OFFSET is difference between 1970-Jan-01 & 1601-Jan-01 * in 100-nanosecond intervals */ uint64_t c1 = 27111902UL; uint64_t c2 = 3577643008UL; // issues warning without 'UL' const uint64_t OFFSET = (c1 << 32) + c2; const long sec_pr_day = 86400; // seconds per day uint64_t filetime = ft.dwHighDateTime; filetime <<= 32; filetime += ft.dwLowDateTime; filetime -= OFFSET; // filetime is now 100-nanos since 1970-Jan-01 uint64_t sec = filetime / 10000000; #if defined(BOOST_DATE_TIME_POSIX_TIME_STD_CONFIG) uint64_t sub_sec = (filetime % 10000000) * 100; // nanoseconds #else uint64_t sub_sec = (filetime % 10000000) / 10; // truncate to microseconds #endif // split sec into usable chunks: days, hours, minutes, & seconds long _d = sec / sec_pr_day; long tmp = sec % sec_pr_day; long _h = tmp / 3600; // sec_pr_hour tmp %= 3600; long _m = tmp / 60; // sec_pr_min tmp %= 60; long _s = tmp; // seconds date_duration_type dd(_d); date_type d = date_type(1970, Jan, 01) + dd; return time_type(d, time_duration_type(_h, _m, _s, sub_sec)); } }} // boost::date_time #endif // BOOST_HAS_FTIME #endif // DATE_TIME_FILETIME_FUNCTIONS_HPP__
filetime_functions.hpp
网页地址
文件地址
上一页
24/60
下一页
下载
( 2 KB )
Comments
Total ratings:
0
Average rating:
无评论
of 10
Would you like to comment?
Join now
, or
Logon
if you are already a member.