Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse code

version 0.0.1

  • Loading branch information...
commit 9f87935324e6cd1ace4580a3294d8075d133cdae 1 parent 43a1461
Adilet Abylov authored April 25, 2012

Showing 33 changed files with 3,020 additions and 91 deletions. Show diff stats Hide diff stats

  1. 1  RootController.xib
  2. 126  Tili.xcodeproj/project.pbxproj
  3. BIN  Tili.xcodeproj/project.xcworkspace/xcuserdata/adiletabylov.xcuserdatad/UserInterfaceState.xcuserstate
  4. 212  Tili.xcodeproj/xcuserdata/adiletabylov.xcuserdatad/xcdebugger/Breakpoints.xcbkptlist
  5. 72  Tili/CDataScanner.h
  6. 343  Tili/CDataScanner.m
  7. 25  Tili/Experimental/CFilteringJSONSerializer.h
  8. 86  Tili/Experimental/CFilteringJSONSerializer.m
  9. 34  Tili/Experimental/CJSONSerialization.h
  10. 59  Tili/Experimental/CJSONSerialization.m
  11. 25  Tili/Experimental/CJSONSerializedData.h
  12. 34  Tili/Experimental/CJSONSerializedData.m
  13. 40  Tili/Extensions/CDataScanner_Extensions.h
  14. 135  Tili/Extensions/CDataScanner_Extensions.m
  15. 37  Tili/Extensions/NSDictionary_JSONExtensions.h
  16. 47  Tili/Extensions/NSDictionary_JSONExtensions.m
  17. 61  Tili/JSON/CJSONDeserializer.h
  18. 154  Tili/JSON/CJSONDeserializer.m
  19. 91  Tili/JSON/CJSONScanner.h
  20. 620  Tili/JSON/CJSONScanner.m
  21. 63  Tili/JSON/CJSONSerializer.h
  22. 363  Tili/JSON/CJSONSerializer.m
  23. 18  Tili/JSON/JSONRepresentation.h
  24. 15  Tili/ResultViewController.h
  25. 20  Tili/{TestViewController.m → ResultViewController.m}
  26. 97  Tili/{TestViewController.xib → ResultViewController.xib}
  27. 21  Tili/ResultsListViewController.h
  28. 148  Tili/ResultsListViewController.m
  29. 141  Tili/ResultsListViewController.xib
  30. 5  Tili/SearchViewController.m
  31. 14  Tili/TestViewController.h
  32. 2  Tili/ru.lproj/InfoPlist.strings
  33. 2  TiliTests/ru.lproj/InfoPlist.strings
1  RootController.xib
@@ -42,7 +42,6 @@
42 42
 					<int key="IBUIInterfaceOrientation">1</int>
43 43
 					<int key="interfaceOrientation">1</int>
44 44
 				</object>
45  
-				<bool key="IBUIDefinesPresentationContext">YES</bool>
46 45
 				<string key="targetRuntimeIdentifier">IBCocoaTouchFramework</string>
47 46
 				<bool key="IBUIHorizontal">NO</bool>
48 47
 				<object class="IBUINavigationBar" key="IBUINavigationBar" id="612374833">
126  Tili.xcodeproj/project.pbxproj
@@ -25,8 +25,19 @@
25 25
 		600E2981153E9D5A000ED18E /* RootController.xib in Resources */ = {isa = PBXBuildFile; fileRef = 600E297F153E9D5A000ED18E /* RootController.xib */; };
26 26
 		600E2985153E9EE3000ED18E /* SearchViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = 600E2983153E9EE3000ED18E /* SearchViewController.m */; };
27 27
 		600E2986153E9EE3000ED18E /* SearchViewController.xib in Resources */ = {isa = PBXBuildFile; fileRef = 600E2984153E9EE3000ED18E /* SearchViewController.xib */; };
28  
-		60978F5C153FD63E003D789B /* TestViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = 60978F5A153FD63E003D789B /* TestViewController.m */; };
29  
-		60978F5D153FD63E003D789B /* TestViewController.xib in Resources */ = {isa = PBXBuildFile; fileRef = 60978F5B153FD63E003D789B /* TestViewController.xib */; };
  28
+		605169C51546BE82002E3789 /* ResultViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = 605169C31546BE82002E3789 /* ResultViewController.m */; };
  29
+		605169C61546BE82002E3789 /* ResultViewController.xib in Resources */ = {isa = PBXBuildFile; fileRef = 605169C41546BE82002E3789 /* ResultViewController.xib */; };
  30
+		60978F5C153FD63E003D789B /* ResultsListViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = 60978F5A153FD63E003D789B /* ResultsListViewController.m */; };
  31
+		60978F5D153FD63E003D789B /* ResultsListViewController.xib in Resources */ = {isa = PBXBuildFile; fileRef = 60978F5B153FD63E003D789B /* ResultsListViewController.xib */; };
  32
+		60E6E6671540208500B9E8AE /* CDataScanner.m in Sources */ = {isa = PBXBuildFile; fileRef = 60E6E6521540208500B9E8AE /* CDataScanner.m */; };
  33
+		60E6E6681540208500B9E8AE /* CFilteringJSONSerializer.m in Sources */ = {isa = PBXBuildFile; fileRef = 60E6E6551540208500B9E8AE /* CFilteringJSONSerializer.m */; };
  34
+		60E6E6691540208500B9E8AE /* CJSONSerialization.m in Sources */ = {isa = PBXBuildFile; fileRef = 60E6E6571540208500B9E8AE /* CJSONSerialization.m */; };
  35
+		60E6E66A1540208500B9E8AE /* CJSONSerializedData.m in Sources */ = {isa = PBXBuildFile; fileRef = 60E6E6591540208500B9E8AE /* CJSONSerializedData.m */; };
  36
+		60E6E66B1540208500B9E8AE /* CDataScanner_Extensions.m in Sources */ = {isa = PBXBuildFile; fileRef = 60E6E65C1540208500B9E8AE /* CDataScanner_Extensions.m */; };
  37
+		60E6E66C1540208500B9E8AE /* NSDictionary_JSONExtensions.m in Sources */ = {isa = PBXBuildFile; fileRef = 60E6E65E1540208500B9E8AE /* NSDictionary_JSONExtensions.m */; };
  38
+		60E6E66D1540208500B9E8AE /* CJSONDeserializer.m in Sources */ = {isa = PBXBuildFile; fileRef = 60E6E6611540208500B9E8AE /* CJSONDeserializer.m */; };
  39
+		60E6E66E1540208500B9E8AE /* CJSONScanner.m in Sources */ = {isa = PBXBuildFile; fileRef = 60E6E6631540208500B9E8AE /* CJSONScanner.m */; };
  40
