- Timestamp:
- 07/24/08 16:59:47 (2 months ago)
- Files:
-
- trunk/tango/io/compress/Zip.d (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
trunk/tango/io/compress/Zip.d
r3765 r3797 2252 2252 year=((dosdate & 0b1111111_0000_00000) >> 9) + 1980; 2253 2253 2254 // This code sucks. 2255 scope cal = new Gregorian; 2256 time = Time.epoch 2257 + TimeSpan.days(cal.getDaysInYear(year, 0)) 2258 + TimeSpan.days(cal.getDaysInMonth(year, mon, 0)) 2259 + TimeSpan.days(day) 2260 + TimeSpan.hours(hour) 2261 + TimeSpan.minutes(min) 2262 + TimeSpan.seconds(sec); 2254 // This code rules! 2255 time = Gregorian.generic.toTime(year, mon, day, hour, min, sec); 2263 2256 } 2264 2257 … … 2269 2262 time = WallClock.now; 2270 2263 2271 // *muttering angrily* 2272 scope cal = new Gregorian; 2273 2274 if( cal.getYear(time) < 1980 ) 2264 // *muttering happily* 2265 auto date = Gregorian.generic.toDate(time); 2266 if( date.year < 1980 ) 2275 2267 ZipException.tooold; 2276 2268 2277 auto span = time.span;2269 auto tod = time.time(); 2278 2270 dostime = cast(ushort) ( 2279 ( span.seconds / 2)2280 | ( span.minutes << 5)2281 | ( span.hours << 11));2271 (tod.seconds / 2) 2272 | (tod.minutes << 5) 2273 | (tod.hours << 11)); 2282 2274 2283 2275 dosdate = cast(ushort) ( 2284 ( cal.getDayOfMonth(time))2285 | ( cal.getMonth(time)<< 5)2286 | ((cal.getYear(time)- 1980) << 9));2276 (date.day) 2277 | (date.month << 5) 2278 | ((date.year - 1980) << 9)); 2287 2279 } 2288 2280












