Skip to content

Commit

Permalink
oy vey
Browse files Browse the repository at this point in the history
  • Loading branch information
mralexgray committed Mar 8, 2013
1 parent 62abea9 commit b01c688
Show file tree
Hide file tree
Showing 21 changed files with 4,529 additions and 432 deletions.
Binary file modified .DS_Store
Binary file not shown.
Binary file modified Example/.DS_Store
Binary file not shown.
65 changes: 65 additions & 0 deletions Example/MultipartFormDataParser.h
@@ -0,0 +1,65 @@

#import "MultipartMessageHeader.h"

/*
Part one: http://tools.ietf.org/html/rfc2045 (Format of Internet Message Bodies)
Part two: http://tools.ietf.org/html/rfc2046 (Media Types)
Part three: http://tools.ietf.org/html/rfc2047 (Message Header Extensions for Non-ASCII Text)
Part four: http://tools.ietf.org/html/rfc4289 (Registration Procedures)
Part five: http://tools.ietf.org/html/rfc2049 (Conformance Criteria and Examples)
Internet message format: http://tools.ietf.org/html/rfc2822
Multipart/form-data http://tools.ietf.org/html/rfc2388
*/

@class MultipartFormDataParser;

//-----------------------------------------------------------------
// protocol MultipartFormDataParser
//-----------------------------------------------------------------

@protocol MultipartFormDataParserDelegate <NSObject>
@optional
- (void) processContent:(NSData*) data WithHeader:(MultipartMessageHeader*) header;
- (void) processEndOfPartWithHeader:(MultipartMessageHeader*) header;
- (void) processPreambleData:(NSData*) data;
- (void) processEpilogueData:(NSData*) data;
- (void) processStartOfPartWithHeader:(MultipartMessageHeader*) header;
@end

//-----------------------------------------------------------------
// interface MultipartFormDataParser
//-----------------------------------------------------------------

@interface MultipartFormDataParser : NSObject {
NSMutableData* pendingData;
NSData* boundaryData;
MultipartMessageHeader* currentHeader;

BOOL waitingForCRLF;
BOOL reachedEpilogue;
BOOL processedPreamble;
BOOL checkForContentEnd;

#if __has_feature(objc_arc_weak)
__weak id<MultipartFormDataParserDelegate> delegate;
#else
__unsafe_unretained id<MultipartFormDataParserDelegate> delegate;
#endif
int currentEncoding;
NSStringEncoding formEncoding;
}

- (BOOL) appendData:(NSData*) data;

- (id) initWithBoundary:(NSString*) boundary formEncoding:(NSStringEncoding) formEncoding;

#if __has_feature(objc_arc_weak)
@property(weak, readwrite) id delegate;
#else
@property(unsafe_unretained, readwrite) id delegate;
#endif
@property(readwrite) NSStringEncoding formEncoding;

@end

0 comments on commit b01c688

Please sign in to comment.