+		60E6E66F1540208500B9E8AE /* CJSONSerializer.m in Sources */ = {isa = PBXBuildFile; fileRef = 60E6E6651540208500B9E8AE /* CJSONSerializer.m */; };
30 41
 /* End PBXBuildFile section */
31 42
 
32 43
 /* Begin PBXContainerItemProxy section */
@@ -64,9 +75,33 @@
64 75
 		600E2982153E9EE3000ED18E /* SearchViewController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SearchViewController.h; sourceTree = "<group>"; };
65 76
 		600E2983153E9EE3000ED18E /* SearchViewController.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = SearchViewController.m; sourceTree = "<group>"; };
66 77
 		600E2984153E9EE3000ED18E /* SearchViewController.xib */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = file.xib; path = SearchViewController.xib; sourceTree = "<group>"; };
67  
-		60978F59153FD63E003D789B /* TestViewController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = TestViewController.h; sourceTree = "<group>"; };
68  
-		60978F5A153FD63E003D789B /* TestViewController.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = TestViewController.m; sourceTree = "<group>"; };
69  
-		60978F5B153FD63E003D789B /* TestViewController.xib */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = file.xib; path = TestViewController.xib; sourceTree = "<group>"; };
  78
+		604C7ACE154527D200B779BA /* ru */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = ru; path = /Users/adiletabylov/projects/XCode/Tili/Tili/ru.lproj/InfoPlist.strings; sourceTree = "<absolute>"; };
  79
+		604C7AD0154527D200B779BA /* ru */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = ru; path = /Users/adiletabylov/projects/XCode/Tili/TiliTests/ru.lproj/InfoPlist.strings; sourceTree = "<absolute>"; };
  80
+		605169C21546BE82002E3789 /* ResultViewController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ResultViewController.h; sourceTree = "<group>"; };
  81
+		605169C31546BE82002E3789 /* ResultViewController.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = ResultViewController.m; sourceTree = "<group>"; };
  82
+		605169C41546BE82002E3789 /* ResultViewController.xib */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = file.xib; path = ResultViewController.xib; sourceTree = "<group>"; };
  83
+		60978F59153FD63E003D789B /* ResultsListViewController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ResultsListViewController.h; sourceTree = "<group>"; };
  84
+		60978F5A153FD63E003D789B /* ResultsListViewController.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = ResultsListViewController.m; sourceTree = "<group>"; };
  85
+		60978F5B153FD63E003D789B /* ResultsListViewController.xib */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = file.xib; path = ResultsListViewController.xib; sourceTree = "<group>"; };
  86
+		60E6E6511540208500B9E8AE /* CDataScanner.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = CDataScanner.h; sourceTree = "<group>"; };
  87
+		60E6E6521540208500B9E8AE /* CDataScanner.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = CDataScanner.m; sourceTree = "<group>"; };
  88
+		60E6E6541540208500B9E8AE /* CFilteringJSONSerializer.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = CFilteringJSONSerializer.h; sourceTree = "<group>"; };
  89
+		60E6E6551540208500B9E8AE /* CFilteringJSONSerializer.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = CFilteringJSONSerializer.m; sourceTree = "<group>"; };
  90
+		60E6E6561540208500B9E8AE /* CJSONSerialization.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = CJSONSerialization.h; sourceTree = "<group>"; };
  91
+		60E6E6571540208500B9E8AE /* CJSONSerialization.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = CJSONSerialization.m; sourceTree = "<group>"; };
  92
+		60E6E6581540208500B9E8AE /* CJSONSerializedData.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = CJSONSerializedData.h; sourceTree = "<group>"; };
  93
+		60E6E6591540208500B9E8AE /* CJSONSerializedData.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = CJSONSerializedData.m; sourceTree = "<group>"; };
  94
+		60E6E65B1540208500B9E8AE /* CDataScanner_Extensions.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = CDataScanner_Extensions.h; sourceTree = "<group>"; };
  95
+		60E6E65C1540208500B9E8AE /* CDataScanner_Extensions.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = CDataScanner_Extensions.m; sourceTree = "<group>"; };
  96
+		60E6E65D1540208500B9E8AE /* NSDictionary_JSONExtensions.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = NSDictionary_JSONExtensions.h; sourceTree = "<group>"; };
  97
+		60E6E65E1540208500B9E8AE /* NSDictionary_JSONExtensions.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = NSDictionary_JSONExtensions.m; sourceTree = "<group>"; };
  98
+		60E6E6601540208500B9E8AE /* CJSONDeserializer.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = CJSONDeserializer.h; sourceTree = "<group>"; };
  99
+		60E6E6611540208500B9E8AE /* CJSONDeserializer.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = CJSONDeserializer.m; sourceTree = "<group>"; };
  100
+		60E6E6621540208500B9E8AE /* CJSONScanner.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = CJSONScanner.h; sourceTree = "<group>"; };
  101
+		60E6E6631540208500B9E8AE /* CJSONScanner.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = CJSONScanner.m; sourceTree = "<group>"; };
  102
+		60E6E6641540208500B9E8AE /* CJSONSerializer.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = CJSONSerializer.h; sourceTree = "<group>"; };
  103
+		60E6E6651540208500B9E8AE /* CJSONSerializer.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = CJSONSerializer.m; sourceTree = "<group>"; };
  104
+		60E6E6661540208500B9E8AE /* JSONRepresentation.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = JSONRepresentation.h; sourceTree = "<group>"; };
70 105
 /* End PBXFileReference section */
71 106
 
72 107
 /* Begin PBXFrameworksBuildPhase section */
@@ -129,6 +164,7 @@
129 164
 		600E2950153E9CDF000ED18E /* Tili */ = {
130 165
 			isa = PBXGroup;
131 166
 			children = (
  167
+				60E6E6501540207000B9E8AE /* JSON */,
132 168
 				600E297D153E9D5A000ED18E /* RootController.h */,
133 169
 				600E297E153E9D5A000ED18E /* RootController.m */,
134 170
 				600E297F153E9D5A000ED18E /* RootController.xib */,
@@ -177,13 +213,66 @@
177 213
 				600E2982153E9EE3000ED18E /* SearchViewController.h */,
178 214
 				600E2983153E9EE3000ED18E /* SearchViewController.m */,
179 215
 				600E2984153E9EE3000ED18E /* SearchViewController.xib */,
180  
-				60978F59153FD63E003D789B /* TestViewController.h */,
181  
-				60978F5A153FD63E003D789B /* TestViewController.m */,
182  
-				60978F5B153FD63E003D789B /* TestViewController.xib */,
  216
+				60978F59153FD63E003D789B /* ResultsListViewController.h */,
  217
+				60978F5A153FD63E003D789B /* ResultsListViewController.m */,
  218
+				60978F5B153FD63E003D789B /* ResultsListViewController.xib */,
  219
+				605169C21546BE82002E3789 /* ResultViewController.h */,
  220
+				605169C31546BE82002E3789 /* ResultViewController.m */,
  221
+				605169C41546BE82002E3789 /* ResultViewController.xib */,
183 222
 			);
184 223
 			name = views;
185 224
 			sourceTree = "<group>";
186 225
 		};
  226
