Fixed syntax

This commit is contained in:
Pierre-Olivier Latour
2012-12-30 18:48:25 -08:00
parent fca52ab2ab
commit 679f62a55d
9 changed files with 153 additions and 153 deletions
+23 -23
View File
@@ -41,23 +41,23 @@
@property(nonatomic) NSUInteger cacheControlMaxAge; // Default is 0 seconds i.e. "no-cache"
@property(nonatomic, readonly) NSDictionary* additionalHeaders;
+ (GCDWebServerResponse*) response;
- (id) init;
- (id) initWithContentType:(NSString*)type contentLength:(NSUInteger)length; // Pass nil contentType to indicate empty body
- (void) setValue:(NSString*)value forAdditionalHeader:(NSString*)header;
- (BOOL) hasBody; // Convenience method
- (id)init;
- (id)initWithContentType:(NSString*)type contentLength:(NSUInteger)length; // Pass nil contentType to indicate empty body
- (void)setValue:(NSString*)value forAdditionalHeader:(NSString*)header;
- (BOOL)hasBody; // Convenience method
@end
@interface GCDWebServerResponse (Subclassing)
- (BOOL) open; // Implementation required
- (NSInteger) read:(void*)buffer maxLength:(NSUInteger)length; // Implementation required
- (BOOL) close; // Implementation required
- (BOOL)open; // Implementation required
- (NSInteger)read:(void*)buffer maxLength:(NSUInteger)length; // Implementation required
- (BOOL)close; // Implementation required
@end
@interface GCDWebServerResponse (Extensions)
+ (GCDWebServerResponse*) responseWithStatusCode:(NSInteger)statusCode;
+ (GCDWebServerResponse*) responseWithRedirect:(NSURL*)location permanent:(BOOL)permanent;
- (id) initWithStatusCode:(NSInteger)statusCode;
- (id) initWithRedirect:(NSURL*)location permanent:(BOOL)permanent;
+ (GCDWebServerResponse*)responseWithStatusCode:(NSInteger)statusCode;
+ (GCDWebServerResponse*)responseWithRedirect:(NSURL*)location permanent:(BOOL)permanent;
- (id)initWithStatusCode:(NSInteger)statusCode;
- (id)initWithRedirect:(NSURL*)location permanent:(BOOL)permanent;
@end
@interface GCDWebServerDataResponse : GCDWebServerResponse {
@@ -65,17 +65,17 @@
NSData* _data;
NSInteger _offset;
}
+ (GCDWebServerDataResponse*) responseWithData:(NSData*)data contentType:(NSString*)type;
- (id) initWithData:(NSData*)data contentType:(NSString*)type;
+ (GCDWebServerDataResponse*)responseWithData:(NSData*)data contentType:(NSString*)type;
- (id)initWithData:(NSData*)data contentType:(NSString*)type;
@end
@interface GCDWebServerDataResponse (Extensions)
+ (GCDWebServerDataResponse*) responseWithText:(NSString*)text;
+ (GCDWebServerDataResponse*) responseWithHTML:(NSString*)html;
+ (GCDWebServerDataResponse*) responseWithHTMLTemplate:(NSString*)path variables:(NSDictionary*)variables;
- (id) initWithText:(NSString*)text; // Encodes using UTF-8
- (id) initWithHTML:(NSString*)html; // Encodes using UTF-8
- (id) initWithHTMLTemplate:(NSString*)path variables:(NSDictionary*)variables; // Simple template system that replaces all occurences of "%variable%" with corresponding value (encodes using UTF-8)
+ (GCDWebServerDataResponse*)responseWithText:(NSString*)text;
+ (GCDWebServerDataResponse*)responseWithHTML:(NSString*)html;
+ (GCDWebServerDataResponse*)responseWithHTMLTemplate:(NSString*)path variables:(NSDictionary*)variables;
- (id)initWithText:(NSString*)text; // Encodes using UTF-8
- (id)initWithHTML:(NSString*)html; // Encodes using UTF-8
- (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 {
@@ -83,8 +83,8 @@
NSString* _path;
int _file;
}
+ (GCDWebServerFileResponse*) responseWithFile:(NSString*)path;
+ (GCDWebServerFileResponse*) responseWithFile:(NSString*)path isAttachment:(BOOL)attachment;
- (id) initWithFile:(NSString*)path;
- (id) initWithFile:(NSString*)path isAttachment:(BOOL)attachment;
+ (GCDWebServerFileResponse*)responseWithFile:(NSString*)path;
+ (GCDWebServerFileResponse*)responseWithFile:(NSString*)path isAttachment:(BOOL)attachment;
- (id)initWithFile:(NSString*)path;
- (id)initWithFile:(NSString*)path isAttachment:(BOOL)attachment;
@end