--EVF5PPMfhYS0aIcm Content-Type: text/plain; charset=us-ascii
The attached change set (in a ZIP archive) is an update to the TimeZone goodie which I posted about a week ago.
(Please discard previous message of the same subject - wrong ZIP file attached. Correct change set in ZIP is TimeZoneUpdates.28Dec1230am.cs, which is supplied as an update to the orginally posted change set for TimeZone, TimeZone.21Dec1124am.cs).
Change set preamble follows: --------------------------------------------------------------------- Change Set: TimeZoneUpdates Date: 27 December 1999 Author: David T. Lewis
Incremental changes to TimeZone, to be applied on top of the original posted change set (TimeZone.21Dec1124am.cs). Includes method name and comment fixes courtesy of Stan Heckman (stan@stanheckman.com).
Introduced new classes to clarify the distinction between time zone offsets and leap second offsets. TimeZones now collaborate with instances of LeapSecondRuleSet to obtain leap second offsets, and the system TimeZoneDatabase holds an instance of LeapSecondRuleSet which applies to all time zones. For TimeZones in a system TimeZoneDatabase, all TimeZones which use leap seconds collaborate with the single system-wide LeapSecondRuleSet. These changes also eliminate unnecessary dupication of leap second rule sets.
Moved the tzfile logic out of the TimeZone hierarchy, and put it in a new TzFileLoader class. TzFileLoader knows how to read tzfile data files and create instances of TimeZoneRuleSet and LeapSecondRuleSet.
Introduced optimizations in time zone file loading to eliminate duplication of offset rules. For example, the tzfile data for 'posix/America/Detroit' is the same as that for 'America/Detroit', so these two equivalent time zones now can now refer to a single set of time zone offset rules.
Added tree-structured indexing of time zones in the TimeZoneDatabase to reduce the size of time zone dictionaries, and to make it easier to browse the system database with an inspector. Time zones can be directly referenced by name strings such as 'posix/Europe/Paris', but are stored in the database in a hierarchical tree of Dictionaries (timeZones->posix->Europe->Paris). The path name separator default is '/' but can be overridden for purposes of loading data named, for example, 'posix-Europe-Paris', or for database queries using names like 'posix%Europe%Paris'. Internally, the time zones have names like 'posix/Europe/Paris' to encourage consistent time zone naming.
For a complete time zone database loaded from data files as distributed on a typical Linux system (for example), the database size is now reduced by a factor of 3.4 compared to the original posted version of TimeZone. A full time zone database now occupies 1.8Mb on disk when copied out on a ReferenceStream (this compresses to under 0.3Mb bytes with gzip). This compares favorably to the size of the compiled tzfile time zone files, which occupy 1.78Mb on disk.
Changed time zone abbreviations and time zone names to be Symbols rather than strings. Changed several method names to simplify expressions. Added more examples and utility methods.
--EVF5PPMfhYS0aIcm Content-Type: text/plain; name="TimeZoneUpdates.zip" ; x-mac-type="705A4950" ; x-mac-creator="705A4950" Content-Disposition: attachment; filename="TimeZoneUpdates.zip" Content-Transfer-Encoding: imap_stub
0,2672,2,18492,0,
--EVF5PPMfhYS0aIcm--
squeak-dev@lists.squeakfoundation.org