-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathFBFileCacheManager.h
More file actions
64 lines (48 loc) · 1.62 KB
/
Copy pathFBFileCacheManager.h
File metadata and controls
64 lines (48 loc) · 1.62 KB
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
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
//
// FBFileCacheManager.h
// FBFileCache
//
// Created by Hiroshi Hashiguchi on 11/03/02.
// Copyright 2011 Five-technology Co.,Ltd.. All rights reserved.
//
#import <Foundation/Foundation.h>
#define FBFileCachManager_VERSION @"1.00"
@class FBCachedFile;
@class FBLockManager;
@interface FBFileCacheManager : NSObject {
NSString* path_;
NSUInteger size_; // [MB]
NSUInteger usingSize_; // [B]
BOOL includingParameters_; // default: YES (include URL parameters for the hash key)
NSUInteger hitCounter_;
NSUInteger fetchCounter_;
NSUInteger count_;
FBLockManager* lockManager_;
BOOL fileProtectionEnabled_;
}
#pragma mark -
#pragma mark Properties
@property (nonatomic, copy, readonly) NSString* path;
@property (assign, readonly) float cacheHitRate;
@property (assign, readonly) NSUInteger usingSize;
@property (assign, readonly) NSUInteger count;
@property (assign, readonly) NSUInteger size;
@property (assign) BOOL includingParameters;
@property (assign) BOOL fileProtectionEnabled;
// Initializing a New Object
- (id)initWithSize:(NSUInteger)size;
- (id)initWithPath:(NSString*)path size:(NSUInteger)size;
// Cache Management
- (FBCachedFile*)putFile:(NSString*)contentFilePath forURL:(NSURL*)sourceURL;
- (FBCachedFile*)putData:(NSData*)contentData forURL:(NSURL*)sourceURL;
- (FBCachedFile*)cachedFileForURL:(NSURL*)sourceURL;
- (void)removeCachedFileForURL:(NSURL*)sourceURL;
- (void)removeAllCachedFiles;
- (void)reload;
- (void)resizeTo:(NSUInteger)size;
// Cache Information
- (void)resetCacheHitRate;
// Etc
+ (NSString*)defaultPath;
+ (NSString*)version;
@end