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
#ifndef DATE_TIME_TIME_HPP___ #define DATE_TIME_TIME_HPP___ /* Copyright (c) 2002,2003,2005 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 time.hpp This file contains the interface for the time associated classes. */ #include "boost/date_time/time_defs.hpp" #include "boost/operators.hpp" #include
namespace boost { namespace date_time { //! Representation of a precise moment in time, including the date. /*! This class is a skeleton for the interface of a temporal type with a resolution that is higher than a day. It is intended that this class be the base class and that the actual time class be derived using the BN pattern. In this way, the derived class can make decisions such as 'should there be a default constructor' and what should it set its value to, should there be optional constructors say allowing only an time_durations that generate a time from a clock,etc. So, in fact multiple time types can be created for a time_system with different construction policies, and all of them can perform basic operations by only writing a copy constructor. Finally, compiler errors are also shorter. The real behavior of the time class is provided by the time_system template parameter. This class must provide all the logic for addition, subtraction, as well as define all the interface types. */ template
class base_time : private boost::less_than_comparable
> { public: typedef T time_type; typedef typename time_system::time_rep_type time_rep_type; typedef typename time_system::date_type date_type; typedef typename time_system::date_duration_type date_duration_type; typedef typename time_system::time_duration_type time_duration_type; //typedef typename time_system::hms_type hms_type; base_time(const date_type& day, const time_duration_type& td, dst_flags dst=not_dst) : time_(time_system::get_time_rep(day, td, dst)) {} base_time(special_values sv) : time_(time_system::get_time_rep(sv)) {} base_time(const time_rep_type& rhs) : time_(rhs) {} date_type date() const { return time_system::get_date(time_); } time_duration_type time_of_day() const { return time_system::get_time_of_day(time_); } /*! Optional bool parameter will return time zone as an offset * (ie "+07:00"). Empty string is returned for classes that do * not use a time_zone */ std::string zone_name(bool as_offset=false) const { return time_system::zone_name(time_); } /*! Optional bool parameter will return time zone as an offset * (ie "+07:00"). Empty string is returned for classes that do * not use a time_zone */ std::string zone_abbrev(bool as_offset=false) const { return time_system::zone_name(time_); } //! An empty string is returned for classes that do not use a time_zone std::string zone_as_posix_string() const { return std::string(""); } //! check to see if date is not a value bool is_not_a_date_time() const { return time_.is_not_a_date_time(); } //! check to see if date is one of the infinity values bool is_infinity() const { return (is_pos_infinity() || is_neg_infinity()); } //! check to see if date is greater than all possible dates bool is_pos_infinity() const { return time_.is_pos_infinity(); } //! check to see if date is greater than all possible dates bool is_neg_infinity() const { return time_.is_neg_infinity(); } //! check to see if time is a special value bool is_special() const { return(is_not_a_date_time() || is_infinity()); } //!Equality operator -- others generated by boost::equality_comparable bool operator==(const time_type& rhs) const { return time_system::is_equal(time_,rhs.time_); } //!Equality operator -- others generated by boost::less_than_comparable bool operator<(const time_type& rhs) const { return time_system::is_less(time_,rhs.time_); } //! difference between two times time_duration_type operator-(const time_type& rhs) const { return time_system::subtract_times(time_, rhs.time_); } //! add date durations time_type operator+(const date_duration_type& dd) const { return time_system::add_days(time_, dd); } time_type operator+=(const date_duration_type& dd) { time_ = (time_system::get_time_rep(date() + dd, time_of_day())); return time_type(time_); } //! subtract date durations time_type operator-(const date_duration_type& dd) const { return time_system::subtract_days(time_, dd); } time_type operator-=(const date_duration_type& dd) { time_ = (time_system::get_time_rep(date() - dd, time_of_day())); return time_type(time_); } //! add time durations time_type operator+(const time_duration_type& td) const { return time_type(time_system::add_time_duration(time_, td)); } time_type operator+=(const time_duration_type& td) { time_ = (time_system::get_time_rep(date(), time_of_day() + td)); return time_type(time_); } //! subtract time durations time_type operator-(const time_duration_type& rhs) const { return time_system::subtract_time_duration(time_, rhs); } time_type operator-=(const time_duration_type& td) { time_ = (time_system::get_time_rep(date(), time_of_day() - td)); return time_type(time_); } protected: time_rep_type time_; }; } } //namespace date_time::boost #endif
time.hpp
Page URL
File URL
Prev
45/60
Next
Download
( 6 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.