From 94217b294ccd75a34787eb04d6e273e99536e45b Mon Sep 17 00:00:00 2001 From: 重庆迈尖科技有限公司 Date: 星期三, 30 一月 2019 15:12:32 +0800 Subject: [PATCH] no message --- Pods/SDWebImage/SDWebImage/SDImageCache.h | 38 +++++++++++++++++++++++++++++++++++--- 1 files changed, 35 insertions(+), 3 deletions(-) diff --git a/Pods/SDWebImage/SDWebImage/SDImageCache.h b/Pods/SDWebImage/SDWebImage/SDImageCache.h index 9ae2eb4..9b07f47 100644 --- a/Pods/SDWebImage/SDWebImage/SDImageCache.h +++ b/Pods/SDWebImage/SDWebImage/SDImageCache.h @@ -8,8 +8,7 @@ #import <Foundation/Foundation.h> #import "SDWebImageCompat.h" - -@class SDImageCacheConfig; +#import "SDImageCacheConfig.h" typedef NS_ENUM(NSInteger, SDImageCacheType) { /** @@ -24,6 +23,22 @@ * The image was obtained from the memory cache. */ SDImageCacheTypeMemory +}; + +typedef NS_OPTIONS(NSUInteger, SDImageCacheOptions) { + /** + * By default, we do not query disk data when the image is cached in memory. This mask can force to query disk data at the same time. + */ + SDImageCacheQueryDataWhenInMemory = 1 << 0, + /** + * By default, we query the memory cache synchronously, disk cache asynchronously. This mask can force to query disk cache synchronously. + */ + SDImageCacheQueryDiskSync = 1 << 1, + /** + * By default, images are decoded respecting their original size. On iOS, this flag will scale down the + * images to a size compatible with the constrained memory of devices. + */ + SDImageCacheScaleDownLargeImages = 1 << 2 }; typedef void(^SDCacheQueryCompletedBlock)(UIImage * _Nullable image, NSData * _Nullable data, SDImageCacheType cacheType); @@ -139,7 +154,6 @@ /** * Synchronously store image NSData into disk cache at the given key. * - * @warning This method is synchronous, make sure to call it from the ioQueue * * @param imageData The image data to store * @param key The unique image cache key, usually it's image absolute URL @@ -158,6 +172,13 @@ - (void)diskImageExistsWithKey:(nullable NSString *)key completion:(nullable SDWebImageCheckCacheCompletionBlock)completionBlock; /** + * Sync check if image data exists in disk cache already (does not load the image) + * + * @param key the key describing the url + */ +- (BOOL)diskImageDataExistsWithKey:(nullable NSString *)key; + +/** * Operation that queries the cache asynchronously and call the completion when done. * * @param key The unique key used to store the wanted image @@ -168,6 +189,17 @@ - (nullable NSOperation *)queryCacheOperationForKey:(nullable NSString *)key done:(nullable SDCacheQueryCompletedBlock)doneBlock; /** + * Operation that queries the cache asynchronously and call the completion when done. + * + * @param key The unique key used to store the wanted image + * @param options A mask to specify options to use for this cache query + * @param doneBlock The completion block. Will not get called if the operation is cancelled + * + * @return a NSOperation instance containing the cache op + */ +- (nullable NSOperation *)queryCacheOperationForKey:(nullable NSString *)key options:(SDImageCacheOptions)options done:(nullable SDCacheQueryCompletedBlock)doneBlock; + +/** * Query the memory cache synchronously. * * @param key The unique key used to store the image -- Gitblit v1.8.0