+		60E6E6501540207000B9E8AE /* JSON */ = {
  227
+			isa = PBXGroup;
  228
+			children = (
  229
+				60E6E6511540208500B9E8AE /* CDataScanner.h */,
  230
+				60E6E6521540208500B9E8AE /* CDataScanner.m */,
  231
+				60E6E6531540208500B9E8AE /* Experimental */,
  232
+				60E6E65A1540208500B9E8AE /* Extensions */,
  233
+				60E6E65F1540208500B9E8AE /* JSON */,
  234
+			);
  235
+			name = JSON;
  236
+			sourceTree = "<group>";
  237
+		};
  238
+		60E6E6531540208500B9E8AE /* Experimental */ = {
  239
+			isa = PBXGroup;
  240
+			children = (
  241
+				60E6E6541540208500B9E8AE /* CFilteringJSONSerializer.h */,
  242
+				60E6E6551540208500B9E8AE /* CFilteringJSONSerializer.m */,
  243
+				60E6E6561540208500B9E8AE /* CJSONSerialization.h */,
  244
+				60E6E6571540208500B9E8AE /* CJSONSerialization.m */,
  245
+				60E6E6581540208500B9E8AE /* CJSONSerializedData.h */,
  246
+				60E6E6591540208500B9E8AE /* CJSONSerializedData.m */,
  247
+			);
  248
+			path = Experimental;
  249
+			sourceTree = "<group>";
  250
+		};
  251
+		60E6E65A1540208500B9E8AE /* Extensions */ = {
  252
+			isa = PBXGroup;
  253
+			children = (
  254
+				60E6E65B1540208500B9E8AE /* CDataScanner_Extensions.h */,
  255
+				60E6E65C1540208500B9E8AE /* CDataScanner_Extensions.m */,
  256
+				60E6E65D1540208500B9E8AE /* NSDictionary_JSONExtensions.h */,
  257
+				60E6E65E1540208500B9E8AE /* NSDictionary_JSONExtensions.m */,
  258
+			);
  259
+			path = Extensions;
  260
+			sourceTree = "<group>";
  261
+		};
  262
+		60E6E65F1540208500B9E8AE /* JSON */ = {
  263
+			isa = PBXGroup;
  264
+			children = (
  265
+				60E6E6601540208500B9E8AE /* CJSONDeserializer.h */,
  266
+				60E6E6611540208500B9E8AE /* CJSONDeserializer.m */,
  267
+				60E6E6621540208500B9E8AE /* CJSONScanner.h */,
  268
+				60E6E6631540208500B9E8AE /* CJSONScanner.m */,
  269
+				60E6E6641540208500B9E8AE /* CJSONSerializer.h */,
  270
+				60E6E6651540208500B9E8AE /* CJSONSerializer.m */,
  271
+				60E6E6661540208500B9E8AE /* JSONRepresentation.h */,
  272
+			);
  273
+			path = JSON;
  274
+			sourceTree = "<group>";
  275
+		};
187 276
 /* End PBXGroup section */
188 277
 
189 278
 /* Begin PBXNativeTarget section */
@@ -258,7 +347,8 @@
258 347
 				600E2955153E9CDF000ED18E /* InfoPlist.strings in Resources */,
259 348
 				600E2981153E9D5A000ED18E /* RootController.xib in Resources */,
260 349
 				600E2986153E9EE3000ED18E /* SearchViewController.xib in Resources */,
261  
-				60978F5D153FD63E003D789B /* TestViewController.xib in Resources */,
  350
+				60978F5D153FD63E003D789B /* ResultsListViewController.xib in Resources */,
  351
+				605169C61546BE82002E3789 /* ResultViewController.xib in Resources */,
262 352
 			);
263 353
 			runOnlyForDeploymentPostprocessing = 0;
264 354
 		};
@@ -298,7 +388,17 @@
298 388
 				600E295E153E9CDF000ED18E /* Tili.xcdatamodeld in Sources */,
299 389
 				600E2980153E9D5A000ED18E /* RootController.m in Sources */,
300 390
 				600E2985153E9EE3000ED18E /* SearchViewController.m in Sources */,
301  
-				60978F5C153FD63E003D789B /* TestViewController.m in Sources */,
  391
+				60978F5C153FD63E003D789B /* ResultsListViewController.m in Sources */,
  392
+				60E6E6671540208500B9E8AE /* CDataScanner.m in Sources */,
  393
+				60E6E6681540208500B9E8AE /* CFilteringJSONSerializer.m in Sources */,
  394
+				60E6E6691540208500B9E8AE /* CJSONSerialization.m in Sources */,
  395
+				60E6E66A1540208500B9E8AE /* CJSONSerializedData.m in Sources */,
  396
+				60E6E66B1540208500B9E8AE /* CDataScanner_Extensions.m in Sources */,
  397
+				60E6E66C1540208500B9E8AE /* NSDictionary_JSONExtensions.m in Sources */,
  398
+				60E6E66D1540208500B9E8AE /* CJSONDeserializer.m in Sources */,
  399
+				60E6E66E1540208500B9E8AE /* CJSONScanner.m in Sources */,
  400
+				60E6E66F1540208500B9E8AE /* CJSONSerializer.m in Sources */,
  401
+				605169C51546BE82002E3789 /* ResultViewController.m in Sources */,
302 402
 			);
303 403
 			runOnlyForDeploymentPostprocessing = 0;
304 404
 		};
@@ -325,6 +425,7 @@
325 425
 			isa = PBXVariantGroup;
326 426
 			children = (
327 427
 				600E2954153E9CDF000ED18E /* en */,
  428
+				604C7ACE154527D200B779BA /* ru */,
328 429
 			);
329 430
 			name = InfoPlist.strings;
330 431
 			sourceTree = "<group>";
@@ -333,6 +434,7 @@
333 434
 			isa = PBXVariantGroup;
334 435
 			children = (
335 436
 				600E2970153E9CDF000ED18E /* en */,
  437
+				604C7AD0154527D200B779BA /* ru */,
336 438
 			);
337 439
 			name = InfoPlist.strings;
338 440
 			sourceTree = "<group>";
@@ -360,7 +462,7 @@
360 462
 				GCC_WARN_ABOUT_MISSING_PROTOTYPES = YES;
361 463
 				GCC_WARN_ABOUT_RETURN_TYPE = YES;
