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_FORMATTING_LOCALES_HPP___ #define DATE_TIME_DATE_FORMATTING_LOCALES_HPP___ /* 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 "boost/date_time/locale_config.hpp" // set BOOST_DATE_TIME_NO_LOCALE #ifndef BOOST_DATE_TIME_NO_LOCALE #include "boost/date_time/iso_format.hpp" #include "boost/date_time/date_names_put.hpp" #include "boost/date_time/parse_format_base.hpp" //#include
#include
#include
namespace boost { namespace date_time { //! Formats a month as as string into an ostream template
class ostream_month_formatter { public: typedef typename facet_type::month_type month_type; typedef std::basic_ostream
ostream_type; //! Formats a month as as string into an output iterator static void format_month(const month_type& month, ostream_type& os, const facet_type& f) { switch (f.month_format()) { case month_as_short_string: { std::ostreambuf_iterator
oitr(os); f.put_month_short(oitr, month.as_enum()); break; } case month_as_long_string: { std::ostreambuf_iterator
oitr(os); f.put_month_long(oitr, month.as_enum()); break; } case month_as_integer: { charT fill_char = '0'; os << std::setw(2) << std::setfill(fill_char) << month.as_number(); break; } } } // format_month }; //! Formats a weekday template
class ostream_weekday_formatter { public: typedef typename facet_type::month_type month_type; typedef std::basic_ostream
ostream_type; //! Formats a month as as string into an output iterator static void format_weekday(const weekday_type& wd, ostream_type& os, const facet_type& f, bool as_long_string) { std::ostreambuf_iterator
oitr(os); if (as_long_string) { f.put_weekday_long(oitr, wd.as_enum()); } else { f.put_weekday_short(oitr, wd.as_enum()); } } // format_weekday }; //! Convert ymd to a standard string formatting policies template
class ostream_ymd_formatter { public: typedef typename ymd_type::month_type month_type; typedef ostream_month_formatter
month_formatter_type; typedef std::basic_ostream
ostream_type; typedef std::basic_string
foo_type; //! Convert ymd to a standard string formatting policies /*! This is standard code for handling date formatting with * year-month-day based date information. This function * uses the format_type to control whether the string will * contain separator characters, and if so what the character * will be. In addtion, it can format the month as either * an integer or a string as controled by the formatting * policy */ // static string_type ymd_to_string(ymd_type ymd) // { // std::ostringstream ss; // facet_type dnp; // ymd_put(ymd, ss, dnp); // return ss.str(); // } // Put ymd to ostream -- part of ostream refactor static void ymd_put(ymd_type ymd, ostream_type& os, const facet_type& f) { std::ostreambuf_iterator
oitr(os); charT fill_char = '0'; switch (f.date_order()) { case ymd_order_iso: { os << ymd.year; if (f.has_date_sep_chars()) { f.month_sep_char(oitr); } month_formatter_type::format_month(ymd.month, os, f); if (f.has_date_sep_chars()) { f.day_sep_char(oitr); } os << std::setw(2) << std::setfill(fill_char) << ymd.day; break; } case ymd_order_us: { month_formatter_type::format_month(ymd.month, os, f); if (f.has_date_sep_chars()) { f.day_sep_char(oitr); } os << std::setw(2) << std::setfill(fill_char) << ymd.day; if (f.has_date_sep_chars()) { f.month_sep_char(oitr); } os << ymd.year; break; } case ymd_order_dmy: { os << std::setw(2) << std::setfill(fill_char) << ymd.day; if (f.has_date_sep_chars()) { f.day_sep_char(oitr); } month_formatter_type::format_month(ymd.month, os, f); if (f.has_date_sep_chars()) { f.month_sep_char(oitr); } os << ymd.year; break; } } } }; //! Convert a date to string using format policies template
class ostream_date_formatter { public: typedef std::basic_ostream
ostream_type; typedef typename date_type::ymd_type ymd_type; //! Put date into an ostream static void date_put(const date_type& d, ostream_type& os, const facet_type& f) { special_values sv = d.as_special(); if (sv == not_special) { ymd_type ymd = d.year_month_day(); ostream_ymd_formatter
::ymd_put(ymd, os, f); } else { // output a special value std::ostreambuf_iterator
coi(os); f.put_special_value(coi, sv); } } //! Put date into an ostream static void date_put(const date_type& d, ostream_type& os) { //retrieve the local from the ostream std::locale locale = os.getloc(); if (std::has_facet
(locale)) { const facet_type& f = std::use_facet
(locale); date_put(d, os, f); } else { //default to something sensible if no facet installed facet_type default_facet; date_put(d, os, default_facet); } } // date_to_ostream }; //class date_formatter } } //namespace date_time #endif #endif
date_formatting_locales.hpp
Page URL
File URL
Prev
15/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.