1
0
mirror of https://github.com/danog/Telegram.git synced 2024-12-11 08:59:48 +01:00
Telegram/Watch/Extension/TGFileCache.h
2015-10-01 19:19:52 +03:00

23 lines
1.4 KiB
Objective-C

#import <Foundation/Foundation.h>
@interface TGFileCache : NSObject
@property (nonatomic, strong) NSString *defaultFileExtension;
- (instancetype)initWithName:(NSString *)name useMemoryCache:(bool)useMemoryCache;
- (instancetype)initWithName:(NSString *)name useMemoryCache:(bool)useMemoryCache useApplicationGroup:(bool)useApplicationGroup;
- (void)fetchDataForKey:(NSString *)key synchronous:(bool)synchronous unserializeBlock:(id (^)(NSData *))unserializeBlock completion:(void (^)(id))completion;
- (void)fetchDataForKey:(NSString *)key memoryOnly:(bool)memoryOnly synchronous:(bool)synchronous unserializeBlock:(id (^)(NSData *))unserializeBlock completion:(void (^)(id))completion;
- (void)cacheData:(NSData *)data key:(NSString *)key synchronous:(bool)synchronous completion:(void (^)(NSURL *))completion;
- (void)cacheData:(NSObject<NSCoding> *)data key:(NSString *)key synchronous:(bool)synchronous serializeBlock:(NSData *(^)(NSObject<NSCoding> *))serializeBlock completion:(void (^)(NSURL *))completion;
- (void)cacheFileAtURL:(NSURL *)url key:(NSString *)key synchronous:(bool)synchronous completion:(void (^)(NSURL *))completion;
- (void)cacheFileAtURL:(NSURL *)url key:(NSString *)key synchronous:(bool)synchronous unserializeBlock:(id (^)(NSData *))unserializeBlock completion:(void (^)(NSURL *))completion;
- (void)clearCacheSynchronous:(bool)synchronous;
- (bool)hasDataForKey:(NSString *)key;
- (NSURL *)urlForKey:(NSString *)key;
@end