1 | #ifndef LOCAL_TIME_DST_TRANSITION_DAY_RULES_HPP__ |
---|
2 | #define LOCAL_TIME_DST_TRANSITION_DAY_RULES_HPP__ |
---|
3 | |
---|
4 | /* Copyright (c) 2003-2004 CrystalClear Software, Inc. |
---|
5 | * Subject to the Boost Software License, Version 1.0. |
---|
6 | * (See accompanying file LICENSE_1_0.txt or http://www.boost.org/LICENSE_1_0.txt) |
---|
7 | * Author: Jeff Garland, Bart Garst |
---|
8 | * $Date: 2008-02-27 15:00:24 -0500 (Wed, 27 Feb 2008) $ |
---|
9 | */ |
---|
10 | |
---|
11 | |
---|
12 | #include "boost/date_time/gregorian/gregorian_types.hpp" |
---|
13 | #include "boost/date_time/dst_transition_generators.hpp" |
---|
14 | |
---|
15 | namespace boost { |
---|
16 | namespace local_time { |
---|
17 | |
---|
18 | //! Provides rule of the form starting Apr 30 ending Oct 21 |
---|
19 | typedef date_time::dst_day_calc_rule<gregorian::date> dst_calc_rule; |
---|
20 | |
---|
21 | struct partial_date_rule_spec |
---|
22 | { |
---|
23 | typedef gregorian::date date_type; |
---|
24 | typedef gregorian::partial_date start_rule; |
---|
25 | typedef gregorian::partial_date end_rule; |
---|
26 | }; |
---|
27 | |
---|
28 | //! Provides rule of the form first Sunday in April, last Saturday in Oct |
---|
29 | typedef date_time::day_calc_dst_rule<partial_date_rule_spec> partial_date_dst_rule; |
---|
30 | |
---|
31 | struct first_last_rule_spec |
---|
32 | { |
---|
33 | typedef gregorian::date date_type; |
---|
34 | typedef gregorian::first_kday_of_month start_rule; |
---|
35 | typedef gregorian::last_kday_of_month end_rule; |
---|
36 | }; |
---|
37 | |
---|
38 | //! Provides rule of the form first Sunday in April, last Saturday in Oct |
---|
39 | typedef date_time::day_calc_dst_rule<first_last_rule_spec> first_last_dst_rule; |
---|
40 | |
---|
41 | struct last_last_rule_spec |
---|
42 | { |
---|
43 | typedef gregorian::date date_type; |
---|
44 | typedef gregorian::last_kday_of_month start_rule; |
---|
45 | typedef gregorian::last_kday_of_month end_rule; |
---|
46 | }; |
---|
47 | |
---|
48 | //! Provides rule of the form last Sunday in April, last Saturday in Oct |
---|
49 | typedef date_time::day_calc_dst_rule<last_last_rule_spec> last_last_dst_rule; |
---|
50 | |
---|
51 | struct nth_last_rule_spec |
---|
52 | { |
---|
53 | typedef gregorian::date date_type; |
---|
54 | typedef gregorian::nth_kday_of_month start_rule; |
---|
55 | typedef gregorian::last_kday_of_month end_rule; |
---|
56 | }; |
---|
57 | |
---|
58 | //! Provides rule in form of [1st|2nd|3rd|4th] Sunday in April, last Sunday in Oct |
---|
59 | typedef date_time::day_calc_dst_rule<nth_last_rule_spec> nth_last_dst_rule; |
---|
60 | |
---|
61 | struct nth_kday_rule_spec |
---|
62 | { |
---|
63 | typedef gregorian::date date_type; |
---|
64 | typedef gregorian::nth_kday_of_month start_rule; |
---|
65 | typedef gregorian::nth_kday_of_month end_rule; |
---|
66 | }; |
---|
67 | |
---|
68 | //! Provides rule in form of [1st|2nd|3rd|4th] Sunday in April/October |
---|
69 | typedef date_time::day_calc_dst_rule<nth_kday_rule_spec> nth_kday_dst_rule; |
---|
70 | //! Provides rule in form of [1st|2nd|3rd|4th] Sunday in April/October |
---|
71 | typedef date_time::day_calc_dst_rule<nth_kday_rule_spec> nth_day_of_the_week_in_month_dst_rule; |
---|
72 | |
---|
73 | |
---|
74 | } }//namespace |
---|
75 | |
---|
76 | |
---|
77 | #endif |
---|