Show
Ignore:
Timestamp:
06/13/08 15:57:37 (4 years ago)
Author:
gbooker
Message:

Changed the filtering method and the check for unwatched/favorite. This new system is far more powerful, and should actually be faster too. Implemented a bit more caching to help speed as well.

Files:
1 modified

Legend:

Unmodified
Added
Removed
  • branches/CoreData/SapphireFrappliance/MetaData/Support/SapphireDirectory.h

    r585 r588  
    175175 
    176176/*! 
    177  * @brief Returns if directory contains any unwatched files 
    178  * 
    179  * @return YES if all files are watched, NO otherwise 
    180  */ 
    181 - (BOOL)watchedValue; 
    182  
    183 /*! 
    184  * @brief Returns if directory contains any unwatched files 
    185  * 
    186  * @return an NSNumber with a YES if all files are watched, NO otherwise 
    187  */ 
    188 - (NSNumber *)watched; 
    189  
    190 /*! 
    191  * @brief Set subtree as watched with restriction as to predicate.  Does not follow symlinks 
    192  * 
    193  * @param watched YES if set to watched, NO if set to unwatched 
    194  */ 
    195 - (void)setWatchedValue:(BOOL)watched; 
    196  
    197 /*! 
    198  * @brief Set subtree as watched with restriction as to predicate.  Does not follow symlinks 
    199  * 
    200  * @param watched An NSNumber that is YES if set to watched, NO if set to unwatched 
    201  */ 
    202 - (void)setWatched:(NSNumber *)watched; 
    203  
    204 /*! 
    205  * @brief Returns if directory contains any favorite files 
    206  * 
    207  * @return YES if any files are favorite, NO otherwise 
    208  */ 
    209 - (BOOL)favoriteValue; 
    210  
    211 /*! 
    212  * @brief Returns if directory contains any favorite files 
    213  * 
    214  * @return an NSNumber with a YES if any files are favorite, NO otherwise 
    215  */ 
    216 - (NSNumber *)favorite; 
    217  
    218 /*! 
    219  * @brief Set subtree as favorite with restriction as to predicate.  Does not follow symlinks 
    220  * 
    221  * @param favorite YES if set to favorite, NO if set to not-favorite 
    222  */ 
    223 - (void)setFavoriteValue:(BOOL)favorite; 
    224  
    225 /*! 
    226  * @brief Set subtree as favorite with restriction as to predicate.  Does not follow symlinks 
    227  * 
    228  * @param favorite An NSNumber that is YES if set to favorite, NO if set to not-favorite 
    229  */ 
    230 - (void)setFavorite:(NSNumber *)favorite; 
    231  
    232 /*! 
    233177 * @brief Check to see if any filtered files match the predicate 
    234178 * 
    235179 * @param pred The predicate to check 
    236180 */ 
    237 - (BOOL)checkPredicate:(NSPredicate *)pred; 
    238  
    239 /*! 
    240  * @brief Set subtree to re-import from the specified source with restriction as to predicate.  Does not follow symlinks 
    241  * 
    242  * @param source The source on which to re-import 
    243  */ 
    244 - (void)setToReimportFromMask:(int)mask; 
    245  
    246 /*! 
    247  * @brief Clear metadata for an entire subtree with restriction as to predicate.  Does not follow symlinks 
    248  */ 
    249 - (void)clearMetaData; 
     181- (BOOL)containsFileMatchingPredicate:(NSPredicate *)pred; 
     182 
     183/*! 
     184 * @brief Checks to see if directory contains any files with filter 
     185 * 
     186 * @param filter The filter predicate to test 
     187 */ 
     188- (BOOL)containsFileMatchingFilterPredicate:(NSPredicate *)pred; 
     189 
     190/*! 
     191 * @brief Invoke a command on all files contained within this directory within filter 
     192 * 
     193 * @param fileInv The invokation to invoke 
     194 */ 
     195- (void)invokeOnAllFiles:(NSInvocation *)fileInv; 
    250196 
    251197/*! 
     
    305251- (void)clearPredicateCache; 
    306252 
    307 @end 
     253/*! 
     254 * @brief The managed object context 
     255 * 
     256 * @return The managed object context for the metadata 
     257 */ 
     258- (NSManagedObjectContext *)managedObjectContext; 
     259 
     260@end 
     261 
     262/*! 
     263 * @brief Set subtree to watched or unwatched with restriction as to predicate.  Does not follow symlinks 
     264 * 
     265 * @param dir The subtree 
     266 * @param watched YES if watched, NO otherwise 
     267 */ 
     268void setSubtreeToWatched(id <SapphireDirectory> dir, BOOL watched); 
     269 
     270/*! 
     271 * @brief Set subtree to favorite or not favorite with restriction as to predicate.  Does not follow symlinks 
     272 * 
     273 * @param dir The subtree 
     274 * @param favorite YES if favorite, NO otherwise 
     275 */ 
     276void setSubtreeToFavorite(id <SapphireDirectory> dir, BOOL favorite); 
     277 
     278/*! 
     279 * @brief Set subtree to re-import from the specified source with restriction as to predicate.  Does not follow symlinks 
     280 * 
     281 * @param dir The subtree 
     282 * @param mask The source(s) on which to re-import 
     283 */ 
     284void setSubtreeToReimportFromMask(id <SapphireDirectory> dir, int mask); 
     285 
     286/*! 
     287 * @brief Clear metadata for an entire subtree with restriction as to predicate.  Does not follow symlinks 
     288 */ 
     289void setSubtreeToClearMetaData(id <SapphireDirectory> dir);