362 464
 				GCC_WARN_UNUSED_VARIABLE = YES;
363  
-				IPHONEOS_DEPLOYMENT_TARGET = 5.0;
  465
+				IPHONEOS_DEPLOYMENT_TARGET = 3.1;
364 466
 				SDKROOT = iphoneos;
365 467
 			};
366 468
 			name = Debug;
@@ -378,7 +480,7 @@
378 480
 				GCC_WARN_ABOUT_MISSING_PROTOTYPES = YES;
379 481
 				GCC_WARN_ABOUT_RETURN_TYPE = YES;
380 482
 				GCC_WARN_UNUSED_VARIABLE = YES;
381  
-				IPHONEOS_DEPLOYMENT_TARGET = 5.0;
  483
+				IPHONEOS_DEPLOYMENT_TARGET = 3.1;
382 484
 				OTHER_CFLAGS = "-DNS_BLOCK_ASSERTIONS=1";
383 485
 				SDKROOT = iphoneos;
384 486
 				VALIDATE_PRODUCT = YES;
BIN  Tili.xcodeproj/project.xcworkspace/xcuserdata/adiletabylov.xcuserdatad/UserInterfaceState.xcuserstate
Binary file not shown
212  Tili.xcodeproj/xcuserdata/adiletabylov.xcuserdatad/xcdebugger/Breakpoints.xcbkptlist
@@ -9,11 +9,11 @@
9 9
          continueAfterRunningActions = "No"
10 10
          isPathRelative = "1"
11 11
          filePath = "Tili/SearchViewController.m"
12  
-         timestampString = "356426789.837538"
  12
+         timestampString = "356508212.407528"
13 13
          startingColumnNumber = "9223372036854775807"
14 14
          endingColumnNumber = "9223372036854775807"
15  
-         startingLineNumber = "60"
16  
-         endingLineNumber = "60"
  15
+         startingLineNumber = "61"
  16
+         endingLineNumber = "61"
17 17
          landmarkName = "-clickY:"
18 18
          landmarkType = "5">
19 19
       </FileBreakpoint>
@@ -23,11 +23,11 @@
23 23
          continueAfterRunningActions = "No"
24 24
          isPathRelative = "1"
25 25
          filePath = "Tili/SearchViewController.m"
26  
-         timestampString = "356426984.602581"
  26
+         timestampString = "356508212.407528"
27 27
          startingColumnNumber = "9223372036854775807"
28 28
          endingColumnNumber = "9223372036854775807"
29  
-         startingLineNumber = "55"
30  
-         endingLineNumber = "55"
  29
+         startingLineNumber = "56"
  30
+         endingLineNumber = "56"
31 31
          landmarkName = "-clickO:"
32 32
          landmarkType = "5">
33 33
       </FileBreakpoint>
@@ -37,11 +37,11 @@
37 37
          continueAfterRunningActions = "No"
38 38
          isPathRelative = "1"
39 39
          filePath = "Tili/SearchViewController.m"
40  
-         timestampString = "356426987.51529"
  40
+         timestampString = "356508212.407528"
41 41
          startingColumnNumber = "9223372036854775807"
42 42
          endingColumnNumber = "9223372036854775807"
43  
-         startingLineNumber = "65"
44  
-         endingLineNumber = "65"
  43
+         startingLineNumber = "66"
  44
+         endingLineNumber = "66"
45 45
          landmarkName = "-clickN:"
46 46
          landmarkType = "5">
47 47
       </FileBreakpoint>
@@ -51,11 +51,11 @@
51 51
          continueAfterRunningActions = "No"
52 52
          isPathRelative = "1"
53 53
          filePath = "Tili/SearchViewController.m"
54  
-         timestampString = "356505827.219953"
  54
+         timestampString = "356508212.407528"
55 55
          startingColumnNumber = "9223372036854775807"
56 56
          endingColumnNumber = "9223372036854775807"
57  
-         startingLineNumber = "72"
58  
-         endingLineNumber = "72"
  57
+         startingLineNumber = "73"
  58
+         endingLineNumber = "73"
59 59
          landmarkName = "-startSearch:"
60 60
          landmarkType = "5">
61 61
       </FileBreakpoint>
@@ -65,13 +65,195 @@
65 65
          continueAfterRunningActions = "No"
66 66
          isPathRelative = "1"
67 67
          filePath = "Tili/SearchViewController.m"
68  
-         timestampString = "356504598.742225"
  68
+         timestampString = "356508212.407528"
69 69
          startingColumnNumber = "9223372036854775807"
70 70
          endingColumnNumber = "9223372036854775807"
71  
-         startingLineNumber = "15"
72  
-         endingLineNumber = "15"
  71
+         startingLineNumber = "16"
  72
+         endingLineNumber = "16"
73 73
          landmarkName = "-initWithNibName:bundle:"
74 74
          landmarkType = "5">
75 75
       </FileBreakpoint>
  76
+      <FileBreakpoint
  77
+         shouldBeEnabled = "No"
  78
+         ignoreCount = "0"
  79
+         continueAfterRunningActions = "No"
  80
+         isPathRelative = "1"
  81
+         filePath = "Tili/ResultsListViewController.m"
  82
+         timestampString = "356953792.584519"
  83
+         startingColumnNumber = "9223372036854775807"
  84
+         endingColumnNumber = "9223372036854775807"
  85
+         startingLineNumber = "16"
  86
+         endingLineNumber = "16"
  87
+         landmarkName = "resultArray"
  88
+         landmarkType = "19">
  89
+      </FileBreakpoint>
  90
+      <FileBreakpoint
  91
+         shouldBeEnabled = "No"
  92
+         ignoreCount = "0"
  93
+         continueAfterRunningActions = "No"
  94
+         isPathRelative = "1"
  95
+         filePath = "Tili/ResultsListViewController.m"
  96
+         timestampString = "356955756.053852"
  97
+         startingColumnNumber = "9223372036854775807"
  98
+         endingColumnNumber = "9223372036854775807"
  99
+         startingLineNumber = "58"
  100
+         endingLineNumber = "58"
  101
+         landmarkName = "-parseData"
  102
+         landmarkType = "5">
  103
+      </FileBreakpoint>
  104
+      <FileBreakpoint
  105
+         shouldBeEnabled = "No"
  106
+         ignoreCount = "0"
  107
+         continueAfterRunningActions = "No"
  108
+         isPathRelative = "1"
  109
+         filePath = "Tili/ResultsListViewController.m"
  110
+         timestampString = "356955756.053852"
  111
+         startingColumnNumber = "9223372036854775807"
  112
+         endingColumnNumber = "9223372036854775807"
  113
+         startingLineNumber = "66"
  114
