Finished split into more logical components. Library now copies Headers to Build/RestKit and you can selectively link against the components your app needs. libRestKit.a contains everything from the core library.

This commit is contained in:
Blake Watters
2010-10-01 13:02:24 -04:00
parent f06e3acb88
commit bd93d43f94
72 changed files with 1001 additions and 513 deletions

View File

@@ -0,0 +1,35 @@
//
// RKParamsFileAttachment.m
// RestKit
//
// Created by Blake Watters on 8/6/09.
// Copyright 2009 Two Toasters. All rights reserved.
//
#import "RKParamsFileAttachment.h"
@implementation RKParamsFileAttachment
@synthesize filePath = _filePath;
- (void)dealloc {
[_filePath release];
[super dealloc];
}
- (void)writeAttachmentToHTTPBody:(NSMutableData*)HTTPBody {
NSInputStream *stream = [[[NSInputStream alloc] initWithFileAtPath:_filePath] autorelease];
[stream open];
int bytesRead;
while ([stream hasBytesAvailable]) {
unsigned char buffer[1024*256];
bytesRead = [stream read:buffer maxLength:sizeof(buffer)];
if (bytesRead == 0) {
break;
}
[HTTPBody appendData:[NSData dataWithBytes:buffer length:bytesRead]];
}
[stream close];
}
@end