Permalink
Browse files

Add json-framework

  • Loading branch information...
1 parent 1f4cde4 commit d808322c7ae006faa867ee8868553b30f048a467 @eladb committed Nov 25, 2012
Showing with 7,035 additions and 0 deletions.
  1. +12 −0 ios-client/ext/json-framework/.gitignore
  2. +323 −0 ios-client/ext/json-framework/Changes.md
  3. +10 −0 ios-client/ext/json-framework/Classes/JSON.h
  4. +67 −0 ios-client/ext/json-framework/Classes/NSObject+SBJson.h
  5. +58 −0 ios-client/ext/json-framework/Classes/NSObject+SBJson.m
  6. +84 −0 ios-client/ext/json-framework/Classes/SBJson.h
  7. +107 −0 ios-client/ext/json-framework/Classes/SBJsonParser.h
  8. +104 −0 ios-client/ext/json-framework/Classes/SBJsonParser.m
  9. +167 −0 ios-client/ext/json-framework/Classes/SBJsonStreamParser.h
  10. +246 −0 ios-client/ext/json-framework/Classes/SBJsonStreamParser.m
  11. +40 −0 ios-client/ext/json-framework/Classes/SBJsonStreamParserAccumulator.h
  12. +51 −0 ios-client/ext/json-framework/Classes/SBJsonStreamParserAccumulator.m
  13. +148 −0 ios-client/ext/json-framework/Classes/SBJsonStreamParserAdapter.h
  14. +171 −0 ios-client/ext/json-framework/Classes/SBJsonStreamParserAdapter.m
  15. +81 −0 ios-client/ext/json-framework/Classes/SBJsonStreamParserState.h
  16. +347 −0 ios-client/ext/json-framework/Classes/SBJsonStreamParserState.m
  17. +194 −0 ios-client/ext/json-framework/Classes/SBJsonStreamWriter.h
  18. +375 −0 ios-client/ext/json-framework/Classes/SBJsonStreamWriter.m
  19. +39 −0 ios-client/ext/json-framework/Classes/SBJsonStreamWriterAccumulator.h
  20. +56 −0 ios-client/ext/json-framework/Classes/SBJsonStreamWriterAccumulator.m
  21. +69 −0 ios-client/ext/json-framework/Classes/SBJsonStreamWriterState.h
  22. +139 −0 ios-client/ext/json-framework/Classes/SBJsonStreamWriterState.m
  23. +70 −0 ios-client/ext/json-framework/Classes/SBJsonTokeniser.h
  24. +461 −0 ios-client/ext/json-framework/Classes/SBJsonTokeniser.m
  25. +59 −0 ios-client/ext/json-framework/Classes/SBJsonUTF8Stream.h
  26. +150 −0 ios-client/ext/json-framework/Classes/SBJsonUTF8Stream.m
  27. +115 −0 ios-client/ext/json-framework/Classes/SBJsonWriter.h
  28. +113 −0 ios-client/ext/json-framework/Classes/SBJsonWriter.m
  29. +61 −0 ios-client/ext/json-framework/Credits.md
  30. +68 −0 ios-client/ext/json-framework/InstallDocumentation.sh
  31. +24 −0 ios-client/ext/json-framework/LICENSE
  32. +67 −0 ios-client/ext/json-framework/Readme.md
  33. +6 −0 ios-client/ext/json-framework/ReleaseChecklist.md
  34. +937 −0 ios-client/ext/json-framework/SBJson.xcodeproj/project.pbxproj
  35. +30 −0 ios-client/ext/json-framework/SBJson/SBJson-Info.plist
  36. +7 −0 ios-client/ext/json-framework/SBJson/SBJson-Prefix.pch
  37. +2 −0 ios-client/ext/json-framework/SBJson/en.lproj/InfoPlist.strings
  38. +22 −0 ios-client/ext/json-framework/SBJsonTests/SBJsonTests-Info.plist
  39. +7 −0 ios-client/ext/json-framework/SBJsonTests/SBJsonTests-Prefix.pch
  40. +2 −0 ios-client/ext/json-framework/SBJsonTests/en.lproj/InfoPlist.strings
  41. +1 −0 ios-client/ext/json-framework/Tests/Data/format/basic/input
  42. +16 −0 ios-client/ext/json-framework/Tests/Data/format/basic/output
  43. +1 −0 ios-client/ext/json-framework/Tests/Data/format/json.org/README
  44. +22 −0 ios-client/ext/json-framework/Tests/Data/format/json.org/a/input
  45. +25 −0 ios-client/ext/json-framework/Tests/Data/format/json.org/a/output
  46. +11 −0 ios-client/ext/json-framework/Tests/Data/format/json.org/b/input
  47. +22 −0 ios-client/ext/json-framework/Tests/Data/format/json.org/b/output
  48. +26 −0 ios-client/ext/json-framework/Tests/Data/format/json.org/c/input
  49. +28 −0 ios-client/ext/json-framework/Tests/Data/format/json.org/c/output
  50. +88 −0 ios-client/ext/json-framework/Tests/Data/format/json.org/d/input
  51. +100 −0 ios-client/ext/json-framework/Tests/Data/format/json.org/d/output
  52. +27 −0 ios-client/ext/json-framework/Tests/Data/format/json.org/e/input
  53. +77 −0 ios-client/ext/json-framework/Tests/Data/format/json.org/e/output
  54. +1 −0 ios-client/ext/json-framework/Tests/Data/format/rfc4627/README
  55. +13 −0 ios-client/ext/json-framework/Tests/Data/format/rfc4627/a/input
  56. +18 −0 ios-client/ext/json-framework/Tests/Data/format/rfc4627/a/output
  57. +22 −0 ios-client/ext/json-framework/Tests/Data/format/rfc4627/b/input
  58. +22 −0 ios-client/ext/json-framework/Tests/Data/format/rfc4627/b/output
  59. +1 −0 ios-client/ext/json-framework/Tests/Data/invalid/array/eof-1/error
  60. +1 −0 ios-client/ext/json-framework/Tests/Data/invalid/array/eof-1/input
  61. +1 −0 ios-client/ext/json-framework/Tests/Data/invalid/array/eof-2/error
  62. +1 −0 ios-client/ext/json-framework/Tests/Data/invalid/array/eof-2/input
  63. +1 −0 ios-client/ext/json-framework/Tests/Data/invalid/array/eof-3/error
  64. +1 −0 ios-client/ext/json-framework/Tests/Data/invalid/array/eof-3/input
  65. +1 −0 ios-client/ext/json-framework/Tests/Data/invalid/array/eof-4/error
  66. +1 −0 ios-client/ext/json-framework/Tests/Data/invalid/array/eof-4/input
  67. +1 −0 ios-client/ext/json-framework/Tests/Data/invalid/boolean/false/error
  68. +1 −0 ios-client/ext/json-framework/Tests/Data/invalid/boolean/false/input
  69. +1 −0 ios-client/ext/json-framework/Tests/Data/invalid/boolean/true/error
  70. +1 −0 ios-client/ext/json-framework/Tests/Data/invalid/boolean/true/input
  71. +1 −0 ios-client/ext/json-framework/Tests/Data/invalid/depth/error
  72. +1 −0 ios-client/ext/json-framework/Tests/Data/invalid/depth/input
  73. +1 −0 ios-client/ext/json-framework/Tests/Data/invalid/eof/error
  74. +1 −0 ios-client/ext/json-framework/Tests/Data/invalid/garbage/asterisk/error
  75. +1 −0 ios-client/ext/json-framework/Tests/Data/invalid/garbage/asterisk/input
  76. +1 −0 ios-client/ext/json-framework/Tests/Data/invalid/garbage/single-quote/error
  77. +1 −0 ios-client/ext/json-framework/Tests/Data/invalid/garbage/single-quote/input
  78. +1 −0 ios-client/ext/json-framework/Tests/Data/invalid/null/error
  79. +1 −0 ios-client/ext/json-framework/Tests/Data/invalid/null/input
  80. +1 −0 ios-client/ext/json-framework/Tests/Data/invalid/number/leading-plus/error
  81. +1 −0 ios-client/ext/json-framework/Tests/Data/invalid/number/leading-plus/input
  82. +1 −0 ios-client/ext/json-framework/Tests/Data/invalid/number/leading-zero/error
  83. +1 −0 ios-client/ext/json-framework/Tests/Data/invalid/number/leading-zero/input
  84. +1 −0 ios-client/ext/json-framework/Tests/Data/invalid/number/no-digits-after-decimal/error
  85. +1 −0 ios-client/ext/json-framework/Tests/Data/invalid/number/no-digits-after-decimal/input
  86. +1 −0 ios-client/ext/json-framework/Tests/Data/invalid/number/no-digits-after-exponent-1/error
  87. +1 −0 ios-client/ext/json-framework/Tests/Data/invalid/number/no-digits-after-exponent-1/input
  88. +1 −0 ios-client/ext/json-framework/Tests/Data/invalid/number/no-digits-after-exponent-2/error
  89. +1 −0 ios-client/ext/json-framework/Tests/Data/invalid/number/no-digits-after-exponent-2/input
  90. +1 −0 ios-client/ext/json-framework/Tests/Data/invalid/number/no-digits-after-exponent-3/error
  91. +1 −0 ios-client/ext/json-framework/Tests/Data/invalid/number/no-digits-after-exponent-3/input
  92. +1 −0 ios-client/ext/json-framework/Tests/Data/invalid/number/no-digits-after-minus/error
  93. +1 −0 ios-client/ext/json-framework/Tests/Data/invalid/number/no-digits-after-minus/input
  94. +1 −0 ios-client/ext/json-framework/Tests/Data/invalid/object/eof-1/error
  95. +1 −0 ios-client/ext/json-framework/Tests/Data/invalid/object/eof-1/input
  96. +1 −0 ios-client/ext/json-framework/Tests/Data/invalid/object/eof-2/error
  97. +1 −0 ios-client/ext/json-framework/Tests/Data/invalid/object/eof-2/input
  98. +1 −0 ios-client/ext/json-framework/Tests/Data/invalid/object/eof-3/error
  99. +1 −0 ios-client/ext/json-framework/Tests/Data/invalid/object/eof-3/input
  100. +1 −0 ios-client/ext/json-framework/Tests/Data/invalid/object/eof-4/error
  101. +1 −0 ios-client/ext/json-framework/Tests/Data/invalid/object/eof-4/input
  102. +1 −0 ios-client/ext/json-framework/Tests/Data/invalid/string/ctrl-chars/newline/error
  103. +2 −0 ios-client/ext/json-framework/Tests/Data/invalid/string/ctrl-chars/newline/input
  104. +1 −0 ios-client/ext/json-framework/Tests/Data/invalid/string/ctrl-chars/tab/error
  105. +1 −0 ios-client/ext/json-framework/Tests/Data/invalid/string/ctrl-chars/tab/input
  106. +1 −0 ios-client/ext/json-framework/Tests/Data/invalid/string/invalid-hex-quad/error
  107. +1 −0 ios-client/ext/json-framework/Tests/Data/invalid/string/invalid-hex-quad/input
  108. +1 −0 ios-client/ext/json-framework/Tests/Data/invalid/string/unicode-invalid-high-surrogate/error
  109. +1 −0 ios-client/ext/json-framework/Tests/Data/invalid/string/unicode-invalid-high-surrogate/input
  110. +1 −0 ios-client/ext/json-framework/Tests/Data/invalid/string/unicode-invalid-low-surrogate/error
  111. +1 −0 ios-client/ext/json-framework/Tests/Data/invalid/string/unicode-invalid-low-surrogate/input
  112. +1 −0 ios-client/ext/json-framework/Tests/Data/invalid/string/unicode-missing-low-surrogate/error
  113. +1 −0 ios-client/ext/json-framework/Tests/Data/invalid/string/unicode-missing-low-surrogate/input
  114. +1 −0 ios-client/ext/json-framework/Tests/Data/jsonchecker/README
  115. +1 −0 ios-client/ext/json-framework/Tests/Data/jsonchecker/fail1.json
  116. +1 −0 ios-client/ext/json-framework/Tests/Data/jsonchecker/fail10.json
  117. +1 −0 ios-client/ext/json-framework/Tests/Data/jsonchecker/fail11.json
  118. +1 −0 ios-client/ext/json-framework/Tests/Data/jsonchecker/fail12.json
  119. +1 −0 ios-client/ext/json-framework/Tests/Data/jsonchecker/fail13.json
  120. +1 −0 ios-client/ext/json-framework/Tests/Data/jsonchecker/fail14.json
  121. +1 −0 ios-client/ext/json-framework/Tests/Data/jsonchecker/fail15.json
  122. +1 −0 ios-client/ext/json-framework/Tests/Data/jsonchecker/fail16.json
  123. +1 −0 ios-client/ext/json-framework/Tests/Data/jsonchecker/fail17.json
  124. +1 −0 ios-client/ext/json-framework/Tests/Data/jsonchecker/fail18.json
  125. +1 −0 ios-client/ext/json-framework/Tests/Data/jsonchecker/fail19.json
  126. +1 −0 ios-client/ext/json-framework/Tests/Data/jsonchecker/fail2.json
  127. +1 −0 ios-client/ext/json-framework/Tests/Data/jsonchecker/fail20.json
  128. +1 −0 ios-client/ext/json-framework/Tests/Data/jsonchecker/fail21.json
  129. +1 −0 ios-client/ext/json-framework/Tests/Data/jsonchecker/fail22.json
  130. +1 −0 ios-client/ext/json-framework/Tests/Data/jsonchecker/fail23.json
  131. +1 −0 ios-client/ext/json-framework/Tests/Data/jsonchecker/fail24.json
  132. +1 −0 ios-client/ext/json-framework/Tests/Data/jsonchecker/fail25.json
  133. +1 −0 ios-client/ext/json-framework/Tests/Data/jsonchecker/fail26.json
  134. +2 −0 ios-client/ext/json-framework/Tests/Data/jsonchecker/fail27.json
  135. +2 −0 ios-client/ext/json-framework/Tests/Data/jsonchecker/fail28.json
  136. +1 −0 ios-client/ext/json-framework/Tests/Data/jsonchecker/fail29.json
  137. +1 −0 ios-client/ext/json-framework/Tests/Data/jsonchecker/fail3.json
  138. +1 −0 ios-client/ext/json-framework/Tests/Data/jsonchecker/fail30.json
  139. +1 −0 ios-client/ext/json-framework/Tests/Data/jsonchecker/fail31.json
  140. +1 −0 ios-client/ext/json-framework/Tests/Data/jsonchecker/fail32.json
  141. +1 −0 ios-client/ext/json-framework/Tests/Data/jsonchecker/fail33.json
  142. +1 −0 ios-client/ext/json-framework/Tests/Data/jsonchecker/fail4.json
  143. +1 −0 ios-client/ext/json-framework/Tests/Data/jsonchecker/fail5.json
  144. +1 −0 ios-client/ext/json-framework/Tests/Data/jsonchecker/fail6.json
  145. +1 −0 ios-client/ext/json-framework/Tests/Data/jsonchecker/fail7.json
  146. +1 −0 ios-client/ext/json-framework/Tests/Data/jsonchecker/fail8.json
  147. +1 −0 ios-client/ext/json-framework/Tests/Data/jsonchecker/fail9.json
  148. +58 −0 ios-client/ext/json-framework/Tests/Data/jsonchecker/pass1.json
  149. +1 −0 ios-client/ext/json-framework/Tests/Data/jsonchecker/pass2.json
  150. +6 −0 ios-client/ext/json-framework/Tests/Data/jsonchecker/pass3.json
  151. +6 −0 ios-client/ext/json-framework/Tests/Data/valid/array/input
  152. +1 −0 ios-client/ext/json-framework/Tests/Data/valid/array/output
  153. +1 −0 ios-client/ext/json-framework/Tests/Data/valid/boolean/input
  154. +1 −0 ios-client/ext/json-framework/Tests/Data/valid/boolean/output
  155. +1 −0 ios-client/ext/json-framework/Tests/Data/valid/null/input
  156. +1 −0 ios-client/ext/json-framework/Tests/Data/valid/null/output
  157. +8 −0 ios-client/ext/json-framework/Tests/Data/valid/number/exponential/input
  158. +1 −0 ios-client/ext/json-framework/Tests/Data/valid/number/exponential/output
  159. +5 −0 ios-client/ext/json-framework/Tests/Data/valid/number/float/input
  160. +1 −0 ios-client/ext/json-framework/Tests/Data/valid/number/float/output
  161. +7 −0 ios-client/ext/json-framework/Tests/Data/valid/number/integer/input
  162. +1 −0 ios-client/ext/json-framework/Tests/Data/valid/number/integer/output
  163. +6 −0 ios-client/ext/json-framework/Tests/Data/valid/object/input
  164. +1 −0 ios-client/ext/json-framework/Tests/Data/valid/object/output
  165. +8 −0 ios-client/ext/json-framework/Tests/Data/valid/string/ctrl-shorthand/input
  166. +1 −0 ios-client/ext/json-framework/Tests/Data/valid/string/ctrl-shorthand/output
  167. +35 −0 ios-client/ext/json-framework/Tests/Data/valid/string/ctrl/input
  168. +1 −0 ios-client/ext/json-framework/Tests/Data/valid/string/ctrl/output
  169. +18 −0 ios-client/ext/json-framework/Tests/Data/valid/string/escapes/input
  170. +1 −0 ios-client/ext/json-framework/Tests/Data/valid/string/escapes/output
  171. +18 −0 ios-client/ext/json-framework/Tests/Data/valid/string/simple/input
  172. +1 −0 ios-client/ext/json-framework/Tests/Data/valid/string/simple/output
  173. +3 −0 ios-client/ext/json-framework/Tests/Data/valid/string/unicode-captial-alpha/input
  174. +1 −0 ios-client/ext/json-framework/Tests/Data/valid/string/unicode-captial-alpha/output
  175. +3 −0 ios-client/ext/json-framework/Tests/Data/valid/string/unicode-e-acute-and-ge-and-42/input
  176. +1 −0 ios-client/ext/json-framework/Tests/Data/valid/string/unicode-e-acute-and-ge-and-42/output
  177. +3 −0 ios-client/ext/json-framework/Tests/Data/valid/string/unicode-e-acute-and-ge/input
  178. +1 −0 ios-client/ext/json-framework/Tests/Data/valid/string/unicode-e-acute-and-ge/output
  179. +3 −0 ios-client/ext/json-framework/Tests/Data/valid/string/unicode-e-acute/input
  180. +1 −0 ios-client/ext/json-framework/Tests/Data/valid/string/unicode-e-acute/output
  181. +3 −0 ios-client/ext/json-framework/Tests/Data/valid/string/unicode-g-clef/input
  182. +1 −0 ios-client/ext/json-framework/Tests/Data/valid/string/unicode-g-clef/output
  183. +162 −0 ios-client/ext/json-framework/Tests/ErrorTest.m
  184. +92 −0 ios-client/ext/json-framework/Tests/FormatTest.m
  185. +88 −0 ios-client/ext/json-framework/Tests/JsonCheckerTest.m
  186. +47 −0 ios-client/ext/json-framework/Tests/JsonTestCase.h
  187. +68 −0 ios-client/ext/json-framework/Tests/JsonTestCase.m
  188. +112 −0 ios-client/ext/json-framework/Tests/ProxyTest.m
  189. +109 −0 ios-client/ext/json-framework/Tests/RoundTripTest.m
  190. +1 −0 ios-client/ext/json-framework/Tests/Stream/xaa
  191. +2 −0 ios-client/ext/json-framework/Tests/Stream/xab
  192. +1 −0 ios-client/ext/json-framework/Tests/Stream/xac
  193. +2 −0 ios-client/ext/json-framework/Tests/Stream/xad
  194. +1 −0 ios-client/ext/json-framework/Tests/Stream/xae
  195. +2 −0 ios-client/ext/json-framework/Tests/Stream/xaf
  196. +1 −0 ios-client/ext/json-framework/Tests/Stream/xag
  197. +2 −0 ios-client/ext/json-framework/Tests/Stream/xah
  198. +1 −0 ios-client/ext/json-framework/Tests/Stream/xai
  199. +2 −0 ios-client/ext/json-framework/Tests/Stream/xaj
  200. +2 −0 ios-client/ext/json-framework/Tests/Stream/xak
  201. +1 −0 ios-client/ext/json-framework/Tests/Stream/xal
  202. +2 −0 ios-client/ext/json-framework/Tests/Stream/xam
  203. +1 −0 ios-client/ext/json-framework/Tests/Stream/xan
  204. +2 −0 ios-client/ext/json-framework/Tests/Stream/xao
  205. +1 −0 ios-client/ext/json-framework/Tests/Stream/xap
  206. +2 −0 ios-client/ext/json-framework/Tests/Stream/xaq
  207. +2 −0 ios-client/ext/json-framework/Tests/Stream/xar
  208. +1 −0 ios-client/ext/json-framework/Tests/Stream/xas
  209. +2 −0 ios-client/ext/json-framework/Tests/Stream/xat
  210. +1 −0 ios-client/ext/json-framework/Tests/Stream/xau
  211. +2 −0 ios-client/ext/json-framework/Tests/Stream/xav
  212. +1 −0 ios-client/ext/json-framework/Tests/Stream/xaw
  213. +2 −0 ios-client/ext/json-framework/Tests/Stream/xax
  214. +1 −0 ios-client/ext/json-framework/Tests/Stream/xay
  215. +2 −0 ios-client/ext/json-framework/Tests/Stream/xaz
  216. +1 −0 ios-client/ext/json-framework/Tests/Stream/xba
  217. +2 −0 ios-client/ext/json-framework/Tests/Stream/xbb
  218. +1 −0 ios-client/ext/json-framework/Tests/Stream/xbc
  219. +1 −0 ios-client/ext/json-framework/Tests/Stream/xbd
  220. +1 −0 ios-client/ext/json-framework/Tests/Stream/xbe
  221. +2 −0 ios-client/ext/json-framework/Tests/Stream/xbf
  222. +1 −0 ios-client/ext/json-framework/Tests/Stream/xbg
  223. +2 −0 ios-client/ext/json-framework/Tests/Stream/xbh
  224. +2 −0 ios-client/ext/json-framework/Tests/Stream/xbi
  225. +1 −0 ios-client/ext/json-framework/Tests/Stream/xbj
  226. +2 −0 ios-client/ext/json-framework/Tests/Stream/xbk
  227. +1 −0 ios-client/ext/json-framework/Tests/Stream/xbl
  228. +2 −0 ios-client/ext/json-framework/Tests/Stream/xbm
  229. +1 −0 ios-client/ext/json-framework/Tests/Stream/xbn
  230. +2 −0 ios-client/ext/json-framework/Tests/Stream/xbo
  231. +2 −0 ios-client/ext/json-framework/Tests/Stream/xbp
  232. +1 −0 ios-client/ext/json-framework/Tests/Stream/xbq
  233. +2 −0 ios-client/ext/json-framework/Tests/Stream/xbr
  234. +1 −0 ios-client/ext/json-framework/Tests/Stream/xbs
  235. +2 −0 ios-client/ext/json-framework/Tests/Stream/xbt
  236. +1 −0 ios-client/ext/json-framework/Tests/Stream/xbu
  237. +2 −0 ios-client/ext/json-framework/Tests/Stream/xbv
  238. +1 −0 ios-client/ext/json-framework/Tests/Stream/xbw
  239. +2 −0 ios-client/ext/json-framework/Tests/Stream/xbx
  240. +1 −0 ios-client/ext/json-framework/Tests/Stream/xby
  241. +2 −0 ios-client/ext/json-framework/Tests/Stream/xbz
  242. +1 −0 ios-client/ext/json-framework/Tests/Stream/xca
  243. +2 −0 ios-client/ext/json-framework/Tests/Stream/xcb
  244. +1 −0 ios-client/ext/json-framework/Tests/Stream/xcc
  245. +2 −0 ios-client/ext/json-framework/Tests/Stream/xcd
  246. +2 −0 ios-client/ext/json-framework/Tests/Stream/xce
  247. +1 −0 ios-client/ext/json-framework/Tests/Stream/xcf
  248. +2 −0 ios-client/ext/json-framework/Tests/Stream/xcg
  249. +1 −0 ios-client/ext/json-framework/Tests/Stream/xch
  250. +2 −0 ios-client/ext/json-framework/Tests/Stream/xci
  251. +1 −0 ios-client/ext/json-framework/Tests/Stream/xcj
  252. +2 −0 ios-client/ext/json-framework/Tests/Stream/xck
  253. +1 −0 ios-client/ext/json-framework/Tests/Stream/xcl
  254. +1 −0 ios-client/ext/json-framework/Tests/Stream/xcm
  255. +2 −0 ios-client/ext/json-framework/Tests/Stream/xcn
  256. +1 −0 ios-client/ext/json-framework/Tests/Stream/xco
  257. +2 −0 ios-client/ext/json-framework/Tests/Stream/xcp
  258. +1 −0 ios-client/ext/json-framework/Tests/Stream/xcq
  259. +2 −0 ios-client/ext/json-framework/Tests/Stream/xcr
  260. +1 −0 ios-client/ext/json-framework/Tests/Stream/xcs
  261. +2 −0 ios-client/ext/json-framework/Tests/Stream/xct
  262. +1 −0 ios-client/ext/json-framework/Tests/Stream/xcu
  263. +2 −0 ios-client/ext/json-framework/Tests/Stream/xcv
  264. +1 −0 ios-client/ext/json-framework/Tests/Stream/xcw
  265. +2 −0 ios-client/ext/json-framework/Tests/Stream/xcx
  266. +1 −0 ios-client/ext/json-framework/Tests/Stream/xcy
  267. +2 −0 ios-client/ext/json-framework/Tests/Stream/xcz
  268. +1 −0 ios-client/ext/json-framework/Tests/Stream/xda
  269. +1 −0 ios-client/ext/json-framework/Tests/Stream/xdb
  270. +2 −0 ios-client/ext/json-framework/Tests/Stream/xdc
  271. +1 −0 ios-client/ext/json-framework/Tests/Stream/xdd
  272. +2 −0 ios-client/ext/json-framework/Tests/Stream/xde
  273. +1 −0 ios-client/ext/json-framework/Tests/Stream/xdf
  274. +2 −0 ios-client/ext/json-framework/Tests/Stream/xdg
  275. +2 −0 ios-client/ext/json-framework/Tests/Stream/xdh
  276. +1 −0 ios-client/ext/json-framework/Tests/Stream/xdi
  277. +2 −0 ios-client/ext/json-framework/Tests/Stream/xdj
  278. +1 −0 ios-client/ext/json-framework/Tests/Stream/xdk
  279. +2 −0 ios-client/ext/json-framework/Tests/Stream/xdl
  280. +1 −0 ios-client/ext/json-framework/Tests/Stream/xdm
  281. +1 −0 ios-client/ext/json-framework/Tests/Stream/xdn
  282. +2 −0 ios-client/ext/json-framework/Tests/Stream/xdo
  283. +1 −0 ios-client/ext/json-framework/Tests/Stream/xdp
  284. +1 −0 ios-client/ext/json-framework/Tests/Stream/xdq
  285. +1 −0 ios-client/ext/json-framework/Tests/Stream/xdr
  286. +2 −0 ios-client/ext/json-framework/Tests/Stream/xds
  287. +1 −0 ios-client/ext/json-framework/Tests/Stream/xdt
  288. +1 −0 ios-client/ext/json-framework/Tests/Stream/xdu
  289. +49 −0 ios-client/ext/json-framework/Tests/Stream/xxx
  290. +125 −0 ios-client/ext/json-framework/Tests/StreamParserIntegrationTest.m
  291. +87 −0 ios-client/ext/json-framework/Tests/WriterTest.m
  292. +1 −0 ios-client/ext/json-framework/debug.txt
  293. +7 −0 ios-client/ext/json-framework/sbjson-ios/sbjson-ios-Prefix.pch
  294. +2 −0 ios-client/ext/json-framework/sbjson-iosTests/en.lproj/InfoPlist.strings
  295. +22 −0 ios-client/ext/json-framework/sbjson-iosTests/sbjson-iosTests-Info.plist
  296. +7 −0 ios-client/ext/json-framework/sbjson-iosTests/sbjson-iosTests-Prefix.pch
