From 49128cd8a7091312153e18acdf44d993b4f96336 Mon Sep 17 00:00:00 2001 From: Wolfgang Sourdeau Date: Wed, 12 Dec 2007 15:57:07 +0000 Subject: [PATCH] Monotone-Parent: 1f5d5360fc1b4cef37b7128d18ab019c6e3bae39 Monotone-Revision: 152425578a61ed0c1e8f2003e50224ca4097e4b4 Monotone-Author: wsourdeau@inverse.ca Monotone-Date: 2007-12-12T15:57:07 Monotone-Branch: ca.inverse.sogo --- SOPE/GDLContentStore/ChangeLog | 7 +++++++ SOPE/GDLContentStore/GCSFolder.h | 2 ++ SOPE/GDLContentStore/GCSFolder.m | 18 ++++++++++++++++++ 3 files changed, 27 insertions(+) diff --git a/SOPE/GDLContentStore/ChangeLog b/SOPE/GDLContentStore/ChangeLog index 058a7edb5..af7d8047c 100644 --- a/SOPE/GDLContentStore/ChangeLog +++ b/SOPE/GDLContentStore/ChangeLog @@ -1,3 +1,10 @@ +2007-12-12 Wolfgang Sourdeau + + * GCSFolder.m ([GCSFolder -creationDateOfEntryWithName:]): new + method that returns the creation date of the specified entry. + ([GCSFolder -lastModificationOfEntryWithName:]): same as above for + the last modification time. + 2007-11-27 Wolfgang Sourdeau * GCSFolder.m ([GCSFolder -versionOfContentWithName:], [GCSFolder diff --git a/SOPE/GDLContentStore/GCSFolder.h b/SOPE/GDLContentStore/GCSFolder.h index 7209517ed..73b608cc4 100644 --- a/SOPE/GDLContentStore/GCSFolder.h +++ b/SOPE/GDLContentStore/GCSFolder.h @@ -105,6 +105,8 @@ - (NSArray *)allSubFolderNames; - (NSNumber *)versionOfContentWithName:(NSString *)_name; +- (NSCalendarDate *)creationDateOfEntryWithName:(NSString *)_name; +- (NSCalendarDate *)lastModificationOfEntryWithName:(NSString *)_name; - (NSString *)fetchContentWithName:(NSString *)_name; - (NSException *)writeContent:(NSString *)_content toName:(NSString *)_name diff --git a/SOPE/GDLContentStore/GCSFolder.m b/SOPE/GDLContentStore/GCSFolder.m index e6ec63c7c..23cbbdec0 100644 --- a/SOPE/GDLContentStore/GCSFolder.m +++ b/SOPE/GDLContentStore/GCSFolder.m @@ -305,6 +305,24 @@ static GCSStringFormatter *stringFormatter = nil; ignoreDeleted: YES]; } +- (NSCalendarDate *)creationDateOfEntryWithName:(NSString *)_name { + int seconds; + + seconds = [[self _fetchValueOfColumn:@"c_creationdate" inContentWithName:_name + ignoreDeleted: YES] intValue]; + + return [NSCalendarDate dateWithTimeIntervalSince1970: seconds]; +} + +- (NSCalendarDate *)lastModificationOfEntryWithName:(NSString *)_name { + int seconds; + + seconds = [[self _fetchValueOfColumn:@"c_lastmodified" inContentWithName:_name + ignoreDeleted: YES] intValue]; + + return [NSCalendarDate dateWithTimeIntervalSince1970: seconds]; +} + - (NSNumber *)deletionOfContentWithName:(NSString *)_name { return [self _fetchValueOfColumn:@"c_deleted" inContentWithName:_name ignoreDeleted: NO];