Back to home page

EIC code displayed by LXR

 
 

    


File indexing completed on 2025-01-18 09:30:35

0001 #ifndef LOCAL_TIME_DST_TRANSITION_DAY_RULES_HPP__
0002 #define LOCAL_TIME_DST_TRANSITION_DAY_RULES_HPP__
0003 
0004 /* Copyright (c) 2003-2004 CrystalClear Software, Inc.
0005  * Subject to the Boost Software License, Version 1.0. 
0006  * (See accompanying file LICENSE_1_0.txt or http://www.boost.org/LICENSE_1_0.txt)
0007  * Author: Jeff Garland, Bart Garst
0008  * $Date$
0009  */
0010 
0011 
0012 #include "boost/date_time/gregorian/gregorian_types.hpp"
0013 #include "boost/date_time/dst_transition_generators.hpp"
0014 
0015 namespace boost {
0016 namespace local_time {
0017    
0018     //! Provides rule of the form starting Apr 30 ending Oct 21
0019     typedef date_time::dst_day_calc_rule<gregorian::date> dst_calc_rule;
0020 
0021     struct partial_date_rule_spec 
0022     {
0023       typedef gregorian::date date_type;
0024       typedef gregorian::partial_date start_rule;
0025       typedef gregorian::partial_date end_rule;
0026     };
0027     
0028     //! Provides rule of the form first Sunday in April, last Saturday in Oct
0029     typedef date_time::day_calc_dst_rule<partial_date_rule_spec> partial_date_dst_rule;
0030 
0031     struct first_last_rule_spec 
0032     {
0033       typedef gregorian::date date_type;
0034       typedef gregorian::first_kday_of_month start_rule;
0035       typedef gregorian::last_kday_of_month end_rule;
0036     };
0037 
0038     //! Provides rule of the form first Sunday in April, last Saturday in Oct
0039     typedef date_time::day_calc_dst_rule<first_last_rule_spec> first_last_dst_rule;
0040 
0041     struct last_last_rule_spec 
0042     {
0043       typedef gregorian::date date_type;
0044       typedef gregorian::last_kday_of_month start_rule;
0045       typedef gregorian::last_kday_of_month end_rule;
0046     };
0047 
0048     //! Provides rule of the form last Sunday in April, last Saturday in Oct
0049     typedef date_time::day_calc_dst_rule<last_last_rule_spec> last_last_dst_rule;
0050 
0051     struct nth_last_rule_spec
0052     {
0053       typedef gregorian::date date_type;
0054       typedef gregorian::nth_kday_of_month start_rule;
0055       typedef gregorian::last_kday_of_month end_rule;
0056     };
0057 
0058     //! Provides rule in form of [1st|2nd|3rd|4th] Sunday in April, last Sunday in Oct
0059     typedef date_time::day_calc_dst_rule<nth_last_rule_spec> nth_last_dst_rule;
0060     
0061     struct nth_kday_rule_spec
0062     {
0063       typedef gregorian::date date_type;
0064       typedef gregorian::nth_kday_of_month start_rule;
0065       typedef gregorian::nth_kday_of_month end_rule;
0066     };
0067 
0068     //! Provides rule in form of [1st|2nd|3rd|4th] Sunday in April/October
0069     typedef date_time::day_calc_dst_rule<nth_kday_rule_spec> nth_kday_dst_rule;
0070     //! Provides rule in form of [1st|2nd|3rd|4th] Sunday in April/October
0071     typedef date_time::day_calc_dst_rule<nth_kday_rule_spec> nth_day_of_the_week_in_month_dst_rule;
0072 
0073 
0074 } }//namespace
0075 
0076 
0077 #endif