+         endingLineNumber = "66"
  115
+         landmarkName = "-connection:didReceiveResponse:"
  116
+         landmarkType = "5">
  117
+      </FileBreakpoint>
  118
+      <FileBreakpoint
  119
+         shouldBeEnabled = "No"
  120
+         ignoreCount = "0"
  121
+         continueAfterRunningActions = "No"
  122
+         isPathRelative = "1"
  123
+         filePath = "Tili/ResultsListViewController.m"
  124
+         timestampString = "356520657.741115"
  125
+         startingColumnNumber = "9223372036854775807"
  126
+         endingColumnNumber = "9223372036854775807"
  127
+         startingLineNumber = "12"
  128
+         endingLineNumber = "12"
  129
+         landmarkName = "@implementation ResultsListViewController"
  130
+         landmarkType = "3">
  131
+      </FileBreakpoint>
  132
+      <FileBreakpoint
  133
+         shouldBeEnabled = "No"
  134
+         ignoreCount = "0"
  135
+         continueAfterRunningActions = "No"
  136
+         isPathRelative = "1"
  137
+         filePath = "Tili/ResultsListViewController.m"
  138
+         timestampString = "356955756.053852"
  139
+         startingColumnNumber = "9223372036854775807"
  140
+         endingColumnNumber = "9223372036854775807"
  141
+         startingLineNumber = "49"
  142
+         endingLineNumber = "49"
  143
+         landmarkName = "-makeRequest"
  144
+         landmarkType = "5">
  145
+      </FileBreakpoint>
  146
+      <FileBreakpoint
  147
+         shouldBeEnabled = "No"
  148
+         ignoreCount = "0"
  149
+         continueAfterRunningActions = "No"
  150
+         isPathRelative = "1"
  151
+         filePath = "Tili/ResultsListViewController.m"
  152
+         timestampString = "356955756.053852"
  153
+         startingColumnNumber = "9223372036854775807"
  154
+         endingColumnNumber = "9223372036854775807"
  155
+         startingLineNumber = "70"
  156
+         endingLineNumber = "70"
  157
+         landmarkName = "-connection:didReceiveData:"
  158
+         landmarkType = "5">
  159
+      </FileBreakpoint>
  160
+      <FileBreakpoint
  161
+         shouldBeEnabled = "No"
  162
+         ignoreCount = "0"
  163
+         continueAfterRunningActions = "No"
  164
+         isPathRelative = "1"
  165
+         filePath = "Tili/ResultsListViewController.m"
  166
+         timestampString = "356955756.053852"
  167
+         startingColumnNumber = "9223372036854775807"
  168
+         endingColumnNumber = "9223372036854775807"
  169
+         startingLineNumber = "75"
  170
+         endingLineNumber = "75"
  171
+         landmarkName = "-connection:didFailWithError:"
  172
+         landmarkType = "5">
  173
+      </FileBreakpoint>
  174
+      <FileBreakpoint
  175
+         shouldBeEnabled = "No"
  176
+         ignoreCount = "0"
  177
+         continueAfterRunningActions = "No"
  178
+         isPathRelative = "1"
  179
+         filePath = "Tili/ResultsListViewController.m"
  180
+         timestampString = "356955756.053852"
  181
+         startingColumnNumber = "9223372036854775807"
  182
+         endingColumnNumber = "9223372036854775807"
  183
+         startingLineNumber = "80"
  184
+         endingLineNumber = "80"
  185
+         landmarkName = "-connectionDidFinishLoading:"
  186
+         landmarkType = "5">
  187
+      </FileBreakpoint>
  188
+      <FileBreakpoint
  189
+         shouldBeEnabled = "No"
  190
+         ignoreCount = "0"
  191
+         continueAfterRunningActions = "No"
  192
+         isPathRelative = "1"
  193
+         filePath = "Tili/ResultsListViewController.m"
  194
+         timestampString = "356955756.053852"
  195
+         startingColumnNumber = "9223372036854775807"
  196
+         endingColumnNumber = "9223372036854775807"
  197
+         startingLineNumber = "79"
  198
+         endingLineNumber = "79"
  199
+         landmarkName = "-connectionDidFinishLoading:"
  200
+         landmarkType = "5">
  201
+      </FileBreakpoint>
  202
+      <FileBreakpoint
  203
+         shouldBeEnabled = "No"
  204
+         ignoreCount = "0"
  205
+         continueAfterRunningActions = "No"
  206
+         isPathRelative = "1"
  207
+         filePath = "Tili/ResultsListViewController.m"
  208
+         timestampString = "356955756.053852"
  209
+         startingColumnNumber = "9223372036854775807"
  210
+         endingColumnNumber = "9223372036854775807"
  211
+         startingLineNumber = "59"
  212
+         endingLineNumber = "59"
  213
+         landmarkName = "-parseData"
  214
+         landmarkType = "5">
  215
+      </FileBreakpoint>
  216
+      <FileBreakpoint
  217
+         shouldBeEnabled = "No"
  218
+         ignoreCount = "0"
  219
+         continueAfterRunningActions = "No"
  220
+         isPathRelative = "1"
  221
+         filePath = "Tili/ResultsListViewController.m"
  222
+         timestampString = "356956572.859096"
  223
+         startingColumnNumber = "9223372036854775807"
  224
+         endingColumnNumber = "9223372036854775807"
  225
+         startingLineNumber = "108"
  226
+         endingLineNumber = "108"
  227
+         landmarkName = "-tableView:cellForRowAtIndexPath:"
  228
+         landmarkType = "5">
  229
+      </FileBreakpoint>
  230
+      <FileBreakpoint
  231
+         shouldBeEnabled = "No"
  232
+         ignoreCount = "0"
  233
+         continueAfterRunningActions = "No"
  234
+         isPathRelative = "1"
  235
+         filePath = "Tili/ResultsListViewController.m"
  236
+         timestampString = "356958902.353406"
  237
+         startingColumnNumber = "9223372036854775807"
  238
+         endingColumnNumber = "9223372036854775807"
  239
+         startingLineNumber = "115"
  240
+         endingLineNumber = "115"
  241
+         landmarkName = "-tableView:heightForRowAtIndexPath:"
  242
+         landmarkType = "5">
  243
+      </FileBreakpoint>
  244
+      <FileBreakpoint
  245
+         shouldBeEnabled = "No"
  246
+         ignoreCount = "0"
  247
+         continueAfterRunningActions = "No"
  248
+         isPathRelative = "1"
  249
+         filePath = "Tili/ResultViewController.m"
  250
+         timestampString = "356960194.059087"
  251
+         startingColumnNumber = "9223372036854775807"
  252
+         endingColumnNumber = "9223372036854775807"
  253
+         startingLineNumber = "38"
  254
