m48plus/HTTP Server/HTTPResponse.h
2020-05-05 20:15:30 +02:00

34 lines
513 B
Objective-C

#import <Foundation/Foundation.h>
@protocol HTTPResponse
- (UInt64)contentLength;
- (UInt64)offset;
- (void)setOffset:(UInt64)offset;
- (NSData *)readDataOfLength:(unsigned int)length;
@end
@interface HTTPFileResponse : NSObject <HTTPResponse>
{
NSString *filePath;
NSFileHandle *fileHandle;
}
- (id)initWithFilePath:(NSString *)filePath;
- (NSString *)filePath;
@end
@interface HTTPDataResponse : NSObject <HTTPResponse>
{
unsigned offset;
NSData *data;
}
- (id)initWithData:(NSData *)data;
@end