gregorian_types.hpp 3.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109
  1. #ifndef _GREGORIAN_TYPES_HPP__
  2. #define _GREGORIAN_TYPES_HPP__
  3. /* Copyright (c) 2002,2003 CrystalClear Software, Inc.
  4. * Use, modification and distribution is subject to the
  5. * Boost Software License, Version 1.0. (See accompanying
  6. * file LICENSE_1_0.txt or http://www.boost.org/LICENSE_1_0.txt)
  7. * Author: Jeff Garland, Bart Garst
  8. * $Date$
  9. */
  10. /*! @file gregorian_types.hpp
  11. Single file header that defines most of the types for the gregorian
  12. date-time system.
  13. */
  14. #include "boost/date_time/date.hpp"
  15. #include "boost/date_time/period.hpp"
  16. #include "boost/date_time/gregorian/greg_calendar.hpp"
  17. #include "boost/date_time/gregorian/greg_duration.hpp"
  18. #if defined(BOOST_DATE_TIME_OPTIONAL_GREGORIAN_TYPES)
  19. #include "boost/date_time/gregorian/greg_duration_types.hpp"
  20. #endif
  21. #include "boost/date_time/gregorian/greg_date.hpp"
  22. #include "boost/date_time/date_generators.hpp"
  23. #include "boost/date_time/date_clock_device.hpp"
  24. #include "boost/date_time/date_iterator.hpp"
  25. #include "boost/date_time/adjust_functors.hpp"
  26. namespace boost {
  27. //! Gregorian date system based on date_time components
  28. /*! This date system defines a full complement of types including
  29. * a date, date_duration, date_period, day_clock, and a
  30. * day_iterator.
  31. */
  32. namespace gregorian {
  33. //! Date periods for the gregorian system
  34. /*!\ingroup date_basics
  35. */
  36. typedef date_time::period<date, date_duration> date_period;
  37. //! A unifying date_generator base type
  38. /*! A unifying date_generator base type for:
  39. * partial_date, nth_day_of_the_week_in_month,
  40. * first_day_of_the_week_in_month, and last_day_of_the_week_in_month
  41. */
  42. typedef date_time::year_based_generator<date> year_based_generator;
  43. //! A date generation object type
  44. typedef date_time::partial_date<date> partial_date;
  45. typedef date_time::nth_kday_of_month<date> nth_kday_of_month;
  46. typedef nth_kday_of_month nth_day_of_the_week_in_month;
  47. typedef date_time::first_kday_of_month<date> first_kday_of_month;
  48. typedef first_kday_of_month first_day_of_the_week_in_month;
  49. typedef date_time::last_kday_of_month<date> last_kday_of_month;
  50. typedef last_kday_of_month last_day_of_the_week_in_month;
  51. typedef date_time::first_kday_after<date> first_kday_after;
  52. typedef first_kday_after first_day_of_the_week_after;
  53. typedef date_time::first_kday_before<date> first_kday_before;
  54. typedef first_kday_before first_day_of_the_week_before;
  55. //! A clock to get the current day from the local computer
  56. /*!\ingroup date_basics
  57. */
  58. typedef date_time::day_clock<date> day_clock;
  59. //! Base date_iterator type for gregorian types.
  60. /*!\ingroup date_basics
  61. */
  62. typedef date_time::date_itr_base<date> date_iterator;
  63. //! A day level iterator
  64. /*!\ingroup date_basics
  65. */
  66. typedef date_time::date_itr<date_time::day_functor<date>,
  67. date> day_iterator;
  68. //! A week level iterator
  69. /*!\ingroup date_basics
  70. */
  71. typedef date_time::date_itr<date_time::week_functor<date>,
  72. date> week_iterator;
  73. //! A month level iterator
  74. /*!\ingroup date_basics
  75. */
  76. typedef date_time::date_itr<date_time::month_functor<date>,
  77. date> month_iterator;
  78. //! A year level iterator
  79. /*!\ingroup date_basics
  80. */
  81. typedef date_time::date_itr<date_time::year_functor<date>,
  82. date> year_iterator;
  83. // bring in these date_generator functions from date_time namespace
  84. using date_time::days_until_weekday;
  85. using date_time::days_before_weekday;
  86. using date_time::next_weekday;
  87. using date_time::previous_weekday;
  88. } } //namespace gregorian
  89. #endif