/usr/include/GNUstep/Foundation/NSURLCache.h is in libgnustep-base-dev 1.24.7-1.
This file is owned by root:root, with mode 0o644.
The actual contents of the file can be viewed below.
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 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 | /* Interface for NSURLCache for GNUstep
Copyright (C) 2006 Software Foundation, Inc.
Written by: Richard Frith-Macdonald <frm@gnu.org>
Date: 2006
This file is part of the GNUstep Base Library.
This library is free software; you can redistribute it and/or
modify it under the terms of the GNU Lesser General Public
License as published by the Free Software Foundation; either
version 2 of the License, or (at your option) any later version.
This library is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
Library General Public License for more details.
You should have received a copy of the GNU Lesser General Public
License along with this library; if not, write to the Free
Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
Boston, MA 02111 USA.
*/
#ifndef __NSURLCache_h_GNUSTEP_BASE_INCLUDE
#define __NSURLCache_h_GNUSTEP_BASE_INCLUDE
#import <GNUstepBase/GSVersionMacros.h>
#if OS_API_VERSION(MAC_OS_X_VERSION_10_2,GS_API_LATEST) && GS_API_VERSION( 11300,GS_API_LATEST)
#import <Foundation/NSObject.h>
#if defined(__cplusplus)
extern "C" {
#endif
@class NSData;
@class NSDictionary;
@class NSURLRequest;
@class NSURLRequest;
@class NSURLResponse;
/**
* Specifies the cache storage policy.
*/
typedef enum
{
NSURLCacheStorageAllowed, /** Unrestricted caching */
NSURLCacheStorageAllowedInMemoryOnly, /** In memory caching only */
NSURLCacheStorageNotAllowed /** No caching allowed */
} NSURLCacheStoragePolicy;
/**
* Encapsulates a cached response to a URL load request.
*/
@interface NSCachedURLResponse : NSObject <NSCoding, NSCopying>
{
#if GS_EXPOSE(NSCachedURLResponse)
void *_NSCachedURLResponseInternal;
#endif
}
/**
* Returns the data with which the receiver was initialised.
*/
- (NSData *) data;
/**
* Uses the NSURLCacheStorageAllowed policy to cache the specified
* response and data.<br />
* Returns the cached response.
*/
- (id) initWithResponse: (NSURLResponse *)response data: (NSData *)data;
/**
* Returns the receiver initialized with the provided parameters.
*/
- (id) initWithResponse: (NSURLResponse *)response
data: (NSData *)data
userInfo: (NSDictionary *)userInfo
storagePolicy: (NSURLCacheStoragePolicy)storagePolicy;
/**
* Returns the response with which the receiver was initialised.
*/
- (NSURLResponse *) response;
/**
* Returns the storage policy with which the receiver was initialised.
*/
- (NSURLCacheStoragePolicy) storagePolicy;
/**
* Returns the user info dictionary with which the receiver was initialised
* (if any).
*/
- (NSDictionary *) userInfo;
@end
@interface NSURLCache : NSObject
{
#if GS_EXPOSE(NSURLCache)
void *_NSURLCacheInternal;
#endif
}
/**
* Sets the shared [NSURLCache] used throughout the process.<br />
* If you are going to call this method to specify an alternative to
* the default cache, you should do so before the shared cache is used
* in order to avoid loss of data that was in the old cache.
*/
+ (void) setSharedURLCache: (NSURLCache *)cache;
/**
* Returns the shared cache instance set by +setSharedURLCache: or,
* if none has been set, returns an instance initialised with<br />
* <deflist>
* <term>Memory capacity</term>
* <desc>4 megabytes</desc>
* <term>Disk capacity</term>
* <desc>20 megabytes</desc>
* <term>Disk path</term>
* <desc>user-library-path/Caches/current-app-name</desc>
* </deflist>
*/
+ (NSURLCache *) sharedURLCache;
/**
* Returns the [NSCachedURLResponse] cached for the specified request
* or nil if there is no matching response in tthe cache.
*/
- (NSCachedURLResponse *) cachedResponseForRequest: (NSURLRequest *)request;
/**
* Returns the current size (butes) of the data stored in the on-disk
* cache.
*/
- (NSUInteger) currentDiskUsage;
/**
* Returns the current size (butes) of the data stored in the in-memory
* cache.
*/
- (NSUInteger) currentMemoryUsage;
/**
* Returns the disk capacity (in bytes) of the cache.
*/
- (NSUInteger) diskCapacity;
/**
* Returns the receiver initialised with the specified capacities
* (in bytes) and using the specified location on disk for persistent
* storage.
*/
- (id) initWithMemoryCapacity: (NSUInteger)memoryCapacity
diskCapacity: (NSUInteger)diskCapacity
diskPath: (NSString *)path;
/**
* Returns the memory capacity (in bytes) of the cache.
*/
- (NSUInteger) memoryCapacity;
/**
* Empties the cache.
*/
- (void) removeAllCachedResponses;
/**
* Removes from the cache (if present) the [NSCachedURLResponse]
* which was stored using the specified request.
*/
- (void) removeCachedResponseForRequest: (NSURLRequest *)request;
/**
* Sets the disk capacity (in bytes) truncating cache contents if necessary.
*/
- (void) setDiskCapacity: (NSUInteger)diskCapacity;
/**
* Sets the memory capacity (in bytes) truncating cache contents if necessary.
*/
- (void) setMemoryCapacity: (NSUInteger)memoryCapacity;
/**
* Stores cachedResponse in the cache, keyed on request.<br />
* Replaces any existing response with the same key.
*/
- (void) storeCachedResponse: (NSCachedURLResponse *)cachedResponse
forRequest: (NSURLRequest *)request;
@end
#if defined(__cplusplus)
}
#endif
#endif
#endif
|