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 BOOST_DATE_TIME_LOCAL_TIME_IO_HPP__ #define BOOST_DATE_TIME_LOCAL_TIME_IO_HPP__ /* Copyright (c) 2003-2004 CrystalClear Software, Inc. * 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
#include "boost/date_time/local_time/local_date_time.hpp" #include "boost/date_time/local_time/posix_time_zone.hpp" #include "boost/date_time/time_facet.hpp" #include "boost/date_time/string_convert.hpp" #include "boost/io/ios_state.hpp" namespace boost { namespace local_time { typedef boost::date_time::time_facet
wlocal_time_facet; typedef boost::date_time::time_facet
local_time_facet; typedef boost::date_time::time_input_facet
wlocal_time_input_facet; typedef boost::date_time::time_input_facet
local_time_input_facet; //! operator<< for local_date_time - see local_time docs for formatting details template
inline std::basic_ostream
& operator<<(std::basic_ostream
& os, const local_date_time& ldt) { boost::io::ios_flags_saver iflags(os); typedef local_date_time time_type;//::utc_time_type typename typedef date_time::time_facet
custom_time_facet; typedef std::time_put
std_time_facet; std::ostreambuf_iterator
oitr(os); if(std::has_facet
(os.getloc())) { std::use_facet
(os.getloc()).put(oitr, os, os.fill(), ldt); } else { custom_time_facet* f = new custom_time_facet(); std::locale l = std::locale(os.getloc(), f); os.imbue(l); f->put(oitr, os, os.fill(), ldt); } return os; } //! input operator for local_date_time template
inline std::basic_istream
& operator>>(std::basic_istream
& is, local_date_time& ldt) { boost::io::ios_flags_saver iflags(is); typename std::basic_istream
::sentry strm_sentry(is, false); if (strm_sentry) { try { typedef typename local_date_time::utc_time_type utc_time_type; typedef typename date_time::time_input_facet
time_input_facet; // intermediate objects std::basic_string
tz_str; utc_time_type pt(not_a_date_time); std::istreambuf_iterator
sit(is), str_end; if(std::has_facet
(is.getloc())) { std::use_facet
(is.getloc()).get_local_time(sit, str_end, is, pt, tz_str); } else { time_input_facet* f = new time_input_facet(); std::locale l = std::locale(is.getloc(), f); is.imbue(l); f->get_local_time(sit, str_end, is, pt, tz_str); } if(tz_str.empty()) { time_zone_ptr null_ptr; // a null time_zone_ptr creates a local_date_time that is UTC ldt = local_date_time(pt, null_ptr); } else { time_zone_ptr tz_ptr(new posix_time_zone(date_time::convert_string_type
(tz_str))); // the "date & time" constructor expects the time label to *not* be utc. // a posix_tz_string also expects the time label to *not* be utc. ldt = local_date_time(pt.date(), pt.time_of_day(), tz_ptr, local_date_time::EXCEPTION_ON_ERROR); } } catch(...) { // mask tells us what exceptions are turned on std::ios_base::iostate exception_mask = is.exceptions(); // if the user wants exceptions on failbit, we'll rethrow our // date_time exception & set the failbit if(std::ios_base::failbit & exception_mask) { try { is.setstate(std::ios_base::failbit); } catch(std::ios_base::failure&) {} // ignore this one throw; // rethrow original exception } else { // if the user want's to fail quietly, we simply set the failbit is.setstate(std::ios_base::failbit); } } } return is; } } } // namespaces #endif // BOOST_DATE_TIME_LOCAL_TIME_IO_HPP__
local_time_io.hpp
Page URL
File URL
Prev
7/10
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.