C++ Boost

gregorian::date iterators


Overall Index -- Gregorian Index -- Posix Time Index

Date Generators / Algorithms

Introduction -- Header -- Class Overview

Introduction

Date iterators provide a standard mechanism for iteration through dates. Date iterators are a model of Input Iterator and can be used to populate collections with dates and other date generation tasks. For example, the print month example iterates through all the days in a month and prints them.
日付イテレータは、日単位で反復するための標準的なメカニズムを提供する。 日付イテレータは(STLの)入力イテレータのモデルであり、日付と他の日付生成タスクで集合を代入するために使われる。 例えば、print month の例では、1ヶ月の全ての日々を反復し、それらをプリントする。

All of the iterators here derive from boost::gregorian::date_iterator.
ここにあるイテレータは全て boost::gregorian::date_iterator の派生である。

Header

#include "boost/date_time/gregorian/gregorian.hpp" //include all types plus i/o
or
#include "boost/date_time/gregorian/gregorian_types.hpp" //no i/o just types

Class Overview

Class Construction Parameters Description
date_iterator 全ての日付単位イテレータに共通な基底クラス
day_iterator date start_date, int day_count=1 day_count 日単位で反復する
week_iterator date start_date, int week_offset=1 week_offset 週単位で反復する
month_iterator date start_date, int month_offset=1 month_offset 月単位で反復する。
月末の取り扱いについては、特別な規則がある。 それは、最初の日が月の最終日であるときは、常にその月の最終日に合わせて調整されるというものである。 日付がその月末を越えている場合(例: 1月31日+1ヶ月)、月の最終日に合わせて調整される。
year_iterator date start_date, int year_offset=1 year_offset 年単位で反復する


Last modified: Thu Sep 5 06:06:41 MST 2002 by Jeff Garland © 2000-2002
Japanese Translation Copyright (C) 2003 Shoji Shinohara.