/Src/Dependencies/Boost/boost/date_time/gregorian/greg_duration_types.hpp

http://hadesmem.googlecode.com/ · C++ Header · 43 lines · 26 code · 10 blank · 7 comment · 0 complexity · 66c0ab6b5eca915f467965214e09dbc9 MD5 · raw file

  1. #ifndef GREG_DURATION_TYPES_HPP___
  2. #define GREG_DURATION_TYPES_HPP___
  3. /* Copyright (c) 2004 CrystalClear Software, Inc.
  4. * Subject to Boost Software License, Version 1.0. (See accompanying
  5. * file LICENSE_1_0.txt or http://www.boost.org/LICENSE_1_0.txt)
  6. * Author: Jeff Garland, Bart Garst
  7. * $Date: 2008-11-13 06:37:53 +1100 (Thu, 13 Nov 2008) $
  8. */
  9. #include <boost/date_time/gregorian/greg_date.hpp>
  10. #include <boost/date_time/int_adapter.hpp>
  11. #include <boost/date_time/adjust_functors.hpp>
  12. #include <boost/date_time/date_duration_types.hpp>
  13. #include <boost/date_time/gregorian/greg_duration.hpp>
  14. namespace boost {
  15. namespace gregorian {
  16. //! config struct for additional duration types (ie months_duration<> & years_duration<>)
  17. struct greg_durations_config {
  18. typedef date date_type;
  19. typedef date_time::int_adapter<int> int_rep;
  20. typedef date_time::month_functor<date_type> month_adjustor_type;
  21. };
  22. typedef date_time::months_duration<greg_durations_config> months;
  23. typedef date_time::years_duration<greg_durations_config> years;
  24. class weeks_duration : public date_duration {
  25. public:
  26. weeks_duration(duration_rep w)
  27. : date_duration(w * 7) {}
  28. weeks_duration(date_time::special_values sv)
  29. : date_duration(sv) {}
  30. };
  31. typedef weeks_duration weeks;
  32. }} // namespace boost::gregorian
  33. #endif // GREG_DURATION_TYPES_HPP___