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_DATE_DURATION__ #define DATE_TIME_DATE_DURATION__ /* Copyright (c) 2002,2003 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) $ */ #include
namespace boost { namespace date_time { //! Duration type with date level resolution template
class date_duration : private boost::less_than_comparable
, boost::equality_comparable< date_duration< duration_rep_traits> , boost::addable< date_duration< duration_rep_traits> , boost::subtractable< date_duration< duration_rep_traits> > > > > { public: typedef typename duration_rep_traits::int_type duration_rep_type; typedef typename duration_rep_traits::impl_type duration_rep; //! Construct from a day count explicit date_duration(duration_rep day_count) : days_(day_count) {}; /*! construct from special_values - only works when * instantiated with duration_traits_adapted */ date_duration(special_values sv) : days_(duration_rep::from_special(sv)) {} // copy constructor required for addable<> & subtractable<> //! Construct from another date_duration (Copy Constructor) date_duration(const date_duration
& other) : days_(other.days_) {} //! returns days_ as it's instantiated type - used for streaming duration_rep get_rep()const { return days_; } bool is_special()const { return days_.is_special(); } //! returns days as value, not object. duration_rep_type days() const { return duration_rep_traits::as_number(days_); } //! Returns the smallest duration -- used by to calculate 'end' static date_duration unit() { return date_duration
(1); } //! Equality bool operator==(const date_duration& rhs) const { return days_ == rhs.days_; } //! Less bool operator<(const date_duration& rhs) const { return days_ < rhs.days_; } /* For shortcut operators (+=, -=, etc) simply using * "days_ += days_" may not work. If instantiated with * an int_adapter, shortcut operators are not present, * so this will not compile */ //! Subtract another duration -- result is signed date_duration operator-=(const date_duration& rhs) { //days_ -= rhs.days_; days_ = days_ - rhs.days_; return *this; } //! Add a duration -- result is signed date_duration operator+=(const date_duration& rhs) { days_ = days_ + rhs.days_; return *this; } //! unary- Allows for dd = -date_duration(2); -> dd == -2 date_duration operator-()const { return date_duration
(get_rep() * (-1)); } //! Division operations on a duration with an integer. date_duration
operator/=(int divisor) { days_ = days_ / divisor; return *this; } date_duration
operator/(int divisor) { return date_duration
(days_ / divisor); } //! return sign information bool is_negative() const { return days_ < 0; } private: duration_rep days_; }; /*! Struct for instantiating date_duration with
NO
special values * functionality. Allows for transparent implementation of either * date_duration
or date_duration
> */ struct duration_traits_long { typedef long int_type; typedef long impl_type; static int_type as_number(impl_type i) { return i; }; }; /*! Struct for instantiating date_duration
WITH
special values * functionality. Allows for transparent implementation of either * date_duration
or date_duration
> */ struct duration_traits_adapted { typedef long int_type; typedef boost::date_time::int_adapter
impl_type; static int_type as_number(impl_type i) { return i.as_number(); }; }; } } //namspace date_time #endif
date_duration.hpp
Page URL
File URL
Prev
9/60
Next
Download
( 4 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.