@@ -0,0 +1,12 @@
+*.xcodeproj/*
+!*.xcodeproj/project.pbxproj
+/build
+*.pbxuser
+*.mode1v3
+*.mode2v3
+*.perspectivev3
+target/*
+.DS_Store
+profile
+*.svn
+/.svn/*

Large diffs are not rendered by default.

Oops, something went wrong.
@@ -0,0 +1,10 @@
+//
+// JSON.h
+// SBJson
+//
+// Created by Stig Brautaset on 01/06/2011.
+// Copyright 2011 Stig Brautaset. All rights reserved.
+//
+
+#warning The JSON.h header is deprecated, and will disappear in a future release. Please change to include SBJson.h instead.
+#include "SBJson.h"
@@ -0,0 +1,67 @@
+/*
+ Copyright (C) 2009 Stig Brautaset. All rights reserved.
+
+ Redistribution and use in source and binary forms, with or without
+ modification, are permitted provided that the following conditions are met:
+
+ * Redistributions of source code must retain the above copyright notice, this
+ list of conditions and the following disclaimer.
+
+ * Redistributions in binary form must reproduce the above copyright notice,
+ this list of conditions and the following disclaimer in the documentation
+ and/or other materials provided with the distribution.
+
+ * Neither the name of the author nor the names of its contributors may be used
+ to endorse or promote products derived from this software without specific
+ prior written permission.
+
+ THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
+ DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE
+ FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+ DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
+ SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
+ CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
+ OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#import <Foundation/Foundation.h>
+
+#pragma mark JSON Writing
+
+/// Adds JSON generation to NSObject
+@interface NSObject (NSObject_SBJsonWriting)
+
+/**
+ @brief Encodes the receiver into a JSON string
+
+ Although defined as a category on NSObject it is only defined for NSArray and NSDictionary.
+
+ @return the receiver encoded in JSON, or nil on error.
+
+ @see @ref objc2json
+ */
+- (NSString *)JSONRepresentation;
+
+@end
+
+
+#pragma mark JSON Parsing
+
+/// Adds JSON parsing methods to NSString
+@interface NSString (NSString_SBJsonParsing)
+
+/**
+ @brief Decodes the receiver's JSON text
+
+ @return the NSDictionary or NSArray represented by the receiver, or nil on error.
+
+ @see @ref json2objc
+ */
+- (id)JSONValue;
+
+@end
+
+
@@ -0,0 +1,58 @@
+/*
+ Copyright (C) 2009 Stig Brautaset. All rights reserved.
+
+ Redistribution and use in source and binary forms, with or without
+ modification, are permitted provided that the following conditions are met:
+
+ * Redistributions of source code must retain the above copyright notice, this
+ list of conditions and the following disclaimer.
+
+ * Redistributions in binary form must reproduce the above copyright notice,
+ this list of conditions and the following disclaimer in the documentation
+ and/or other materials provided with the distribution.
+
+ * Neither the name of the author nor the names of its contributors may be used
+ to endorse or promote products derived from this software without specific
+ prior written permission.
+
+ THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
+ DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE
+ FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+ DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
+ SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
+ CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
+ OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#import "NSObject+SBJson.h"
+#import "SBJsonWriter.h"
+#import "SBJsonParser.h"
+
+@implementation NSObject (NSObject_SBJsonWriting)
+
+- (NSString *)JSONRepresentation {
+ SBJsonWriter *writer = [[[SBJsonWriter alloc] init] autorelease];
+ NSString *json = [writer stringWithObject:self];
+ if (!json)
+ NSLog(@"-JSONRepresentation failed. Error is: %@", writer.error);
+ return json;
+}
+
+@end
+
+
+
+@implementation NSString (NSString_SBJsonParsing)
+
+- (id)JSONValue {
+ SBJsonParser *parser = [[[SBJsonParser alloc] init] autorelease];
+ id repr = [parser objectWithString:self];
+ if (!repr)
+ NSLog(@"-JSONValue failed. Error is: %@", parser.error);
+ return repr;
+}
+
+@end
@@ -0,0 +1,84 @@
+/*
+ Copyright (C) 2009-2011 Stig Brautaset. All rights reserved.
+
+ Redistribution and use in source and binary forms, with or without
+ modification, are permitted provided that the following conditions are met:
+
+ * Redistributions of source code must retain the above copyright notice, this
+ list of conditions and the following disclaimer.
+
+ * Redistributions in binary form must reproduce the above copyright notice,
+ this list of conditions and the following disclaimer in the documentation
+ and/or other materials provided with the distribution.
+
+ * Neither the name of the author nor the names of its contributors may be used
+ to endorse or promote products derived from this software without specific
+ prior written permission.
+
+ THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
+ DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE
+ FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+ DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
+ SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
+ CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
+ OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+/**
+ @page json2objc JSON to Objective-C
+
+ JSON is mapped to Objective-C types in the following way:
+
+ @li null -> NSNull
+ @li string -> NSString
+ @li array -> NSMutableArray
+ @li object -> NSMutableDictionary
+ @li true -> NSNumber's -numberWithBool:YES
+ @li false -> NSNumber's -numberWithBool:NO
+ @li integer up to 19 digits -> NSNumber's -numberWithLongLong:
+ @li all other numbers -> NSDecimalNumber
+
+ Since Objective-C doesn't have a dedicated class for boolean values,
+ these turns into NSNumber instances. However, since these are
+ initialised with the -initWithBool: method they round-trip back to JSON
+ properly. In other words, they won't silently suddenly become 0 or 1;
+ they'll be represented as 'true' and 'false' again.
+
+ As an optimisation integers up to 19 digits in length (the max length
+ for signed long long integers) turn into NSNumber instances, while
+ complex ones turn into NSDecimalNumber instances. We can thus avoid any
+ loss of precision as JSON allows ridiculously large numbers.
+
+ @page objc2json Objective-C to JSON
+
+ Objective-C types are mapped to JSON types in the following way:
+
+ @li NSNull -> null
+ @li NSString -> string
+ @li NSArray -> array
+ @li NSDictionary -> object
+ @li NSNumber's -initWithBool:YES -> true
+ @li NSNumber's -initWithBool:NO -> false
+ @li NSNumber -> number
+
+ @note In JSON the keys of an object must be strings. NSDictionary
+ keys need not be, but attempting to convert an NSDictionary with
+ non-string keys into JSON will throw an exception.
+
+ NSNumber instances created with the -numberWithBool: method are
+ converted into the JSON boolean "true" and "false" values, and vice
+ versa. Any other NSNumber instances are converted to a JSON number the
+ way you would expect.
+
+ */
+
+#import "SBJsonParser.h"
+#import "SBJsonWriter.h"
+#import "SBJsonStreamParser.h"
+#import "SBJsonStreamParserAdapter.h"
+#import "SBJsonStreamWriter.h"
+#import "NSObject+SBJson.h"
+
@@ -0,0 +1,107 @@
+/*
+ Copyright (C) 2009 Stig Brautaset. All rights reserved.
+
+ Redistribution and use in source and binary forms, with or without
+ modification, are permitted provided that the following conditions are met:
+
+ * Redistributions of source code must retain the above copyright notice, this
+ list of conditions and the following disclaimer.
+
+ * Redistributions in binary form must reproduce the above copyright notice,
+ this list of conditions and the following disclaimer in the documentation
+ and/or other materials provided with the distribution.
+
+ * Neither the name of the author nor the names of its contributors may be used
+ to endorse or promote products derived from this software without specific
+ prior written permission.
+
+ THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
+ DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE
+ FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+ DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
+ SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
+ CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
+ OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#import <Foundation/Foundation.h>
+
+/**
+ @brief Parse JSON Strings and NSData objects
+
+ This uses SBJsonStreamParser internally.
+
+ @see @ref objc2json
+
+ */
+
+@interface SBJsonParser : NSObject {
+
+@private
+ NSString *error;
+ NSUInteger depth, maxDepth;
+
+}
+
+/**
+ @brief The maximum recursing depth.
+
+ Defaults to 32. If the input is nested deeper than this the input will be deemed to be
+ malicious and the parser returns nil, signalling an error. ("Nested too deep".) You can
+ turn off this security feature by setting the maxDepth value to 0.
+ */
+@property NSUInteger maxDepth;
+
+/**
+ @brief Description of parse error
+
+ This method returns the trace of the last method that failed.
+ You need to check the return value of the call you're making to figure out
+ if the call actually failed, before you know call this method.
+
+ @return A string describing the error encountered, or nil if no error occured.
+
+ */
+@property(copy) NSString *error;
+
+/**
+ @brief Return the object represented by the given NSData object.
+
+ The data *must* be UTF8 encoded.
+
+ @param data An NSData containing UTF8 encoded data to parse.
+ @return The NSArray or NSDictionary represented by the object, or nil if an error occured.
+
+ */
+- (id)objectWithData:(NSData*)data;
+
+/**
+ @brief Return the object represented by the given string
+
+ This method converts its input to an NSData object containing UTF8 and calls -objectWithData: with it.
+
+ @return The NSArray or NSDictionary represented by the object, or nil if an error occured.
+ */
+- (id)objectWithString:(NSString *)repr;
+
+/**
+ @brief Return the object represented by the given string
+
+ This method calls objectWithString: internally. If an error occurs, and if @p error
+ is not nil, it creates an NSError object and returns this through its second argument.
+
+ @param jsonText the json string to parse
+ @param error pointer to an NSError object to populate on error
+
+ @return The NSArray or NSDictionary represented by the object, or nil if an error occured.
+ */
+
+- (id)objectWithString:(NSString*)jsonText
+ error:(NSError**)error;
+
+@end
+
+
Oops, something went wrong.

0 comments on commit d808322

Please sign in to comment.