![]() |
IOS Streaming Browser 1.0
An IOS streaming browser to stream the display to others or to a projector
|
00001 #import <Foundation/Foundation.h> 00002 #import "HTTPResponse.h" 00003 #import "HTTPAsyncFileResponse.h" 00004 00005 /** 00006 * This class is designed to assist with dynamic content. 00007 * Imagine you have a file that you want to make dynamic: 00008 * 00009 * <html> 00010 * <body> 00011 * <h1>ComputerName Control Panel</h1> 00012 * ... 00013 * <li>System Time: SysTime</li> 00014 * </body> 00015 * </html> 00016 * 00017 * Now you could generate the entire file in Objective-C, 00018 * but this would be a horribly tedious process. 00019 * Beside, you want to design the file with professional tools to make it look pretty. 00020 * 00021 * So all you have to do is escape your dynamic content like this: 00022 * 00023 * ... 00024 * <h1>%%ComputerName%% Control Panel</h1> 00025 * ... 00026 * <li>System Time: %%SysTime%%</li> 00027 * 00028 * And then you create an instance of this class with: 00029 * 00030 * - separator = @"%%" 00031 * - replacementDictionary = { "ComputerName"="Black MacBook", "SysTime"="2010-04-30 03:18:24" } 00032 * 00033 * This class will then perform the replacements for you, on the fly, as it reads the file data. 00034 * This class is also asynchronous, so it will perform the file IO using its own GCD queue. 00035 **/ 00036 00037 00038 @interface HTTPDynamicFileResponse : HTTPAsyncFileResponse 00039 { 00040 /** 00041 separator string 00042 **/ 00043 NSData *separator; 00044 00045 /** 00046 00047 **/ 00048 NSDictionary *replacementDict; 00049 } 00050 00051 /** 00052 Initialize the HTTPDyanmicFileResponse 00053 param NSString 00054 param HTTPConnection 00055 param NSString 00056 param NSDictionary 00057 returns id 00058 **/ 00059 - (id)initWithFilePath:(NSString *)filePath 00060 forConnection:(HTTPConnection *)connection 00061 separator:(NSString *)separatorStr 00062 replacementDictionary:(NSDictionary *)dictionary; 00063 00064 @end