+         endingLineNumber = "38"
  255
+         landmarkName = "-viewDidLoad"
  256
+         landmarkType = "5">
  257
+      </FileBreakpoint>
76 258
    </FileBreakpoints>
77 259
 </Bucket>
72  Tili/CDataScanner.h
... ...
@@ -0,0 +1,72 @@
  1
+//
  2
+//  CDataScanner.h
  3
+//  TouchCode
  4
+//
  5
+//  Created by Jonathan Wight on 04/16/08.
  6
+//  Copyright 2008 toxicsoftware.com. All rights reserved.
  7
+//
  8
+//  Permission is hereby granted, free of charge, to any person
  9
+//  obtaining a copy of this software and associated documentation
  10
+//  files (the "Software"), to deal in the Software without
  11
+//  restriction, including without limitation the rights to use,
  12
+//  copy, modify, merge, publish, distribute, sublicense, and/or sell
  13
+//  copies of the Software, and to permit persons to whom the
  14
+//  Software is furnished to do so, subject to the following
  15
+//  conditions:
  16
+//
  17
+//  The above copyright notice and this permission notice shall be
  18
+//  included in all copies or substantial portions of the Software.
  19
+//
  20
+//  THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
  21
+//  EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES
  22
+//  OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
  23
+//  NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
  24
+//  HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
  25
+//  WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
  26
+//  FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
  27
+//  OTHER DEALINGS IN THE SOFTWARE.
  28
+//
  29
+
  30
+#import <Foundation/Foundation.h>
  31
+
  32
+// NSScanner
  33
+
  34
+@interface CDataScanner : NSObject {
  35
+	NSData *data;
  36
+
  37
+	u_int8_t *start;
  38
+	u_int8_t *end;
  39
+	u_int8_t *current;
  40
+	NSUInteger length;
  41
+}
  42
+
  43
+@property (readwrite, nonatomic, strong) NSData *data;
  44
+@property (readwrite, nonatomic, assign) NSUInteger scanLocation;
  45
+@property (readonly, nonatomic, assign) NSUInteger bytesRemaining;
  46
+@property (readonly, nonatomic, assign) BOOL isAtEnd;
  47
+
  48
+- (id)initWithData:(NSData *)inData;
  49
+
  50
+- (unichar)currentCharacter;
  51
+- (unichar)scanCharacter;
  52
+- (BOOL)scanCharacter:(unichar)inCharacter;
  53
+
  54
+- (BOOL)scanUTF8String:(const char *)inString intoString:(NSString **)outValue;
  55
+- (BOOL)scanString:(NSString *)inString intoString:(NSString **)outValue;
  56
+- (BOOL)scanCharactersFromSet:(NSCharacterSet *)inSet intoString:(NSString **)outValue; // inSet must only contain 7-bit ASCII characters
  57
+
  58
+- (BOOL)scanUpToString:(NSString *)string intoString:(NSString **)outValue;
  59
+- (BOOL)scanUpToCharactersFromSet:(NSCharacterSet *)set intoString:(NSString **)outValue; // inSet must only contain 7-bit ASCII characters
  60
+
  61
+- (BOOL)scanNumber:(NSNumber **)outValue;
  62
+- (BOOL)scanDecimalNumber:(NSDecimalNumber **)outValue;
  63
+
  64
+- (BOOL)scanDataOfLength:(NSUInteger)inLength intoPointer:(void **)outPointer;
  65
+- (BOOL)scanDataOfLength:(NSUInteger)inLength intoData:(NSData **)outData;
  66
+
  67
+- (void)skipWhitespace;
  68
+
  69
+- (NSString *)remainingString;
  70
+- (NSData *)remainingData;
  71
+
  72
+@end
343  Tili/CDataScanner.m
... ...
@@ -0,0 +1,343 @@
  1
+//
  2
+//  CDataScanner.m
  3
+//  TouchCode
  4
+//
  5
+//  Created by Jonathan Wight on 04/16/08.
  6
+//  Copyright 2008 toxicsoftware.com. All rights reserved.
  7
+//
  8
+//  Permission is hereby granted, free of charge, to any person
  9
+//  obtaining a copy of this software and associated documentation
  10
+//  files (the "Software"), to deal in the Software without
  11
+//  restriction, including without limitation the rights to use,
  12
+//  copy, modify, merge, publish, distribute, sublicense, and/or sell
  13
+//  copies of the Software, and to permit persons to whom the
  14
+//  Software is furnished to do so, subject to the following
  15
+//  conditions:
  16
+//
  17
+//  The above copyright notice and this permission notice shall be
  18
+//  included in all copies or substantial portions of the Software.
  19
+//
  20
+//  THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
  21
+//  EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES
  22
+//  OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
  23
+//  NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
  24
+//  HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
  25
+//  WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
  26
+//  FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
  27
+//  OTHER DEALINGS IN THE SOFTWARE.
  28
+//
  29
+
  30
+#import "CDataScanner.h"
  31
+
  32
+@interface CDataScanner ()
  33
+@end
  34
+
  35
+#pragma mark -
  36
+
  37
+inline static unichar CharacterAtPointer(void *start)
  38
+    {
  39
+    const u_int8_t theByte = *(u_int8_t *)start;
  40
+    if (theByte & 0x80)
  41
+        {
  42
+        // TODO -- UNICODE!!!! (well in theory nothing todo here)
  43
+        }
  44
+    const unichar theCharacter = theByte;
  45
+    return(theCharacter);
  46
+    }
  47
+
  48
+static NSCharacterSet *sDoubleCharacters = NULL;
  49
+
  50
+@implementation CDataScanner
  51
+
  52
++ (void)initialize
  53
+    {
  54
+    if (sDoubleCharacters == NULL)
  55
+        {
  56
+        sDoubleCharacters = [NSCharacterSet characterSetWithCharactersInString:@"0123456789eE-+."];
  57
+        }
  58
+    }
  59
+
  60
+- (id)init
  61
+    {
  62
+    if ((self = [super init]) != NULL)
  63
+        {
  64
+        }
  65
+    return(self);
  66
+    }
  67
+
  68
+- (id)initWithData:(NSData *)inData;
  69
+    {
  70
+    if ((self = [self init]) != NULL)
  71
+        {
  72
+        [self setData:inData];
  73
+        }
  74
+    return(self);
  75
+    }
  76
+
  77
+- (NSUInteger)scanLocation
  78
+    {
  79
+    return(current - start);
  80
+    }
  81
+
  82
+- (NSUInteger)bytesRemaining
  83
+    {
  84
+    return(end - current);
  85
+    }
  86
+
  87
+- (NSData *)data
  88
+    {
  89
+    return(data);
  90
+    }
  91
+
  92
