BVB Source Codes

mars Show date_format_simple.hpp Source code

Return Download mars: download date_format_simple.hpp Source code - Download mars Source code - Type:.hpp
  1. #ifndef DATE_TIME_SIMPLE_FORMAT_HPP___
  2. #define DATE_TIME_SIMPLE_FORMAT_HPP___
  3.  
  4. /* Copyright (c) 2002,2003 CrystalClear Software, Inc.
  5.  * Use, modification and distribution is subject to the
  6.  * Boost Software License, Version 1.0. (See accompanying
  7.  * file LICENSE_1_0.txt or http://www.boost.org/LICENSE_1_0.txt)
  8.  * Author: Jeff Garland, Bart Garst
  9.  * $Date$
  10.  */
  11.  
  12. #include "boost/date_time/parse_format_base.hpp"
  13.  
  14. namespace mars_boost {} namespace boost = mars_boost; namespace mars_boost {
  15. namespace date_time {
  16.  
  17. //! Class to provide simple basic formatting rules
  18. template<class charT>
  19. class simple_format {
  20. public:
  21.  
  22.   //! String used printed is date is invalid
  23.   static const charT* not_a_date()
  24.   {
  25.     return "not-a-date-time";
  26.   }
  27.   //! String used to for positive infinity value
  28.   static const charT* pos_infinity()
  29.   {  
  30.     return "+infinity";
  31.   }
  32.   //! String used to for positive infinity value
  33.   static const charT* neg_infinity()
  34.   {
  35.     return "-infinity";
  36.   }
  37.   //! Describe month format
  38.   static month_format_spec month_format()
  39.   {
  40.     return month_as_short_string;
  41.   }
  42.   static ymd_order_spec date_order()
  43.   {
  44.     return ymd_order_iso; //YYYY-MM-DD
  45.   }
  46.   //! This format uses '-' to separate date elements
  47.   static bool has_date_sep_chars()
  48.   {
  49.     return true;
  50.   }
  51.   //! Char to sep?
  52.   static charT year_sep_char()
  53.   {
  54.     return '-';
  55.   }
  56.   //! char between year-month
  57.   static charT month_sep_char()
  58.   {
  59.     return '-';
  60.   }
  61.   //! Char to separate month-day
  62.   static charT day_sep_char()
  63.   {
  64.     return '-';
  65.   }
  66.   //! char between date-hours
  67.   static charT hour_sep_char()
  68.   {
  69.     return ' ';
  70.   }
  71.   //! char between hour and minute
  72.   static charT minute_sep_char()
  73.   {
  74.     return ':';
  75.   }
  76.   //! char for second
  77.   static charT second_sep_char()
  78.   {
  79.     return ':';
  80.   }
  81.  
  82. };
  83.  
  84. #ifndef BOOST_NO_STD_WSTRING
  85.  
  86. //! Specialization of formmating rules for wchar_t
  87. template<>
  88. class simple_format<wchar_t> {
  89. public:
  90.  
  91.   //! String used printed is date is invalid
  92.   static const wchar_t* not_a_date()
  93.   {
  94.     return L"not-a-date-time";
  95.   }
  96.   //! String used to for positive infinity value
  97.   static const wchar_t* pos_infinity()
  98.   {  
  99.     return L"+infinity";
  100.   }
  101.   //! String used to for positive infinity value
  102.   static const wchar_t* neg_infinity()
  103.   {
  104.     return L"-infinity";
  105.   }
  106.   //! Describe month format
  107.   static month_format_spec month_format()
  108.   {
  109.     return month_as_short_string;
  110.   }
  111.   static ymd_order_spec date_order()
  112.   {
  113.     return ymd_order_iso; //YYYY-MM-DD
  114.   }
  115.   //! This format uses '-' to separate date elements
  116.   static bool has_date_sep_chars()
  117.   {
  118.     return true;
  119.   }
  120.   //! Char to sep?
  121.   static wchar_t year_sep_char()
  122.   {
  123.     return '-';
  124.   }
  125.   //! char between year-month
  126.   static wchar_t month_sep_char()
  127.   {
  128.     return '-';
  129.   }
  130.   //! Char to separate month-day
  131.   static wchar_t day_sep_char()
  132.   {
  133.     return '-';
  134.   }
  135.   //! char between date-hours
  136.   static wchar_t hour_sep_char()
  137.   {
  138.     return ' ';
  139.   }
  140.   //! char between hour and minute
  141.   static wchar_t minute_sep_char()
  142.   {
  143.     return ':';
  144.   }
  145.   //! char for second
  146.   static wchar_t second_sep_char()
  147.   {
  148.     return ':';
  149.   }
  150.  
  151. };
  152.  
  153. #endif // BOOST_NO_STD_WSTRING
  154. } } //namespace date_time
  155.  
  156.  
  157.  
  158.  
  159. #endif
  160.  
downloaddate_format_simple.hpp Source code - Download mars Source code
Related Source Codes/Software:
Hero - Elegant transition library for iOS & tvOS 2017-06-09
deep-photo-styletransfer - Code and data for paper "Deep Photo Style Transfer... 2017-06-09
mastodon - A GNU Social-compatible microblogging server ... 2017-06-09
plyr - A simple HTML5, YouTube and Vimeo player ... 2017-06-08
prepack - Prepack is a partial evaluator for JavaScript. Pre... 2017-06-08
Public-APIs - 2017-06-09
lottie-ios - An iOS library to natively render After Effects ve... 2017-06-09
Awesome-Hacking - A collection of various awesome lists for hackers,... 2017-06-09
algorithms - Minimal examples of data structures and algorithms... 2017-06-10
lectures - Oxford Deep NLP 2017 course 2017-06-10
CRYENGINE - CRYENGINE is a powerful real-time game development... 2017-06-11
postal - 2017-06-11
reactide - Reactide is the first dedicated IDE for React web ... 2017-06-11
rkt - rkt is a pod-native container engine for Linux. It... 2017-06-11
uWebSockets - Tiny WebSockets https://for... 2017-06-11
realworld - TodoMVC for the RealWorld - Exemplary fullstack Me... 2017-06-11
goreplay - GoReplay is an open-source tool for capturing and ... 2017-06-10
pyenv - Simple Python version management 2017-06-10
redux-saga - An alternative side effect model for Redux apps ... 2017-06-10
angular-starter - 2017-06-10

 Back to top