Fix the test case compile warning of `SDWebImageTestDiskCache`
This commit is contained in:
parent
d44a5a331e
commit
0b3079d66b
|
@ -9,6 +9,9 @@
|
||||||
|
|
||||||
#import "SDWebImageTestCache.h"
|
#import "SDWebImageTestCache.h"
|
||||||
#import <SDWebImage/SDImageCacheConfig.h>
|
#import <SDWebImage/SDImageCacheConfig.h>
|
||||||
|
#import "SDFileAttributeHelper.h"
|
||||||
|
|
||||||
|
static NSString * const SDWebImageTestDiskCacheExtendedAttributeName = @"com.hackemist.SDWebImageTestDiskCache";
|
||||||
|
|
||||||
@implementation SDWebImageTestMemoryCache
|
@implementation SDWebImageTestMemoryCache
|
||||||
|
|
||||||
|
@ -104,4 +107,18 @@
|
||||||
return size;
|
return size;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
- (nullable NSData *)extendedDataForKey:(nonnull NSString *)key {
|
||||||
|
NSString *cachePathForKey = [self cachePathForKey:key];
|
||||||
|
return [SDFileAttributeHelper extendedAttribute:SDWebImageTestDiskCacheExtendedAttributeName atPath:cachePathForKey traverseLink:NO error:nil];
|
||||||
|
}
|
||||||
|
|
||||||
|
- (void)setExtendedData:(nullable NSData *)extendedData forKey:(nonnull NSString *)key {
|
||||||
|
NSString *cachePathForKey = [self cachePathForKey:key];
|
||||||
|
if (!extendedData) {
|
||||||
|
[SDFileAttributeHelper removeExtendedAttribute:SDWebImageTestDiskCacheExtendedAttributeName atPath:cachePathForKey traverseLink:NO error:nil];
|
||||||
|
} else {
|
||||||
|
[SDFileAttributeHelper setExtendedAttribute:SDWebImageTestDiskCacheExtendedAttributeName value:extendedData atPath:cachePathForKey traverseLink:NO overwrite:YES error:nil];
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
@end
|
@end
|
||||||
|
|
Loading…
Reference in New Issue