+- (void)setData:(NSData *)inData
  93
+    {
  94
+    if (data != inData)
  95
+        {
  96
+        data = inData;
  97
+        }
  98
+
  99
+    if (data)
  100
+        {
  101
+        start = (u_int8_t *)data.bytes;
  102
+        end = start + data.length;
  103
+        current = start;
  104
+        length = data.length;
  105
+        }
  106
+    else
  107
+        {
  108
+        start = NULL;
  109
+        end = NULL;
  110
+        current = NULL;
  111
+        length = 0;
  112
+        }
  113
+    }
  114
+
  115
+- (void)setScanLocation:(NSUInteger)inScanLocation
  116
+    {
  117
+    current = start + inScanLocation;
  118
+    }
  119
+
  120
+- (BOOL)isAtEnd
  121
+    {
  122
+    return(self.scanLocation >= length);
  123
+    }
  124
+
  125
+- (unichar)currentCharacter
  126
+    {
  127
+    return(CharacterAtPointer(current));
  128
+    }
  129
+
  130
+#pragma mark -
  131
+
  132
+- (unichar)scanCharacter
  133
+    {
  134
+    const unichar theCharacter = CharacterAtPointer(current++);
  135
+    return(theCharacter);
  136
+    }
  137
+
  138
+- (BOOL)scanCharacter:(unichar)inCharacter
  139
+    {
  140
+    unichar theCharacter = CharacterAtPointer(current);
  141
+    if (theCharacter == inCharacter)
  142
+        {
  143
+        ++current;
  144
+        return(YES);
  145
+        }
  146
+    else
  147
+        return(NO);
  148
+    }
  149
+
  150
+- (BOOL)scanUTF8String:(const char *)inString intoString:(NSString **)outValue
  151
+    {
  152
+    const size_t theLength = strlen(inString);
  153
+    if ((size_t)(end - current) < theLength)
  154
+        return(NO);
  155
+    if (strncmp((char *)current, inString, theLength) == 0)
  156
+        {
  157
+        current += theLength;
  158
+        if (outValue)
  159
+            *outValue = [NSString stringWithUTF8String:inString];
  160
+        return(YES);
  161
+        }
  162
+    return(NO);
  163
+    }
  164
+
  165
+- (BOOL)scanString:(NSString *)inString intoString:(NSString **)outValue
  166
+    {
  167
+    if ((size_t)(end - current) < inString.length)
  168
+        return(NO);
  169
+    if (strncmp((char *)current, [inString UTF8String], inString.length) == 0)
  170
+        {
  171
+        current += inString.length;
  172
+        if (outValue)
  173
+            *outValue = inString;
  174
+        return(YES);
  175
+        }
  176
+    return(NO);
  177
+    }
  178
+
  179
+- (BOOL)scanCharactersFromSet:(NSCharacterSet *)inSet intoString:(NSString **)outValue
  180
+    {
  181
+    u_int8_t *P;
  182
+    for (P = current; P < end && [inSet characterIsMember:*P] == YES; ++P)
  183
+        ;
  184
+
  185
+    if (P == current)
  186
+        {
  187
+        return(NO);
  188
+        }
  189
+
  190
+    if (outValue)
  191
+        {
  192
+        *outValue = [[NSString alloc] initWithBytes:current length:P - current encoding:NSUTF8StringEncoding];
  193
+        }
  194
+
  195
+    current = P;
  196
+
  197
+    return(YES);
  198
+    }
  199
+
  200
+- (BOOL)scanUpToString:(NSString *)inString intoString:(NSString **)outValue
  201
+    {
  202
+    const char *theToken = [inString UTF8String];
  203
+    const char *theResult = strnstr((char *)current, theToken, end - current);
  204
+    if (theResult == NULL)
  205
+        {
  206
+        return(NO);
  207
+        }
  208
+
  209
+    if (outValue)
  210
+        {
  211
+        *outValue = [[NSString alloc] initWithBytes:current length:theResult - (char *)current encoding:NSUTF8StringEncoding];
  212
+        }
  213
+
  214
+    current = (u_int8_t *)theResult;
  215
+
  216
+    return(YES);
  217
+    }
  218
+
  219
+- (BOOL)scanUpToCharactersFromSet:(NSCharacterSet *)inSet intoString:(NSString **)outValue
  220
+    {
  221
+    u_int8_t *P;
  222
+    for (P = current; P < end && [inSet characterIsMember:*P] == NO; ++P)
  223
+        ;
  224
+
  225
+    if (P == current)
  226
+        {
  227
+        return(NO);
  228
+        }
  229
+
  230
+    if (outValue)
  231
+        {
  232
+        *outValue = [[NSString alloc] initWithBytes:current length:P - current encoding:NSUTF8StringEncoding];
  233
+        }
  234
+
  235
+    current = P;
  236
+
  237
+    return(YES);
  238
+    }
  239
+
  240
+- (BOOL)scanNumber:(NSNumber **)outValue
  241
+        {
  242
+        NSString *theString = NULL;
  243
+        if ([self scanCharactersFromSet:sDoubleCharacters intoString:&theString])
  244
+            {
  245
+            if ([theString rangeOfString:@"."].location != NSNotFound)
  246
+                {
  247
+                if (outValue)
  248
+                    {
  249
+                    *outValue = [NSDecimalNumber decimalNumberWithString:theString];
  250
+                    }
  251
+                return(YES);
  252
+                }
  253
+            else if ([theString rangeOfString:@"-"].location != NSNotFound)
  254
+                {
  255
+                if (outValue != NULL)
  256
+                    {
  257
+                    *outValue = [NSNumber numberWithLongLong:[theString longLongValue]];
  258
+                    }
  259
+                return(YES);
  260
+                }
  261
+            else
  262
+                {
  263
+                if (outValue != NULL)
  264
+                    {
  265
+                    *outValue = [NSNumber numberWithUnsignedLongLong:strtoull([theString UTF8String], NULL, 0)];
  266
+                    }
  267
+                return(YES);
  268
+                }
  269
+            
  270
+            }
  271
+        return(NO);
  272
+        }
  273
+            
  274
+- (BOOL)scanDecimalNumber:(NSDecimalNumber **)outValue;
  275
+        {
  276
+        NSString *theString = NULL;
  277
+        if ([self scanCharactersFromSet:sDoubleCharacters intoString:&theString])
  278
+            {
  279
+            if (outValue)
  280
+                {
  281
+                *outValue = [NSDecimalNumber decimalNumberWithString:theString];
  282
+                }
  283
+            return(YES);
  284
+            }
  285
+        return(NO);
  286
+        }
  287
+
  288
+- (BOOL)scanDataOfLength:(NSUInteger)inLength intoPointer:(void **)outPointer
  289
