SDWebImageTestCache.h 1.4 KB

1234567891011121314151617181920212223242526272829303132333435363738394041
  1. /*
  2. * This file is part of the SDWebImage package.
  3. * (c) Olivier Poitrey <rs@dailymotion.com>
  4. * (c) Matt Galloway
  5. *
  6. * For the full copyright and license information, please view the LICENSE
  7. * file that was distributed with this source code.
  8. */
  9. #import <SDWebImage/SDMemoryCache.h>
  10. #import <SDWebImage/SDDiskCache.h>
  11. #import <SDWebImage/SDImageCacheDefine.h>
  12. // A really naive implementation of custom memory cache and disk cache
  13. @interface SDWebImageTestMemoryCache : NSObject <SDMemoryCache>
  14. @property (nonatomic, strong, nonnull) SDImageCacheConfig *config;
  15. @property (nonatomic, strong, nonnull) NSCache *cache;
  16. @end
  17. @interface SDWebImageTestDiskCache : NSObject <SDDiskCache>
  18. @property (nonatomic, strong, nonnull) SDImageCacheConfig *config;
  19. @property (nonatomic, copy, nonnull) NSString *cachePath;
  20. @property (nonatomic, strong, nonnull) NSFileManager *fileManager;
  21. @end
  22. // A really naive implementation of custom image cache using memory cache and disk cache
  23. @interface SDWebImageTestCache : NSObject <SDImageCache>
  24. @property (nonatomic, strong, nonnull) SDImageCacheConfig *config;
  25. @property (nonatomic, strong, nonnull) SDWebImageTestMemoryCache *memoryCache;
  26. @property (nonatomic, strong, nonnull) SDWebImageTestDiskCache *diskCache;
  27. - (nullable instancetype)initWithCachePath:(nonnull NSString *)cachePath config:(nonnull SDImageCacheConfig *)config;
  28. @property (nonatomic, class, readonly, nonnull) SDWebImageTestCache *sharedCache;
  29. @end