IOS Streaming Browser 1.0
An IOS streaming browser to stream the display to others or to a projector

HTTPDynamicFileResponse Class Reference

#import <HTTPDynamicFileResponse.h>

Inheritance diagram for HTTPDynamicFileResponse:
Collaboration diagram for HTTPDynamicFileResponse:

Public Member Functions

(id) - initWithFilePath:forConnection:separator:replacementDictionary:

Protected Attributes

NSDataseparator
NSDictionary * replacementDict

Detailed Description

This class is designed to assist with dynamic content. Imagine you have a file that you want to make dynamic:

<html> <body>

ComputerName Control Panel

... System Time: SysTime </body> </html>

Now you could generate the entire file in Objective-C, but this would be a horribly tedious process. Beside, you want to design the file with professional tools to make it look pretty.

So all you have to do is escape your dynamic content like this:

...

%ComputerName%% Control Panel

... System Time: %SysTime%%

And then you create an instance of this class with:

  • separator = "%%" - replacementDictionary = { "ComputerName"="Black MacBook", "SysTime"="2010-04-30 03:18:24" }

This class will then perform the replacements for you, on the fly, as it reads the file data. This class is also asynchronous, so it will perform the file IO using its own GCD queue.

Definition at line 38 of file HTTPDynamicFileResponse.h.


Member Function Documentation

- (id) initWithFilePath: (NSString *)  fpath
forConnection: (HTTPConnection *)  parent
separator: (NSString *)  separatorStr
replacementDictionary: (NSDictionary *)  dict 

Initialize the HTTPDyanmicFileResponse param NSString param HTTPConnection param NSString param NSDictionary returns id

Initialize the HTTPDynamicFileResponse with a file path for a specific connection, separator string, and dictionary param NSSTring param HTTPConnection param NSString param NSDictionary returns id

Definition at line 20 of file HTTPDynamicFileResponse.m.

                      :(NSString *)fpath
         forConnection:(HTTPConnection *)parent
             separator:(NSString *)separatorStr
 replacementDictionary:(NSDictionary *)dict
{
        if ((self = [super initWithFilePath:fpath forConnection:parent]))
        {
                // Sets the separator string
                separator = [[separatorStr dataUsingEncoding:NSUTF8StringEncoding] retain];
        
        // Sets the replacement dictionary
                replacementDict = [dict retain];
        }
        return self;
}

Field Documentation

- (NSDictionary*) replacementDict [protected]

Definition at line 48 of file HTTPDynamicFileResponse.h.

- (NSData*) separator [protected]

separator string

Definition at line 43 of file HTTPDynamicFileResponse.h.


The documentation for this class was generated from the following files:
 All Data Structures Files Functions Variables Typedefs Enumerations Enumerator Properties Defines