+    {
  290
+        if (self.bytesRemaining < inLength)
  291
+            {
  292
+            return(NO);
  293
+            }
  294
+        
  295
+        if (outPointer)
  296
+            {
  297
+            *outPointer = current;
  298
+            }
  299
+
  300
+        current += inLength;
  301
+        return(YES);
  302
+    }
  303
+
  304
+- (BOOL)scanDataOfLength:(NSUInteger)inLength intoData:(NSData **)outData;
  305
+        {
  306
+        if (self.bytesRemaining < inLength)
  307
+            {
  308
+            return(NO);
  309
+            }
  310
+        
  311
+        if (outData)
  312
+            {
  313
+            *outData = [NSData dataWithBytes:current length:inLength];
  314
+            }
  315
+
  316
+        current += inLength;
  317
+        return(YES);
  318
+        }
  319
+
  320
+
  321
+- (void)skipWhitespace
  322
+    {
  323
+    u_int8_t *P;
  324
+    for (P = current; P < end && (isspace(*P)); ++P)
  325
+        ;
  326
+
  327
+    current = P;
  328
+    }
  329
+
  330
+- (NSString *)remainingString
  331
+    {
  332
+    NSData *theRemainingData = [NSData dataWithBytes:current length:end - current];
  333
+    NSString *theString = [[NSString alloc] initWithData:theRemainingData encoding:NSUTF8StringEncoding];
  334
+    return(theString);
  335
+    }
  336
+
  337
+- (NSData *)remainingData;
  338
+    {
  339
+    NSData *theRemainingData = [NSData dataWithBytes:current length:end - current];
  340
+    return(theRemainingData);
  341
+    }
  342
+
  343
+@end
25  Tili/Experimental/CFilteringJSONSerializer.h
... ...
@@ -0,0 +1,25 @@
  1
+//
  2
+//  CFilteringJSONSerializer.h
  3
+//  TouchJSON
  4
+//
  5
+//  Created by Jonathan Wight on 06/20/10.
  6
+//  Copyright 2010 toxicsoftware.com. All rights reserved.
  7
+//
  8
+
  9
+#import "CJSONSerializer.h"
  10
+
  11
+typedef NSString *(^JSONConversionTest)(id inObject);
  12
+typedef id (^JSONConversionConverter)(id inObject); // TODO replace with value transformers.
  13
+
  14
+@interface CFilteringJSONSerializer : CJSONSerializer {
  15
+	NSSet *tests;
  16
+	NSDictionary *convertersByName;
  17
+}
  18
+
  19
+@property (readwrite, nonatomic, strong) NSSet *tests;
  20
+@property (readwrite, nonatomic, strong) NSDictionary *convertersByName;
  21
+
  22
+- (void)addTest:(JSONConversionTest)inTest;
  23
+- (void)addConverter:(JSONConversionConverter)inConverter forName:(NSString *)inName;
  24
+
  25
+@end
86  Tili/Experimental/CFilteringJSONSerializer.m
... ...
@@ -0,0 +1,86 @@
  1
+//
  2
+//  CFilteringJSONSerializer.m
  3
+//  TouchJSON
  4
+//
  5
+//  Created by Jonathan Wight on 06/20/10.
  6
+//  Copyright 2010 toxicsoftware.com. All rights reserved.
  7
+//
  8
+
  9
+#import "CFilteringJSONSerializer.h"
  10
+
  11
+@implementation CFilteringJSONSerializer
  12
+
  13
+@synthesize tests;
  14
+@synthesize convertersByName;
  15
+
  16
+- (id)init
  17
+	{
  18
+    if ((self = [super init]) != NULL)
  19
+		{
  20
+        tests = [[NSSet alloc] init];
  21
+        convertersByName = [[NSDictionary alloc] init];
  22
+    	}
  23
+    return(self);
  24
+	}
  25
+
  26
+- (NSData *)serializeObject:(id)inObject error:(NSError **)outError
  27
+    {
  28
+    NSData *theData = NULL;
  29
+    for (JSONConversionTest theTest in self.tests)
  30
+        {
  31
+        NSString *theName = theTest(inObject);
  32
+        if (theName != NULL)
  33
+            {
  34
+            id theObject = NULL;
  35
+            JSONConversionConverter theConverter = [self.convertersByName objectForKey:theName];
  36
+            if (theConverter)
  37
+                {
  38
+                theObject = theConverter(inObject);
  39
+                }
  40
+                
  41
+            if (theObject)
  42
+                {
  43
+                if ([theObject isKindOfClass:[NSData class]])
  44
+                    {
  45
+                    theData = theObject;
  46
+                    break;
  47
+                    }
  48
+                else
  49
+                    {
  50
+                    NSError *theError = NULL;
  51
+                    theData = [super serializeObject:theObject error:&theError];
  52
+                    if (theData != NULL)
  53
+                        {
  54
+                        break;
  55
+                        }
  56
+                    }
  57
+                }
  58
+            }
  59
+        }
  60
+        
  61
+    if (theData == NULL)
  62
+        {
  63
+        theData = [super serializeObject:inObject error:outError];
  64
+        }
  65
+        
  66
+    return(theData);
  67
+    }
  68
+
  69
+- (void)addTest:(JSONConversionTest)inTest
  70
+    {
  71
+    inTest = [inTest copy];
  72
+    NSSet *theTests = [self.tests setByAddingObject:inTest];
  73
+    self.tests = theTests;
  74
+    }
  75
+    
  76
+- (void)addConverter:(JSONConversionConverter)inConverter forName:(NSString *)inName
  77
+    {
  78
+    NSMutableDictionary *theConvertersByName = [self.convertersByName mutableCopy];
  79
+
  80
+    inConverter = [inConverter copy];
  81
+    [theConvertersByName setObject:inConverter forKey:inName];
  82
+    self.convertersByName = theConvertersByName;
  83
+    }
  84
+    
  85
+
  86
+@end
34  Tili/Experimental/CJSONSerialization.h
... ...
@@ -0,0 +1,34 @@
  1
+//
  2
+//  CJSONSerialization.h
  3
+//  TouchJSON
  4
+//
  5
+//  Created by Jonathan Wight on 03/04/11.
  6
+//  Copyright 2011 toxicsoftware.com. All rights reserved.
  7
+//
  8
+
  9
+#import <Foundation/Foundation.h>
  10
+
  11
+enum {
  12
+    kCJSONReadingMutableContainers = 0x1,
  13
+    kCJSONReadingMutableLeaves = 0x2,
  14
+    kCJSONReadingAllowFragments = 0x04,
  15
+};
  16
+typedef NSUInteger EJSONReadingOptions;
  17
+
  18
+enum {
  19
+    kCJJSONWritingPrettyPrinted = 0x1