Move ivars to class extensions

This commit is contained in:
Pierre-Olivier Latour
2014-03-19 09:19:59 -07:00
parent 08e58e4a5a
commit e65b569ddc
9 changed files with 133 additions and 94 deletions
+3 -18
View File
@@ -27,14 +27,7 @@
#import <Foundation/Foundation.h>
@interface GCDWebServerResponse : NSObject {
@private
NSString* _type;
NSUInteger _length;
NSInteger _status;
NSUInteger _maxAge;
NSMutableDictionary* _headers;
}
@interface GCDWebServerResponse : NSObject
@property(nonatomic, readonly) NSString* contentType;
@property(nonatomic, readonly) NSUInteger contentLength;
@property(nonatomic) NSInteger statusCode; // Default is 200
@@ -60,11 +53,7 @@
- (id)initWithRedirect:(NSURL*)location permanent:(BOOL)permanent;
@end
@interface GCDWebServerDataResponse : GCDWebServerResponse {
@private
NSData* _data;
NSInteger _offset;
}
@interface GCDWebServerDataResponse : GCDWebServerResponse
+ (GCDWebServerDataResponse*)responseWithData:(NSData*)data contentType:(NSString*)type;
- (id)initWithData:(NSData*)data contentType:(NSString*)type;
@end
@@ -78,11 +67,7 @@
- (id)initWithHTMLTemplate:(NSString*)path variables:(NSDictionary*)variables; // Simple template system that replaces all occurences of "%variable%" with corresponding value (encodes using UTF-8)
@end
@interface GCDWebServerFileResponse : GCDWebServerResponse {
@private
NSString* _path;
int _file;
}
@interface GCDWebServerFileResponse : GCDWebServerResponse
+ (GCDWebServerFileResponse*)responseWithFile:(NSString*)path;
+ (GCDWebServerFileResponse*)responseWithFile:(NSString*)path isAttachment:(BOOL)attachment;
- (id)initWithFile:(NSString*)path;