Permalink
Browse files

Updated framework building scripts

  • Loading branch information...
s1g53gv committed Aug 1, 2012
1 parent 5992b47 commit 998152547a2cd62347e4bb17d99dd8e96dd5f7ba
Showing with 536 additions and 2,400 deletions.
  1. BIN Bundle/FPKReaderBundle.bundle/AudioViewController.nib
  2. BIN Bundle/FPKReaderBundle.bundle/BookmarkView.nib
  3. BIN Bundle/FPKReaderBundle.bundle/Info.plist
  4. BIN Bundle/FPKReaderBundle.bundle/OutlineView.nib
  5. BIN Bundle/FPKReaderBundle.bundle/SearchView2_pad.nib
  6. BIN Bundle/FPKReaderBundle.bundle/SearchView2_phone.nib
  7. BIN Bundle/FPKReaderBundle.bundle/TextDisplayView.nib
  8. BIN Bundle/FPKReaderBundle.bundle/WebBrowser.nib
  9. BIN Bundle/FPKReaderBundle.bundle/X.png
  10. BIN Bundle/FPKReaderBundle.bundle/X@2x.png
  11. BIN Bundle/FPKReaderBundle.bundle/blackslider.png
  12. BIN Bundle/FPKReaderBundle.bundle/bookmark_add.png
  13. BIN Bundle/FPKReaderBundle.bundle/bookmark_add@2x.png
  14. BIN Bundle/FPKReaderBundle.bundle/changeModeDouble.png
  15. BIN Bundle/FPKReaderBundle.bundle/changeModeDouble@2x.png
  16. BIN Bundle/FPKReaderBundle.bundle/changeModeOverflow.png
  17. BIN Bundle/FPKReaderBundle.bundle/changeModeOverflow@2x.png
  18. BIN Bundle/FPKReaderBundle.bundle/changeModeSingle.png
  19. BIN Bundle/FPKReaderBundle.bundle/changeModeSingle@2x.png
  20. BIN Bundle/FPKReaderBundle.bundle/close.png
  21. BIN Bundle/FPKReaderBundle.bundle/close_player.png
  22. BIN Bundle/FPKReaderBundle.bundle/direction_l2r.png
  23. BIN Bundle/FPKReaderBundle.bundle/direction_l2r@2x.png
  24. BIN Bundle/FPKReaderBundle.bundle/direction_r2l.png
  25. BIN Bundle/FPKReaderBundle.bundle/direction_r2l@2x.png
  26. BIN Bundle/FPKReaderBundle.bundle/img_outline_triangledown.png
  27. BIN Bundle/FPKReaderBundle.bundle/img_outline_triangleright.png
  28. BIN Bundle/FPKReaderBundle.bundle/indice.png
  29. BIN Bundle/FPKReaderBundle.bundle/indice@2x.png
  30. BIN Bundle/FPKReaderBundle.bundle/next.png
  31. BIN Bundle/FPKReaderBundle.bundle/pagelead.png
  32. BIN Bundle/FPKReaderBundle.bundle/pagelead@2x.png
  33. BIN Bundle/FPKReaderBundle.bundle/pause_player.png
  34. BIN Bundle/FPKReaderBundle.bundle/play_player.png
  35. BIN Bundle/FPKReaderBundle.bundle/prew.png
  36. BIN Bundle/FPKReaderBundle.bundle/reload.png
  37. BIN Bundle/FPKReaderBundle.bundle/search.png
  38. BIN Bundle/FPKReaderBundle.bundle/search@2x.png
  39. BIN Bundle/FPKReaderBundle.bundle/stop.png
  40. BIN Bundle/FPKReaderBundle.bundle/text.png
  41. BIN Bundle/FPKReaderBundle.bundle/text@2x.png
  42. BIN Bundle/FPKReaderBundle.bundle/zoomLock.png
  43. BIN Bundle/FPKReaderBundle.bundle/zoomLock@2x.png
  44. BIN Bundle/FPKReaderBundle.bundle/zoomUnlock.png
  45. BIN Bundle/FPKReaderBundle.bundle/zoomUnlock@2x.png
  46. +42 −0 Classes/ThirdParties/ASIHTTP/ASIDataCompressor.h
  47. +219 −0 Classes/ThirdParties/ASIHTTP/ASIDataCompressor.m
  48. +41 −0 Classes/ThirdParties/ASIHTTP/ASIDataDecompressor.h
  49. +218 −0 Classes/ThirdParties/ASIHTTP/ASIDataDecompressor.m
  50. +0 −1 FastPdfKit.embeddedframework/FastPdfKit.framework/FastPdfKit
  51. +0 −1 FastPdfKit.embeddedframework/FastPdfKit.framework/Headers
  52. +0 −1 FastPdfKit.embeddedframework/FastPdfKit.framework/Resources
  53. BIN FastPdfKit.embeddedframework/FastPdfKit.framework/Versions/A/FastPdfKit
  54. +0 −35 FastPdfKit.embeddedframework/FastPdfKit.framework/Versions/A/Headers/AudioViewController.h
  55. +0 −46 FastPdfKit.embeddedframework/FastPdfKit.framework/Versions/A/Headers/BookmarkViewController.h
  56. +0 −23 ...PdfKit.embeddedframework/FastPdfKit.framework/Versions/A/Headers/BookmarkViewControllerDelegate.h
  57. +0 −24 FastPdfKit.embeddedframework/FastPdfKit.framework/Versions/A/Headers/FPKAnnotation.h
  58. +0 −42 FastPdfKit.embeddedframework/FastPdfKit.framework/Versions/A/Headers/FPKGlyphBox.h
  59. +0 −37 FastPdfKit.embeddedframework/FastPdfKit.framework/Versions/A/Headers/FPKOverlayViewDataSource.h
  60. +0 −20 FastPdfKit.embeddedframework/FastPdfKit.framework/Versions/A/Headers/FPKURIAnnotation.h
  61. +0 −33 FastPdfKit.embeddedframework/FastPdfKit.framework/Versions/A/Headers/FastPdfKit.h
  62. +0 −6 FastPdfKit.embeddedframework/FastPdfKit.framework/Versions/A/Headers/FastPdfKitFramework-Prefix.pch
  63. +0 −27 FastPdfKit.embeddedframework/FastPdfKit.framework/Versions/A/Headers/MFAudioPlayerViewImpl.h
  64. +0 −33 FastPdfKit.embeddedframework/FastPdfKit.framework/Versions/A/Headers/MFAudioPlayerViewProtocol.h
  65. +0 −34 FastPdfKit.embeddedframework/FastPdfKit.framework/Versions/A/Headers/MFAudioProvider.h
  66. +0 −183 FastPdfKit.embeddedframework/FastPdfKit.framework/Versions/A/Headers/MFDocumentManager.h
  67. +0 −45 FastPdfKit.embeddedframework/FastPdfKit.framework/Versions/A/Headers/MFDocumentOverlayDataSource.h
  68. +0 −476 FastPdfKit.embeddedframework/FastPdfKit.framework/Versions/A/Headers/MFDocumentViewController.h
  69. +0 −126 ...fKit.embeddedframework/FastPdfKit.framework/Versions/A/Headers/MFDocumentViewControllerDelegate.h
  70. +0 −19 FastPdfKit.embeddedframework/FastPdfKit.framework/Versions/A/Headers/MFOverlayDrawable.h
  71. +0 −19 FastPdfKit.embeddedframework/FastPdfKit.framework/Versions/A/Headers/MFOverlayTouchable.h
  72. +0 −46 FastPdfKit.embeddedframework/FastPdfKit.framework/Versions/A/Headers/MFPDFOutlineEntry.h
  73. +0 −24 FastPdfKit.embeddedframework/FastPdfKit.framework/Versions/A/Headers/MFPDFOutlineRemoteEntry.h
  74. +0 −65 FastPdfKit.embeddedframework/FastPdfKit.framework/Versions/A/Headers/MFTextItem.h
  75. +0 −55 FastPdfKit.embeddedframework/FastPdfKit.framework/Versions/A/Headers/MiniSearchView.h
  76. +0 −19 ...fKit.embeddedframework/FastPdfKit.framework/Versions/A/Headers/MiniSearchViewControllerDelegate.h
  77. +0 −32 FastPdfKit.embeddedframework/FastPdfKit.framework/Versions/A/Headers/NotificationFactory.h
  78. +0 −28 FastPdfKit.embeddedframework/FastPdfKit.framework/Versions/A/Headers/OutlineViewController.h
  79. +0 −23 FastPdfKit.embeddedframework/FastPdfKit.framework/Versions/A/Headers/OutlineViewControllerDelegate.h
  80. +0 −160 FastPdfKit.embeddedframework/FastPdfKit.framework/Versions/A/Headers/ReaderViewController.h
  81. +0 −52 FastPdfKit.embeddedframework/FastPdfKit.framework/Versions/A/Headers/SearchManager.h
  82. +0 −30 FastPdfKit.embeddedframework/FastPdfKit.framework/Versions/A/Headers/SearchResultCellView.h
  83. +0 −16 FastPdfKit.embeddedframework/FastPdfKit.framework/Versions/A/Headers/SearchResultDataSource.h
  84. +0 −31 FastPdfKit.embeddedframework/FastPdfKit.framework/Versions/A/Headers/SearchResultView.h
  85. +0 −45 FastPdfKit.embeddedframework/FastPdfKit.framework/Versions/A/Headers/SearchViewController.h
  86. +0 −24 FastPdfKit.embeddedframework/FastPdfKit.framework/Versions/A/Headers/SearchViewControllerDelegate.h
  87. +0 −291 FastPdfKit.embeddedframework/FastPdfKit.framework/Versions/A/Headers/Stuff.h
  88. +0 −34 FastPdfKit.embeddedframework/FastPdfKit.framework/Versions/A/Headers/TextDisplayViewController.h
  89. +0 −19 ...Kit.embeddedframework/FastPdfKit.framework/Versions/A/Headers/TextDisplayViewControllerDelegate.h
  90. +0 −27 FastPdfKit.embeddedframework/FastPdfKit.framework/Versions/A/Headers/TextSearchOperation.h
  91. +0 −29 FastPdfKit.embeddedframework/FastPdfKit.framework/Versions/A/Headers/WebBrowser.h
  92. +0 −52 FastPdfKit.embeddedframework/FastPdfKit.framework/Versions/A/Headers/mfprofile.h
  93. BIN ...ramework/FastPdfKit.framework/Versions/A/Resources/FPKReaderBundle.bundle/AudioViewController.nib
  94. BIN ...beddedframework/FastPdfKit.framework/Versions/A/Resources/FPKReaderBundle.bundle/BookmarkView.nib
  95. BIN ...mbeddedframework/FastPdfKit.framework/Versions/A/Resources/FPKReaderBundle.bundle/Default-Pad.png
  96. BIN ...it.embeddedframework/FastPdfKit.framework/Versions/A/Resources/FPKReaderBundle.bundle/Default.png
  97. BIN ...embeddedframework/FastPdfKit.framework/Versions/A/Resources/FPKReaderBundle.bundle/Default@2x.png
  98. BIN ...Kit.embeddedframework/FastPdfKit.framework/Versions/A/Resources/FPKReaderBundle.bundle/Info.plist
  99. BIN ...mbeddedframework/FastPdfKit.framework/Versions/A/Resources/FPKReaderBundle.bundle/OutlineView.nib
  100. BIN ...ramework/FastPdfKit.framework/Versions/A/Resources/FPKReaderBundle.bundle/ReaderBundle-Info.plist
  101. BIN ...dedframework/FastPdfKit.framework/Versions/A/Resources/FPKReaderBundle.bundle/SearchView2_pad.nib
  102. BIN ...dframework/FastPdfKit.framework/Versions/A/Resources/FPKReaderBundle.bundle/SearchView2_phone.nib
  103. BIN ...dedframework/FastPdfKit.framework/Versions/A/Resources/FPKReaderBundle.bundle/TextDisplayView.nib
  104. BIN ...embeddedframework/FastPdfKit.framework/Versions/A/Resources/FPKReaderBundle.bundle/WebBrowser.nib
  105. BIN FastPdfKit.embeddedframework/FastPdfKit.framework/Versions/A/Resources/FPKReaderBundle.bundle/X.png
  106. BIN ...dfKit.embeddedframework/FastPdfKit.framework/Versions/A/Resources/FPKReaderBundle.bundle/X@2x.png
  107. BIN ...it.embeddedframework/FastPdfKit.framework/Versions/A/Resources/FPKReaderBundle.bundle/X_phone.png
  108. BIN ...embeddedframework/FastPdfKit.framework/Versions/A/Resources/FPKReaderBundle.bundle/X_phone@2x.png
  109. BIN ...mbeddedframework/FastPdfKit.framework/Versions/A/Resources/FPKReaderBundle.bundle/blackslider.png
  110. BIN ...beddedframework/FastPdfKit.framework/Versions/A/Resources/FPKReaderBundle.bundle/bookmark_add.png
  111. BIN ...dedframework/FastPdfKit.framework/Versions/A/Resources/FPKReaderBundle.bundle/bookmark_add@2x.png
  112. BIN ...framework/FastPdfKit.framework/Versions/A/Resources/FPKReaderBundle.bundle/bookmark_add_phone.png
  113. BIN ...mework/FastPdfKit.framework/Versions/A/Resources/FPKReaderBundle.bundle/bookmark_add_phone@2x.png
  114. BIN ...edframework/FastPdfKit.framework/Versions/A/Resources/FPKReaderBundle.bundle/changeModeDouble.png
  115. BIN ...ramework/FastPdfKit.framework/Versions/A/Resources/FPKReaderBundle.bundle/changeModeDouble@2x.png
  116. BIN ...ework/FastPdfKit.framework/Versions/A/Resources/FPKReaderBundle.bundle/changeModeDouble_phone.png
  117. BIN ...rk/FastPdfKit.framework/Versions/A/Resources/FPKReaderBundle.bundle/changeModeDouble_phone@2x.png
  118. BIN ...framework/FastPdfKit.framework/Versions/A/Resources/FPKReaderBundle.bundle/changeModeOverflow.png
  119. BIN ...mework/FastPdfKit.framework/Versions/A/Resources/FPKReaderBundle.bundle/changeModeOverflow@2x.png
  120. BIN ...edframework/FastPdfKit.framework/Versions/A/Resources/FPKReaderBundle.bundle/changeModeSingle.png
  121. BIN ...ramework/FastPdfKit.framework/Versions/A/Resources/FPKReaderBundle.bundle/changeModeSingle@2x.png
  122. BIN ...ework/FastPdfKit.framework/Versions/A/Resources/FPKReaderBundle.bundle/changeModeSingle_phone.png
  123. BIN ...rk/FastPdfKit.framework/Versions/A/Resources/FPKReaderBundle.bundle/changeModeSingle_phone@2x.png
  124. BIN ...fKit.embeddedframework/FastPdfKit.framework/Versions/A/Resources/FPKReaderBundle.bundle/close.png
  125. BIN ...beddedframework/FastPdfKit.framework/Versions/A/Resources/FPKReaderBundle.bundle/close_player.png
  126. BIN ...eddedframework/FastPdfKit.framework/Versions/A/Resources/FPKReaderBundle.bundle/direction_l2r.png
  127. BIN ...edframework/FastPdfKit.framework/Versions/A/Resources/FPKReaderBundle.bundle/direction_l2r@2x.png
  128. BIN ...ramework/FastPdfKit.framework/Versions/A/Resources/FPKReaderBundle.bundle/direction_l2r_phone.png
  129. BIN ...ework/FastPdfKit.framework/Versions/A/Resources/FPKReaderBundle.bundle/direction_l2r_phone@2x.png
  130. BIN ...eddedframework/FastPdfKit.framework/Versions/A/Resources/FPKReaderBundle.bundle/direction_r2l.png
  131. BIN ...edframework/FastPdfKit.framework/Versions/A/Resources/FPKReaderBundle.bundle/direction_r2l@2x.png
  132. BIN ...ramework/FastPdfKit.framework/Versions/A/Resources/FPKReaderBundle.bundle/direction_r2l_phone.png
  133. BIN ...ework/FastPdfKit.framework/Versions/A/Resources/FPKReaderBundle.bundle/direction_r2l_phone@2x.png
  134. BIN ...embeddedframework/FastPdfKit.framework/Versions/A/Resources/FPKReaderBundle.bundle/hud_player.png
  135. BIN ...ork/FastPdfKit.framework/Versions/A/Resources/FPKReaderBundle.bundle/img_outline_triangledown.png
  136. BIN ...rk/FastPdfKit.framework/Versions/A/Resources/FPKReaderBundle.bundle/img_outline_triangleright.png
  137. BIN ...beddedframework/FastPdfKit.framework/Versions/A/Resources/FPKReaderBundle.bundle/img_overflow.png
  138. BIN ...dframework/FastPdfKit.framework/Versions/A/Resources/FPKReaderBundle.bundle/img_overflow@2x-1.png
  139. BIN ...dedframework/FastPdfKit.framework/Versions/A/Resources/FPKReaderBundle.bundle/img_overflow@2x.png
  140. BIN ...edframework/FastPdfKit.framework/Versions/A/Resources/FPKReaderBundle.bundle/img_overflow_pad.png
  141. BIN ...framework/FastPdfKit.framework/Versions/A/Resources/FPKReaderBundle.bundle/img_overflow_phone.png
  142. BIN ...mework/FastPdfKit.framework/Versions/A/Resources/FPKReaderBundle.bundle/img_overflow_phone@2x.png
  143. BIN ...Kit.embeddedframework/FastPdfKit.framework/Versions/A/Resources/FPKReaderBundle.bundle/indice.png
  144. BIN ....embeddedframework/FastPdfKit.framework/Versions/A/Resources/FPKReaderBundle.bundle/indice@2x.png
  145. BIN ...beddedframework/FastPdfKit.framework/Versions/A/Resources/FPKReaderBundle.bundle/indice_phone.png
  146. BIN ...dedframework/FastPdfKit.framework/Versions/A/Resources/FPKReaderBundle.bundle/minisearch_back.png
  147. BIN ...dframework/FastPdfKit.framework/Versions/A/Resources/FPKReaderBundle.bundle/minisearch_cancel.png
  148. BIN ...amework/FastPdfKit.framework/Versions/A/Resources/FPKReaderBundle.bundle/minisearch_cancel@2x.png
  149. BIN ...dedframework/FastPdfKit.framework/Versions/A/Resources/FPKReaderBundle.bundle/minisearch_full.png
  150. BIN ...framework/FastPdfKit.framework/Versions/A/Resources/FPKReaderBundle.bundle/minisearch_full@2x.png
  151. BIN ...dedframework/FastPdfKit.framework/Versions/A/Resources/FPKReaderBundle.bundle/minisearch_next.png
  152. BIN ...framework/FastPdfKit.framework/Versions/A/Resources/FPKReaderBundle.bundle/minisearch_next@2x.png
  153. BIN ...dedframework/FastPdfKit.framework/Versions/A/Resources/FPKReaderBundle.bundle/minisearch_prev.png
  154. BIN ...framework/FastPdfKit.framework/Versions/A/Resources/FPKReaderBundle.bundle/minisearch_prev@2x.png
  155. BIN ...dfKit.embeddedframework/FastPdfKit.framework/Versions/A/Resources/FPKReaderBundle.bundle/next.png
  156. BIN ...t.embeddedframework/FastPdfKit.framework/Versions/A/Resources/FPKReaderBundle.bundle/pagelead.png
  157. BIN ...mbeddedframework/FastPdfKit.framework/Versions/A/Resources/FPKReaderBundle.bundle/pagelead@2x.png
  158. BIN ...ddedframework/FastPdfKit.framework/Versions/A/Resources/FPKReaderBundle.bundle/pagelead_click.png
  159. BIN ...amework/FastPdfKit.framework/Versions/A/Resources/FPKReaderBundle.bundle/pagelead_click_phone.png
  160. BIN ...ddedframework/FastPdfKit.framework/Versions/A/Resources/FPKReaderBundle.bundle/pagelead_phone.png
  161. BIN ...dframework/FastPdfKit.framework/Versions/A/Resources/FPKReaderBundle.bundle/pagelead_phone@2x.png
  162. BIN ...beddedframework/FastPdfKit.framework/Versions/A/Resources/FPKReaderBundle.bundle/pause_player.png
  163. BIN ...mbeddedframework/FastPdfKit.framework/Versions/A/Resources/FPKReaderBundle.bundle/play_player.png
  164. BIN ...dfKit.embeddedframework/FastPdfKit.framework/Versions/A/Resources/FPKReaderBundle.bundle/prew.png
  165. BIN ...Kit.embeddedframework/FastPdfKit.framework/Versions/A/Resources/FPKReaderBundle.bundle/reload.png
  166. BIN ...Kit.embeddedframework/FastPdfKit.framework/Versions/A/Resources/FPKReaderBundle.bundle/search.png
  167. BIN ....embeddedframework/FastPdfKit.framework/Versions/A/Resources/FPKReaderBundle.bundle/search@2x.png
  168. BIN ...beddedframework/FastPdfKit.framework/Versions/A/Resources/FPKReaderBundle.bundle/search_phone.png
  169. BIN ...dedframework/FastPdfKit.framework/Versions/A/Resources/FPKReaderBundle.bundle/search_phone@2x.png
  170. BIN ...dfKit.embeddedframework/FastPdfKit.framework/Versions/A/Resources/FPKReaderBundle.bundle/stop.png
  171. BIN ...dfKit.embeddedframework/FastPdfKit.framework/Versions/A/Resources/FPKReaderBundle.bundle/text.png
  172. BIN ...it.embeddedframework/FastPdfKit.framework/Versions/A/Resources/FPKReaderBundle.bundle/text@2x.png
  173. BIN ...embeddedframework/FastPdfKit.framework/Versions/A/Resources/FPKReaderBundle.bundle/text_phone.png
  174. BIN ...eddedframework/FastPdfKit.framework/Versions/A/Resources/FPKReaderBundle.bundle/text_phone@2x.png
  175. BIN ...t.embeddedframework/FastPdfKit.framework/Versions/A/Resources/FPKReaderBundle.bundle/zoomLock.png
  176. BIN ...mbeddedframework/FastPdfKit.framework/Versions/A/Resources/FPKReaderBundle.bundle/zoomLock@2x.png
  177. BIN ...ddedframework/FastPdfKit.framework/Versions/A/Resources/FPKReaderBundle.bundle/zoomLock_phone.png
  178. BIN ...dframework/FastPdfKit.framework/Versions/A/Resources/FPKReaderBundle.bundle/zoomLock_phone@2x.png
  179. BIN ...embeddedframework/FastPdfKit.framework/Versions/A/Resources/FPKReaderBundle.bundle/zoomUnlock.png
  180. BIN ...eddedframework/FastPdfKit.framework/Versions/A/Resources/FPKReaderBundle.bundle/zoomUnlock@2x.png
  181. BIN ...edframework/FastPdfKit.framework/Versions/A/Resources/FPKReaderBundle.bundle/zoomUnlock_phone.png
  182. BIN ...ramework/FastPdfKit.framework/Versions/A/Resources/FPKReaderBundle.bundle/zoomUnlock_phone@2x.png
  183. +0 −1 FastPdfKit.embeddedframework/FastPdfKit.framework/Versions/A/Resources/FastPdfKitFramework.xcconfig
  184. BIN FastPdfKit.embeddedframework/FastPdfKit.framework/Versions/A/Resources/Info.plist
  185. +0 −61 FastPdfKit.embeddedframework/FastPdfKit.framework/Versions/A/Resources/Snippets.txt
  186. +0 −1 FastPdfKit.embeddedframework/FastPdfKit.framework/Versions/Current
  187. +0 −1 FastPdfKit.embeddedframework/Resources/FPKReaderBundle.bundle
  188. +0 −1 FastPdfKit.embeddedframework/Resources/FastPdfKitFramework.xcconfig
  189. +0 −1 FastPdfKit.embeddedframework/Resources/Snippets.txt
  190. +16 −1 FastPdfKit.xcodeproj/project.pbxproj
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Diff not rendered.
Diff not rendered.
Diff not rendered.
Diff not rendered.
Diff not rendered.
Diff not rendered.
Diff not rendered.
Diff not rendered.
Diff not rendered.
Diff not rendered.
Diff not rendered.
Diff not rendered.
@@ -0,0 +1,42 @@
+//
+// ASIDataCompressor.h
+// Part of ASIHTTPRequest -> http://allseeing-i.com/ASIHTTPRequest
+//
+// Created by Ben Copsey on 17/08/2010.
+// Copyright 2010 All-Seeing Interactive. All rights reserved.
+//
+
+// This is a helper class used by ASIHTTPRequest to handle deflating (compressing) data in memory and on disk
+// You may also find it helpful if you need to deflate data and files yourself - see the class methods below
+// Most of the zlib stuff is based on the sample code by Mark Adler available at http://zlib.net
+
+#import <Foundation/Foundation.h>
+#import <zlib.h>
+
+@interface ASIDataCompressor : NSObject {
+ BOOL streamReady;
+ z_stream zStream;
+}
+
+// Convenience constructor will call setupStream for you
++ (id)compressor;
+
+// Compress the passed chunk of data
+// Passing YES for shouldFinish will finalize the deflated data - you must pass YES when you are on the last chunk of data
+- (NSData *)compressBytes:(Bytef *)bytes length:(NSUInteger)length error:(NSError **)err shouldFinish:(BOOL)shouldFinish;
+
+// Convenience method - pass it some data, and you'll get deflated data back
++ (NSData *)compressData:(NSData*)uncompressedData error:(NSError **)err;
+
+// Convenience method - pass it a file containing the data to compress in sourcePath, and it will write deflated data to destinationPath
++ (BOOL)compressDataFromFile:(NSString *)sourcePath toFile:(NSString *)destinationPath error:(NSError **)err;
+
+// Sets up zlib to handle the inflating. You only need to call this yourself if you aren't using the convenience constructor 'compressor'
+- (NSError *)setupStream;
+
+// Tells zlib to clean up. You need to call this if you need to cancel deflating part way through
+// If deflating finishes or fails, this method will be called automatically
+- (NSError *)closeStream;
+
+@property (assign, readonly) BOOL streamReady;
+@end
@@ -0,0 +1,219 @@
+//
+// ASIDataCompressor.m
+// Part of ASIHTTPRequest -> http://allseeing-i.com/ASIHTTPRequest
+//
+// Created by Ben Copsey on 17/08/2010.
+// Copyright 2010 All-Seeing Interactive. All rights reserved.
+//
+
+#import "ASIDataCompressor.h"
+#import "ASIHTTPRequest.h"
+
+#define DATA_CHUNK_SIZE 262144 // Deal with gzipped data in 256KB chunks
+#define COMPRESSION_AMOUNT Z_DEFAULT_COMPRESSION
+
+@interface ASIDataCompressor ()
++ (NSError *)deflateErrorWithCode:(int)code;
+@end
+
+@implementation ASIDataCompressor
+
++ (id)compressor
+{
+ ASIDataCompressor *compressor = [[[self alloc] init] autorelease];
+ [compressor setupStream];
+ return compressor;
+}
+
+- (void)dealloc
+{
+ if (streamReady) {
+ [self closeStream];
+ }
+ [super dealloc];
+}
+
+- (NSError *)setupStream
+{
+ if (streamReady) {
+ return nil;
+ }
+ // Setup the inflate stream
+ zStream.zalloc = Z_NULL;
+ zStream.zfree = Z_NULL;
+ zStream.opaque = Z_NULL;
+ zStream.avail_in = 0;
+ zStream.next_in = 0;
+ int status = deflateInit2(&zStream, COMPRESSION_AMOUNT, Z_DEFLATED, (15+16), 8, Z_DEFAULT_STRATEGY);
+ if (status != Z_OK) {
+ return [[self class] deflateErrorWithCode:status];
+ }
+ streamReady = YES;
+ return nil;
+}
+
+- (NSError *)closeStream
+{
+ if (!streamReady) {
+ return nil;
+ }
+ // Close the deflate stream
+ streamReady = NO;
+ int status = deflateEnd(&zStream);
+ if (status != Z_OK) {
+ return [[self class] deflateErrorWithCode:status];
+ }
+ return nil;
+}
+
+- (NSData *)compressBytes:(Bytef *)bytes length:(NSUInteger)length error:(NSError **)err shouldFinish:(BOOL)shouldFinish
+{
+ if (length == 0) return nil;
+
+ NSUInteger halfLength = length/2;
+
+ // We'll take a guess that the compressed data will fit in half the size of the original (ie the max to compress at once is half DATA_CHUNK_SIZE), if not, we'll increase it below
+ NSMutableData *outputData = [NSMutableData dataWithLength:length/2];
+
+ int status;
+
+ zStream.next_in = bytes;
+ zStream.avail_in = (unsigned int)length;
+ zStream.avail_out = 0;
+
+ NSInteger bytesProcessedAlready = zStream.total_out;
+ while (zStream.avail_out == 0) {
+
+ if (zStream.total_out-bytesProcessedAlready >= [outputData length]) {
+ [outputData increaseLengthBy:halfLength];
+ }
+
+ zStream.next_out = (Bytef*)[outputData mutableBytes] + zStream.total_out-bytesProcessedAlready;
+ zStream.avail_out = (unsigned int)([outputData length] - (zStream.total_out-bytesProcessedAlready));
+ status = deflate(&zStream, shouldFinish ? Z_FINISH : Z_NO_FLUSH);
+
+ if (status == Z_STREAM_END) {
+ break;
+ } else if (status != Z_OK) {
+ if (err) {
+ *err = [[self class] deflateErrorWithCode:status];
+ }
+ return NO;
+ }
+ }
+
+ // Set real length
+ [outputData setLength: zStream.total_out-bytesProcessedAlready];
+ return outputData;
+}
+
+
++ (NSData *)compressData:(NSData*)uncompressedData error:(NSError **)err
+{
+ NSError *theError = nil;
+ NSData *outputData = [[ASIDataCompressor compressor] compressBytes:(Bytef *)[uncompressedData bytes] length:[uncompressedData length] error:&theError shouldFinish:YES];
+ if (theError) {
+ if (err) {
+ *err = theError;
+ }
+ return nil;
+ }
+ return outputData;
+}
+
+
+
++ (BOOL)compressDataFromFile:(NSString *)sourcePath toFile:(NSString *)destinationPath error:(NSError **)err
+{
+ NSFileManager *fileManager = [[[NSFileManager alloc] init] autorelease];
+
+ // Create an empty file at the destination path
+ if (![fileManager createFileAtPath:destinationPath contents:[NSData data] attributes:nil]) {
+ if (err) {
+ *err = [NSError errorWithDomain:NetworkRequestErrorDomain code:ASICompressionError userInfo:[NSDictionary dictionaryWithObjectsAndKeys:[NSString stringWithFormat:@"Compression of %@ failed because we were to create a file at %@",sourcePath,destinationPath],NSLocalizedDescriptionKey,nil]];
+ }
+ return NO;
+ }
+
+ // Ensure the source file exists
+ if (![fileManager fileExistsAtPath:sourcePath]) {
+ if (err) {
+ *err = [NSError errorWithDomain:NetworkRequestErrorDomain code:ASICompressionError userInfo:[NSDictionary dictionaryWithObjectsAndKeys:[NSString stringWithFormat:@"Compression of %@ failed the file does not exist",sourcePath],NSLocalizedDescriptionKey,nil]];
+ }
+ return NO;
+ }
+
+ UInt8 inputData[DATA_CHUNK_SIZE];
+ NSData *outputData;
+ NSInteger readLength;
+ NSError *theError = nil;
+
+ ASIDataCompressor *compressor = [ASIDataCompressor compressor];
+
+ NSInputStream *inputStream = [NSInputStream inputStreamWithFileAtPath:sourcePath];
+ [inputStream open];
+ NSOutputStream *outputStream = [NSOutputStream outputStreamToFileAtPath:destinationPath append:NO];
+ [outputStream open];
+
+ while ([compressor streamReady]) {
+
+ // Read some data from the file
+ readLength = [inputStream read:inputData maxLength:DATA_CHUNK_SIZE];
+
+ // Make sure nothing went wrong
+ if ([inputStream streamStatus] == NSStreamEventErrorOccurred) {
+ if (err) {
+ *err = [NSError errorWithDomain:NetworkRequestErrorDomain code:ASICompressionError userInfo:[NSDictionary dictionaryWithObjectsAndKeys:[NSString stringWithFormat:@"Compression of %@ failed because we were unable to read from the source data file",sourcePath],NSLocalizedDescriptionKey,[inputStream streamError],NSUnderlyingErrorKey,nil]];
+ }
+ [compressor closeStream];
+ return NO;
+ }
+ // Have we reached the end of the input data?
+ if (!readLength) {
+ break;
+ }
+
+ // Attempt to deflate the chunk of data
+ outputData = [compressor compressBytes:inputData length:readLength error:&theError shouldFinish:readLength < DATA_CHUNK_SIZE ];
+ if (theError) {
+ if (err) {
+ *err = theError;
+ }
+ [compressor closeStream];
+ return NO;
+ }
+
+ // Write the deflated data out to the destination file
+ [outputStream write:(const uint8_t *)[outputData bytes] maxLength:[outputData length]];
+
+ // Make sure nothing went wrong
+ if ([inputStream streamStatus] == NSStreamEventErrorOccurred) {
+ if (err) {
+ *err = [NSError errorWithDomain:NetworkRequestErrorDomain code:ASICompressionError userInfo:[NSDictionary dictionaryWithObjectsAndKeys:[NSString stringWithFormat:@"Compression of %@ failed because we were unable to write to the destination data file at %@",sourcePath,destinationPath],NSLocalizedDescriptionKey,[outputStream streamError],NSUnderlyingErrorKey,nil]];
+ }
+ [compressor closeStream];
+ return NO;
+ }
+
+ }
+ [inputStream close];
+ [outputStream close];
+
+ NSError *error = [compressor closeStream];
+ if (error) {
+ if (err) {
+ *err = error;
+ }
+ return NO;
+ }
+
+ return YES;
+}
+
++ (NSError *)deflateErrorWithCode:(int)code
+{
+ return [NSError errorWithDomain:NetworkRequestErrorDomain code:ASICompressionError userInfo:[NSDictionary dictionaryWithObjectsAndKeys:[NSString stringWithFormat:@"Compression of data failed with code %hi",code],NSLocalizedDescriptionKey,nil]];
+}
+
+@synthesize streamReady;
+@end
@@ -0,0 +1,41 @@
+//
+// ASIDataDecompressor.h
+// Part of ASIHTTPRequest -> http://allseeing-i.com/ASIHTTPRequest
+//
+// Created by Ben Copsey on 17/08/2010.
+// Copyright 2010 All-Seeing Interactive. All rights reserved.
+//
+
+// This is a helper class used by ASIHTTPRequest to handle inflating (decompressing) data in memory and on disk
+// You may also find it helpful if you need to inflate data and files yourself - see the class methods below
+// Most of the zlib stuff is based on the sample code by Mark Adler available at http://zlib.net
+
+#import <Foundation/Foundation.h>
+#import <zlib.h>
+
+@interface ASIDataDecompressor : NSObject {
+ BOOL streamReady;
+ z_stream zStream;
+}
+
+// Convenience constructor will call setupStream for you
++ (id)decompressor;
+
+// Uncompress the passed chunk of data
+- (NSData *)uncompressBytes:(Bytef *)bytes length:(NSUInteger)length error:(NSError **)err;
+
+// Convenience method - pass it some deflated data, and you'll get inflated data back
++ (NSData *)uncompressData:(NSData*)compressedData error:(NSError **)err;
+
+// Convenience method - pass it a file containing deflated data in sourcePath, and it will write inflated data to destinationPath
++ (BOOL)uncompressDataFromFile:(NSString *)sourcePath toFile:(NSString *)destinationPath error:(NSError **)err;
+
+// Sets up zlib to handle the inflating. You only need to call this yourself if you aren't using the convenience constructor 'decompressor'
+- (NSError *)setupStream;
+
+// Tells zlib to clean up. You need to call this if you need to cancel inflating part way through
+// If inflating finishes or fails, this method will be called automatically
+- (NSError *)closeStream;
+
+@property (assign, readonly) BOOL streamReady;
+@end
Oops, something went wrong.

0 comments on commit 9981525

Please sign in to comment.