-
Notifications
You must be signed in to change notification settings - Fork 10
Expand file tree
/
Copy pathUUDataCache.h
More file actions
30 lines (23 loc) · 965 Bytes
/
UUDataCache.h
File metadata and controls
30 lines (23 loc) · 965 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
//
// UUDataCache.h
// Useful Utilities - UUDataCache for commonly fetched data from URL's
//
// License:
// You are free to use this code for whatever purposes you desire. The only requirement is that you smile everytime you use it.
//
// Contact: @cheesemaker or jon@threejacks.com
#import <Foundation/Foundation.h>
@interface UUDataCache : NSObject
+ (NSData*) uuDataForURL:(NSURL*)url;
+ (void) uuCacheData:(NSData*)data forURL:(NSURL*)url;
+ (void) uuClearCacheForURL:(NSURL*)url;
+ (void) uuSetCacheExpirationLength:(NSTimeInterval)seconds;
+ (void) uuClearCacheContents;
+ (void) uuPurgeExpiredContent;
+ (void) uuPurgeContentAboveSize:(unsigned long long)purgeFileSize;
+ (BOOL) uuDoesCachedFileExistForURL:(NSURL*)url;
+ (UUDataCache*) sharedCache;
// If you want to use UUDataCache as an NSCache or NSMutableDictionary replacement
- (id) objectForKey:(id)key;
- (void) setObject:(id)object forKey:(id)key;
@end