BVB Source Codes

mars Show gregorian_calendar.hpp Source code

Return Download mars: download gregorian_calendar.hpp Source code - Download mars Source code - Type:.hpp
  1. #ifndef DATE_TIME_GREGORIAN_CALENDAR_HPP__
  2. #define DATE_TIME_GREGORIAN_CALENDAR_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
  9.  * $Date$
  10.  */
  11.  
  12.  
  13. namespace mars_boost {} namespace boost = mars_boost; namespace mars_boost {
  14. namespace date_time {
  15.  
  16.  
  17.   //! An implementation of the Gregorian calendar
  18.   /*! This is a parameterized implementation of a proleptic Gregorian Calendar that
  19.       can be used in the creation of date systems or just to perform calculations.
  20.       All the methods of this class are static functions, so the intent is to
  21.       never create instances of this class.
  22.     @param ymd_type_ Struct type representing the year, month, day.  The ymd_type must
  23.            define a of types for the year, month, and day.  These types need to be
  24.            arithmetic types.
  25.     @param date_int_type_ Underlying type for the date count.  Must be an arithmetic type.
  26.   */
  27.   template<typename ymd_type_, typename date_int_type_>
  28.   class gregorian_calendar_base {
  29.   public:
  30.     //! define a type a date split into components
  31.     typedef ymd_type_  ymd_type;
  32.     //! define a type for representing months
  33.     typedef typename ymd_type::month_type  month_type;
  34.     //! define a type for representing days
  35.     typedef typename ymd_type::day_type  day_type;
  36.     //! Type to hold a stand alone year value (eg: 2002)
  37.     typedef typename ymd_type::year_type  year_type;
  38.     //! Define the integer type to use for internal calculations
  39.     typedef date_int_type_ date_int_type;
  40.  
  41.  
  42.     static unsigned short day_of_week(const ymd_type& ymd);
  43.     static int week_number(const ymd_type&ymd);
  44.     //static unsigned short day_of_year(date_int_type);
  45.     static date_int_type day_number(const ymd_type& ymd);
  46.     static date_int_type julian_day_number(const ymd_type& ymd);
  47.     static date_int_type modjulian_day_number(const ymd_type& ymd);
  48.     static ymd_type from_day_number(date_int_type);
  49.     static ymd_type from_julian_day_number(date_int_type);
  50.     static ymd_type from_modjulian_day_number(date_int_type);
  51.     static bool is_leap_year(year_type);
  52.     static unsigned short end_of_month_day(year_type y, month_type m);
  53.     static ymd_type epoch();
  54.     static unsigned short days_in_week();
  55.  
  56.   };
  57.  
  58.  
  59.  
  60. } } //namespace
  61.  
  62. #ifndef NO_BOOST_DATE_TIME_INLINE
  63. #include "boost/date_time/gregorian_calendar.ipp"
  64. #endif
  65.  
  66.  
  67.  
  68. #endif
  69.  
  70.  
  71.  
downloadgregorian_calendar.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