comparison dwt/internal/cocoa/NSURLCache.d @ 1:8b48be5454ce

The internal cocoa classes compile now
author Jacob Carlborg <doob@me.com> <jacob.carlborg@gmail.com>
date Tue, 19 Aug 2008 17:35:17 +0200
parents 380af2bdd8e5
children f565d3a95c0a
comparison
equal deleted inserted replaced
0:380af2bdd8e5 1:8b48be5454ce
20 import dwt.internal.cocoa.NSString; 20 import dwt.internal.cocoa.NSString;
21 import dwt.internal.cocoa.NSURLRequest; 21 import dwt.internal.cocoa.NSURLRequest;
22 import dwt.internal.cocoa.OS; 22 import dwt.internal.cocoa.OS;
23 import objc = dwt.internal.objc.runtime; 23 import objc = dwt.internal.objc.runtime;
24 24
25 enum NSURLCacheStoragePolicy 25 enum NSURLCacheStoragePolicy : NSUInteger
26 { 26 {
27 NSURLCacheStorageAllowed, 27 NSURLCacheStorageAllowed,
28 NSURLCacheStorageAllowedInMemoryOnly, 28 NSURLCacheStorageAllowedInMemoryOnly,
29 NSURLCacheStorageNotAllowed, 29 NSURLCacheStorageNotAllowed,
30 } 30 }
46 super(id); 46 super(id);
47 } 47 }
48 48
49 public NSCachedURLResponse cachedResponseForRequest (NSURLRequest request) 49 public NSCachedURLResponse cachedResponseForRequest (NSURLRequest request)
50 { 50 {
51 objc.id result = OS.objc_msgSend(this.id, OS.sel_cachedResponseForRequest_1, request !is null ? request.id : null); 51 objc.id result = OS.objc_msgSend(this.id_, OS.sel_cachedResponseForRequest_1, request !is null ? request.id_ : null);
52 return result !is null ? new NSCachedURLResponse(result) : null; 52 return result !is null ? new NSCachedURLResponse(result) : null;
53 } 53 }
54 54
55 public NSUInteger currentDiskUsage () 55 public NSUInteger currentDiskUsage ()
56 { 56 {
57 return cast(NSUInteger) OS.objc_msgSend(this.id, OS.sel_currentDiskUsage); 57 return cast(NSUInteger) OS.objc_msgSend(this.id_, OS.sel_currentDiskUsage);
58 } 58 }
59 59
60 public NSUInteger currentMemoryUsage () 60 public NSUInteger currentMemoryUsage ()
61 { 61 {
62 return cast(NSUInteger) OS.objc_msgSend(this.id, OS.sel_currentMemoryUsage); 62 return cast(NSUInteger) OS.objc_msgSend(this.id_, OS.sel_currentMemoryUsage);
63 } 63 }
64 64
65 public NSUInteger diskCapacity () 65 public NSUInteger diskCapacity ()
66 { 66 {
67 return cast(NSUInteger) OS.objc_msgSend(this.id, OS.sel_diskCapacity); 67 return cast(NSUInteger) OS.objc_msgSend(this.id_, OS.sel_diskCapacity);
68 } 68 }
69 69
70 public id initWithMemoryCapacity (NSUInteger memoryCapacity, NSUInteger diskCapacity, NSString path) 70 public id initWithMemoryCapacity (NSUInteger memoryCapacity, NSUInteger diskCapacity, NSString path)
71 { 71 {
72 objc.id result = OS.objc_msgSend(this.id, OS.sel_initWithMemoryCapacity_1diskCapacity_1diskPath_1, memoryCapacity, diskCapacity, 72 objc.id result = OS.objc_msgSend(this.id_, OS.sel_initWithMemoryCapacity_1diskCapacity_1diskPath_1, memoryCapacity, diskCapacity,
73 path !is null ? path.id : null); 73 path !is null ? path.id_ : null);
74 return result !is null ? new id(result) : null; 74 return result !is null ? new id(result) : null;
75 } 75 }
76 76
77 public NSUInteger memoryCapacity () 77 public NSUInteger memoryCapacity ()
78 { 78 {
79 return cast(NSUInteger) OS.objc_msgSend(this.id, OS.sel_memoryCapacity); 79 return cast(NSUInteger) OS.objc_msgSend(this.id_, OS.sel_memoryCapacity);
80 } 80 }
81 81
82 public void removeAllCachedResponses () 82 public void removeAllCachedResponses ()
83 { 83 {
84 OS.objc_msgSend(this.id, OS.sel_removeAllCachedResponses); 84 OS.objc_msgSend(this.id_, OS.sel_removeAllCachedResponses);
85 } 85 }
86 86
87 public void removeCachedResponseForRequest (NSURLRequest request) 87 public void removeCachedResponseForRequest (NSURLRequest request)
88 { 88 {
89 OS.objc_msgSend(this.id, OS.sel_removeCachedResponseForRequest_1, request !is null ? request.id : null); 89 OS.objc_msgSend(this.id_, OS.sel_removeCachedResponseForRequest_1, request !is null ? request.id_ : null);
90 } 90 }
91 91
92 public void setDiskCapacity (NSUInteger diskCapacity) 92 public void setDiskCapacity (NSUInteger diskCapacity)
93 { 93 {
94 OS.objc_msgSend(this.id, OS.sel_setDiskCapacity_1, diskCapacity); 94 OS.objc_msgSend(this.id_, OS.sel_setDiskCapacity_1, diskCapacity);
95 } 95 }
96 96
97 public void setMemoryCapacity (NSUInteger memoryCapacity) 97 public void setMemoryCapacity (NSUInteger memoryCapacity)
98 { 98 {
99 OS.objc_msgSend(this.id, OS.sel_setMemoryCapacity_1, memoryCapacity); 99 OS.objc_msgSend(this.id_, OS.sel_setMemoryCapacity_1, memoryCapacity);
100 } 100 }
101 101
102 public static void setSharedURLCache (NSURLCache cache) 102 public static void setSharedURLCache (NSURLCache cache)
103 { 103 {
104 OS.objc_msgSend(OS.class_NSURLCache, OS.sel_setSharedURLCache_1, cache !is null ? cache.id : null); 104 OS.objc_msgSend(OS.class_NSURLCache, OS.sel_setSharedURLCache_1, cache !is null ? cache.id_ : null);
105 } 105 }
106 106
107 public static NSURLCache sharedURLCache () 107 public static NSURLCache sharedURLCache ()
108 { 108 {
109 objc.id result = OS.objc_msgSend(OS.class_NSURLCache, OS.sel_sharedURLCache); 109 objc.id result = OS.objc_msgSend(OS.class_NSURLCache, OS.sel_sharedURLCache);
110 return result !is null ? new NSURLCache(result) : null; 110 return result !is null ? new NSURLCache(result) : null;
111 } 111 }
112 112
113 public void storeCachedResponse (NSCachedURLResponse cachedResponse, NSURLRequest request) 113 public void storeCachedResponse (NSCachedURLResponse cachedResponse, NSURLRequest request)
114 { 114 {
115 OS.objc_msgSend(this.id, OS.sel_storeCachedResponse_1forRequest_1, cachedResponse !is null ? cachedResponse.id : null, 115 OS.objc_msgSend(this.id_, OS.sel_storeCachedResponse_1forRequest_1, cachedResponse !is null ? cachedResponse.id_ : null,
116 request !is null ? request.id : null); 116 request !is null ? request.id_ : null);
117 } 117 }
118 118
119 } 119 }