DriveHQ Start Menu
Cloud Drive Mapping
Folder Sync
Cloud Backup
True Drop Box
FTP/SFTP Hosting
Group Account
DriveHQ Start Menu
Online File Server
My Storage
|
Manage Shares
|
Publishes
|
Drop Boxes
|
Group Account
WebDAV Drive Mapping
Cloud Drive Home
|
WebDAV Guide
|
Drive Mapping Tool
|
Drive Mapping URL
Complete Data Backup
Backup Guide
|
Online Backup Tool
|
Cloud-to-Cloud Backup
FTP, Email & Web Service
FTP Home
|
FTP Hosting FAQ
|
Email Hosting
|
EmailManager
|
Web Hosting
Help & Resources
About
|
Enterprise Service
|
Partnership
|
Comparisons
|
Support
Quick Links
Security and Privacy
Download Software
Service Manual
Use Cases
Group Account
Online Help
Blog
Contact
Cloud Surveillance
Sign Up
Login
Features
Business Features
Online File Server
FTP Hosting
Cloud Drive Mapping
Cloud File Backup
Email Backup & Hosting
Cloud File Sharing
Folder Synchronization
Group Management
True Drop Box
Full-text Search
AD Integration/SSO
Mobile Access
IP Camera & DVR Solution
More...
Personal Features
Personal Cloud Drive
Backup All Devices
Mobile APPs
Personal Web Hosting
Sub-Account (for Kids)
Home/PC/Kids Monitoring
More...
Software
DriveHQ Drive Mapping Tool
DriveHQ FileManager
DriveHQ Online Backup
DriveHQ Mobile Apps
Pricing
Business Plans & Pricing
Personal Plans & Pricing
Price Comparison with Others
Feature Comparison with Others
Install Mobile App
Sign up
Creating account...
Invalid character in username! Only 0-9, a-z, A-Z, _, -, . allowed.
Username is required!
Invalid email address!
E-mail is required!
Password is required!
Password is invalid!
Password and confirmation do not match.
Confirm password is required!
I accept
Membership Agreement
Please read the Membership Agreement and check "I accept"!
Free Quick Sign-up
Sign-up Page
Log in
Signing in...
Username or e-mail address is required!
Password is required!
Keep me logged in
Quick Login
Forgot Password
Up
Upload
Download
Share
Publish
New Folder
New File
Copy
Cut
Delete
Paste
Rate
Upgrade
Rotate
Effect
Edit
Slide
History
/*============================================================================= Boost.Wave: A Standard compliant C++ preprocessor library http://www.boost.org/ Copyright (c) 2001-2008 Hartmut Kaiser. Distributed under the Boost Software License, Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) =============================================================================*/ #if !defined(TIME_CONVERSION_HELPER_HPP_DA97E389_1797_43BA_82AE_B071064B3EF4_INCLUDED) #define TIME_CONVERSION_HELPER_HPP_DA97E389_1797_43BA_82AE_B071064B3EF4_INCLUDED #include
#include
#include
#include
#include
#if SPIRIT_VERSION >= 0x1700 #include
#include
#endif // SPIRIT_VERSION >= 0x1700 #if !defined(spirit_append_actor) #if SPIRIT_VERSION >= 0x1700 #define spirit_append_actor(actor) boost::spirit::push_back_a(actor) #define spirit_assign_actor(actor) boost::spirit::assign_a(actor) #else #define spirit_append_actor(actor) boost::spirit::append(actor) #define spirit_assign_actor(actor) boost::spirit::assign(actor) #endif // SPIRIT_VERSION >= 0x1700 #endif // !defined(spirit_append_actor) // this must occur after all of the includes and before any code appears #ifdef BOOST_HAS_ABI_HEADERS #include BOOST_ABI_PREFIX #endif /////////////////////////////////////////////////////////////////////////////// namespace boost { namespace wave { namespace util { namespace time_conversion { using namespace std; // some systems have std::tm etc. in namespace std /////////////////////////////////////////////////////////////////////////////// // define, whether the rule's should generate some debug output #define TRACE_CPP_TIME_CONVERSION \ (BOOST_SPIRIT_DEBUG_FLAGS_CPP & BOOST_SPIRIT_DEBUG_FLAGS_TIME_CONVERSION) \ /**/ /////////////////////////////////////////////////////////////////////////////// // Grammar for parsing a date/time string generated by the C++ compiler from // __DATE__ and __TIME__ class time_conversion_grammar : public boost::spirit::grammar
{ public: time_conversion_grammar() : fYearIsCorrected(false) { using namespace std; // some systems have memset in std memset (&time_stamp, 0, sizeof(tm)); BOOST_SPIRIT_DEBUG_TRACE_RULE_NAME(*this, "time_conversion_grammar", TRACE_CPP_TIME_CONVERSION); } template
struct definition { definition(time_conversion_grammar const &self) { using boost::spirit::int_p; using boost::spirit::add; char const *m[] = { "Jan", "Feb", "Mar", "Apr", "May", "Jun", "Jul", "Aug", "Sep", "Oct", "Nov", "Dec" }; for (int i = 0; i < 12; ++i) add (month, m[i], i); time_rule // expected format is 'Dec 29 2001 11:23:59' = month[spirit_assign_actor(self.time_stamp.tm_mon)] >> int_p[spirit_assign_actor(self.time_stamp.tm_mday)] >> int_p[spirit_assign_actor(self.time_stamp.tm_year)] >> int_p[spirit_assign_actor(self.time_stamp.tm_hour)] >> ':' >> int_p[spirit_assign_actor(self.time_stamp.tm_min)] >> ':' >> int_p[spirit_assign_actor(self.time_stamp.tm_sec)] ; BOOST_SPIRIT_DEBUG_TRACE_RULE(time_rule, TRACE_CPP_TIME_CONVERSION); } boost::spirit::rule
time_rule; boost::spirit::symbols<> month; boost::spirit::rule
const& start() const { return time_rule; } }; void correct_year() { if (!fYearIsCorrected) { time_stamp.tm_year -= 1900; fYearIsCorrected = true; } } mutable tm time_stamp; bool fYearIsCorrected; }; /////////////////////////////////////////////////////////////////////////////// // calculate the time of the compilation as a std::time_t to ensure correctness // of the saved dfa table class time_conversion_helper { public: time_conversion_helper(char const *act_time) : compile_time(0) { using namespace boost::spirit; time_conversion_grammar g; parse_info<> pi = parse (act_time, g, space_p); if (pi.hit) { g.correct_year(); compile_time = mktime(&g.time_stamp); } BOOST_ASSERT(0 != compile_time); } time_t get_time() const { return compile_time; } private: time_t compile_time; }; /////////////////////////////////////////////////////////////////////////////// #undef TRACE_CPP_TIME_CONVERSION } // namespace time_conversion // import time_conversion into the boost::wave::util namespace using namespace time_conversion; /////////////////////////////////////////////////////////////////////////////// } // namespace util } // namespace wave } // namespace boost // the suffix header occurs after all of the code #ifdef BOOST_HAS_ABI_HEADERS #include BOOST_ABI_SUFFIX #endif #endif // !defined(TIME_CONVERSION_HELPER_HPP_DA97E389_1797_43BA_82AE_B071064B3EF4_INCLUDED)
time_conversion_helper.hpp
Page URL
File URL
Prev
17/19
Next
Download
( 5 KB )
Note: The DriveHQ service banners will NOT be displayed if the file owner is a paid member.
Comments
Total ratings:
0
Average rating:
Not Rated
Would you like to comment?
Join DriveHQ
for a free account, or
Logon
if you are already a member.