Boost logo

Boost :

From: Jeff Garland (jeff_at_[hidden])
Date: 2002-02-15 12:21:32


All -

I have uploaded an initial submission from GDTL (Generic Date Time Library).
You can find the files here

http://groups.yahoo.com/group/boost/files/GDTL/

The package contains an initial implementation of the Gregorian calendar, date,
date_duration, and date_period classes. The fastest way to explain the utility
is to show some code.

#include "boost/gdtl/gregorian/gregorian.hpp"

using namespace gregorian;
date weekstart(2002,Feb,1);
date weekend (2002,Feb,7);
date_duration fiveDays(5);
date d3 = weekstart + fiveDays;
date today = day_clock::local_day();
if (d3 >= today) {} //date comparison operations

date_period aWeek(d1,d2);
if (aWeek.contains(today)) {}//do something

//iterate and print the week
day_iterator itr(weekstart);
for (; itr <= weekend; ++itr) {
   std::cout << to_iso_extended_string(*itr) << std::endl;
}

This only scratches the surface, but it gives the flavor. There are several
example programs in the package that illustrate other library features. You can
also look at the test directory for more comprehensive library usage.

The documentation is currently all online at this point. I suggest starting at
the link below.

http://www.crystalclearsoftware.com/gdtl/gdtl_ref_guide/index.html

In addition, several of us are having an active discussion on the Wiki
concerning various aspects of GDTL.

http://www.crystalclearsoftware.com/cgi-bin/boost_wiki/wiki.pl?GDTL

One particular topic of interest is the details of the 'time' components.
Although I have an implementation of time I am delaying the submission a bit
until we work out some of the tough interface issues involving time zones and
other aspects. However, I expect time classes to be available soon.

As for compilers, this code has compiled and tested against BCC5.1.1, gcc3.0.3,
gcc2.95-2 cygwin, MSVC7 RC1 and MSVC 6 SP5. The package includes jam files for
building the library although the majority of the library is inline.

Jeff


Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk