rhodes 2.3.2 → 2.4.0.beta.1

Sign up to get free protection for your applications and to get access to all the features.
Files changed (623) hide show
  1. data/CHANGELOG +18 -0
  2. data/CREDITS +38 -0
  3. data/README.md +2 -2
  4. data/Rakefile +60 -2
  5. data/bin/set-rhodes-sdk.bat +1 -0
  6. data/doc/application.txt +11 -0
  7. data/doc/build.txt +156 -39
  8. data/doc/configuration.txt +1 -10
  9. data/doc/connect-to-web-services.txt +6 -6
  10. data/doc/device-caps.txt +48 -5
  11. data/doc/extensions.txt +8 -1
  12. data/doc/rhom.txt +16 -0
  13. data/doc/synchronization.txt +56 -14
  14. data/doc/ui.txt +23 -2
  15. data/installer/instant-rhodes.nsi +6 -6
  16. data/lib/extensions/barcode/ext/barcode/platform/iphone/Barcode.xcodeproj/project.pbxproj +4 -2
  17. data/lib/extensions/barcode/ext/barcode/platform/wm/Rakefile +1 -1
  18. data/lib/extensions/digest-md5/ext/Rakefile +3 -3
  19. data/lib/extensions/digest-md5/ext/build +0 -1
  20. data/lib/extensions/digest-sha1/ext/Rakefile +1 -1
  21. data/lib/extensions/digest-sha1/ext/build +0 -1
  22. data/lib/extensions/digest/ext/Rakefile +3 -3
  23. data/lib/extensions/digest/ext/build +0 -1
  24. data/lib/extensions/fcntl/ext/Rakefile +1 -1
  25. data/lib/extensions/mspec/mspec/guards/guard.rb +4 -0
  26. data/lib/extensions/mspec/mspec/helpers/environment.rb +4 -0
  27. data/lib/extensions/nfc/ext.yml +2 -0
  28. data/lib/extensions/nfc/ext/build +12 -0
  29. data/lib/extensions/nfc/ext/build.bat +8 -0
  30. data/lib/extensions/nfc/ext/nfc/platform/android/AndroidManifest.xml +25 -0
  31. data/lib/extensions/nfc/ext/nfc/platform/android/Rakefile +94 -0
  32. data/lib/extensions/nfc/ext/nfc/platform/android/ext_build.files +4 -0
  33. data/lib/extensions/nfc/ext/nfc/platform/android/jni/src/nfc.cpp +404 -0
  34. data/lib/extensions/nfc/ext/nfc/platform/android/src/com/nfc/Nfc.java +138 -0
  35. data/lib/extensions/nfc/ext/nfc/platform/android/src/com/nfc/NfcMessage.java +34 -0
  36. data/lib/extensions/nfc/ext/nfc/platform/android/src/com/nfc/NfcMessagePack.java +33 -0
  37. data/lib/extensions/nfc/ext/nfc/platform/android/src/com/nfc/NfcRecord.java +149 -0
  38. data/lib/extensions/nfc/ext/nfc/shared/ruby/nfc.i +22 -0
  39. data/lib/extensions/nfc/ext/nfc/shared/ruby/nfc_wrap.c +2034 -0
  40. data/lib/extensions/nfc/nfc.rb +120 -0
  41. data/lib/extensions/rholang/{lang_ca.rb → rholang/lang_ca.rb} +0 -0
  42. data/lib/extensions/rholang/{lang_cf.rb → rholang/lang_cf.rb} +0 -0
  43. data/lib/extensions/rholang/{lang_chef.rb → rholang/lang_chef.rb} +0 -0
  44. data/lib/extensions/rholang/{lang_cs.rb → rholang/lang_cs.rb} +0 -0
  45. data/lib/extensions/rholang/{lang_da.rb → rholang/lang_da.rb} +0 -0
  46. data/lib/extensions/rholang/{lang_de.rb → rholang/lang_de.rb} +0 -0
  47. data/lib/extensions/rholang/{lang_es.rb → rholang/lang_es.rb} +0 -0
  48. data/lib/extensions/rholang/{lang_es_ar.rb → rholang/lang_es_ar.rb} +0 -0
  49. data/lib/extensions/rholang/{lang_fi.rb → rholang/lang_fi.rb} +0 -0
  50. data/lib/extensions/rholang/{lang_fr.rb → rholang/lang_fr.rb} +0 -0
  51. data/lib/extensions/rholang/{lang_it.rb → rholang/lang_it.rb} +0 -0
  52. data/lib/extensions/rholang/{lang_ko.rb → rholang/lang_ko.rb} +0 -0
  53. data/lib/extensions/rholang/{lang_nl.rb → rholang/lang_nl.rb} +0 -0
  54. data/lib/extensions/rholang/{lang_no.rb → rholang/lang_no.rb} +0 -0
  55. data/lib/extensions/rholang/{lang_pt.rb → rholang/lang_pt.rb} +0 -0
  56. data/lib/extensions/rholang/{lang_pt_br.rb → rholang/lang_pt_br.rb} +0 -0
  57. data/lib/extensions/rholang/{lang_ru.rb → rholang/lang_ru.rb} +0 -0
  58. data/lib/extensions/rholang/{lang_se.rb → rholang/lang_se.rb} +0 -0
  59. data/lib/extensions/rholang/{lang_sr.rb → rholang/lang_sr.rb} +0 -0
  60. data/lib/extensions/rholang/{rhoerror_ru.rb → rholang/rhoerror_ru.rb} +0 -0
  61. data/lib/extensions/rholang/{rhomsg_ru.rb → rholang/rhomsg_ru.rb} +0 -0
  62. data/lib/framework/date/format.rb +2 -0
  63. data/lib/framework/dateOrig.rb +17 -8
  64. data/lib/framework/rational18.rb +532 -0
  65. data/lib/framework/res/back_btn.wp7.png +0 -0
  66. data/lib/framework/res/blue_pushpin.wp7.png +0 -0
  67. data/lib/framework/res/blue_pushpin_small.wp7.png +0 -0
  68. data/lib/framework/res/callout.wp7.png +0 -0
  69. data/lib/framework/res/callout_link.wp7.png +0 -0
  70. data/lib/framework/res/esri.wp7.png +0 -0
  71. data/lib/framework/res/forward_btn.wp7.png +0 -0
  72. data/lib/framework/res/home_btn.wp7.png +0 -0
  73. data/lib/framework/res/options_btn.wp7.png +0 -0
  74. data/lib/framework/res/refresh_btn.wp7.png +0 -0
  75. data/lib/framework/rho/render.rb +8 -1
  76. data/lib/framework/rho/rho.rb +30 -7
  77. data/lib/framework/rho/rhoapplication.rb +9 -4
  78. data/lib/framework/rho/rhofsconnector.rb +5 -1
  79. data/lib/framework/rho/rhotabbar.rb +8 -0
  80. data/lib/framework/rho/rhotoolbar.rb +1 -1
  81. data/lib/framework/rho/rhoviewhelpers.rb +18 -1
  82. data/lib/framework/rhodes.rb +1 -1
  83. data/lib/framework/rhoframework.rb +46 -1
  84. data/lib/framework/rholang/localization_simplified.rb +17 -16
  85. data/lib/framework/rhom/rhom_db_adapter.rb +2 -2
  86. data/lib/framework/rhom/rhom_object_factory.rb +115 -12
  87. data/lib/framework/rhosystem.rb +135 -0
  88. data/lib/framework/version.rb +1 -1
  89. data/lib/rhodes.rb +1 -1
  90. data/lib/test/apps/rhoconfig.txt +23 -23
  91. data/platform/android/Rhodes/AndroidManifest.full.xml +101 -0
  92. data/platform/android/Rhodes/AndroidManifest.xml +10 -15
  93. data/platform/android/Rhodes/default.properties +11 -0
  94. data/platform/android/Rhodes/gen/com/rhomobile/rhodes/R.java +59 -53
  95. data/platform/android/Rhodes/jni/include/rhodes.h +1 -0
  96. data/platform/android/Rhodes/jni/include/rhodes/jni/com_rhomobile_rhodes_RhodesApplication.h +21 -0
  97. data/platform/android/Rhodes/jni/include/rhodes/jni/com_rhomobile_rhodes_alert_PopupActivity.h +21 -0
  98. data/platform/android/Rhodes/jni/include/rhodes/jni/com_rhomobile_rhodes_file_RhoFileApi.h +10 -2
  99. data/platform/android/Rhodes/jni/src/alert.cpp +2 -1
  100. data/platform/android/Rhodes/jni/src/datetimepicker.cpp +2 -0
  101. data/platform/android/Rhodes/jni/src/fileapi.cpp +671 -84
  102. data/platform/android/Rhodes/jni/src/nativebar.cpp +18 -0
  103. data/platform/android/Rhodes/jni/src/rhodes.cpp +92 -1
  104. data/platform/android/Rhodes/res/values/styles.xml +7 -0
  105. data/platform/android/Rhodes/src/com/rhomobile/rhodes/BaseActivity.java +35 -2
  106. data/platform/android/Rhodes/src/com/rhomobile/rhodes/Capabilities.java +12 -13
  107. data/platform/android/Rhodes/src/com/rhomobile/rhodes/LocalFileProvider.java +130 -0
  108. data/platform/android/Rhodes/src/com/rhomobile/rhodes/NativeBar.java +6 -0
  109. data/platform/android/Rhodes/src/com/rhomobile/rhodes/PushReceiver.java +5 -1
  110. data/platform/android/Rhodes/src/com/rhomobile/rhodes/PushService.java +6 -2
  111. data/platform/android/Rhodes/src/com/rhomobile/rhodes/RhoMenu.java +7 -36
  112. data/platform/android/Rhodes/src/com/rhomobile/rhodes/RhodesActivity.java +43 -20
  113. data/platform/android/Rhodes/src/com/rhomobile/rhodes/RhodesApplication.java +2 -0
  114. data/platform/android/Rhodes/src/com/rhomobile/rhodes/RhodesService.java +63 -28
  115. data/platform/android/Rhodes/src/com/rhomobile/rhodes/Utils.java +2 -2
  116. data/platform/android/Rhodes/src/com/rhomobile/rhodes/WebView.java +6 -2
  117. data/platform/android/Rhodes/src/com/rhomobile/rhodes/alert/Alert.java +19 -282
  118. data/platform/android/Rhodes/src/com/rhomobile/rhodes/alert/PopupActivity.java +354 -0
  119. data/platform/android/Rhodes/src/com/rhomobile/rhodes/datetime/DateTimePickerScreen.java +4 -0
  120. data/platform/android/Rhodes/src/com/rhomobile/rhodes/event/EventStore.java +1 -2
  121. data/platform/android/Rhodes/src/com/rhomobile/rhodes/file/RhoFileApi.java +71 -5
  122. data/platform/android/Rhodes/src/com/rhomobile/rhodes/geolocation/GeoLocationImpl.java +107 -37
  123. data/platform/android/Rhodes/src/com/rhomobile/rhodes/mainview/SimpleMainView.java +10 -7
  124. data/platform/android/Rhodes/src/com/rhomobile/rhodes/mainview/TabbedMainView.java +156 -56
  125. data/platform/android/Rhodes/src/com/rhomobile/rhodes/mapview/MapView.java +0 -1
  126. data/platform/android/Rhodes/src/com/rhomobile/rhodes/phonebook/ContactAccessorNew.java +40 -32
  127. data/platform/android/Rhodes/src/com/rhomobile/rhodes/signature/SignatureView.java +1 -0
  128. data/platform/android/Rhodes/src/com/rhomobile/rhodes/uri/ExternalHttpHandler.java +14 -6
  129. data/platform/android/Rhodes/src/com/rhomobile/rhodes/uri/LocalFileHandler.java +46 -0
  130. data/platform/android/Rhodes/src/com/rhomobile/rhodes/uri/MailUriHandler.java +4 -24
  131. data/platform/android/Rhodes/src/com/rhomobile/rhodes/uri/UriHandler.java +3 -1
  132. data/platform/android/build/RhodesSRC_build.files +28 -25
  133. data/platform/android/build/android.rake +230 -54
  134. data/platform/android/build/androidcommon.rb +1 -1
  135. data/platform/android/build/librhocommon_build.files +1 -0
  136. data/platform/bb/Hsqldb/BlackBerry_App_Descriptor.xml +20 -0
  137. data/platform/bb/Hsqldb/src/com/rho/db/HsqlDBResult.java +1 -5
  138. data/platform/bb/Hsqldb/src/com/rho/db/HsqlDBStorage.java +6 -1
  139. data/platform/bb/Hsqldb/src/org/hsqldb/rowio/RowOutputBase.java +1 -1
  140. data/platform/bb/Hsqldb/src/org/hsqldb/rowio/RowOutputBinary.java +1 -1
  141. data/platform/bb/RubyVM/BlackBerry_App_Descriptor.xml +20 -0
  142. data/platform/bb/RubyVM/src/com/rho/IRhoRubyHelper.java +2 -0
  143. data/platform/bb/RubyVM/src/com/rho/RhoLogOutputSink.java +0 -1
  144. data/platform/bb/RubyVM/src/com/rho/RhoLogger.java +12 -10
  145. data/platform/bb/RubyVM/src/com/rho/RhoThread.java +16 -0
  146. data/platform/bb/RubyVM/src/com/rho/RhoTimer.java +89 -0
  147. data/platform/bb/RubyVM/src/com/rho/RhodesApp.java +20 -13
  148. data/platform/bb/RubyVM/src/com/rho/SplashScreen.java +1 -2
  149. data/platform/bb/RubyVM/src/com/rho/ThreadQueue.java +2 -2
  150. data/platform/bb/RubyVM/src/com/rho/TimeInterval.java +5 -0
  151. data/platform/bb/RubyVM/src/com/rho/db/DBAdapter.java +54 -48
  152. data/platform/bb/RubyVM/src/com/rho/db/IDBResult.java +0 -1
  153. data/platform/bb/RubyVM/src/com/rho/db/IDBStorage.java +1 -0
  154. data/platform/bb/RubyVM/src/com/rho/net/AsyncHttp.java +1 -1
  155. data/platform/bb/RubyVM/src/com/rho/sync/ClientRegister.java +1 -1
  156. data/platform/bb/RubyVM/src/com/rho/sync/JSONStructIterator.java +1 -1
  157. data/platform/bb/RubyVM/src/com/rho/sync/SyncEngine.java +16 -8
  158. data/platform/bb/RubyVM/src/com/rho/sync/SyncNotify.java +2 -2
  159. data/platform/bb/RubyVM/src/com/rho/sync/SyncSource.java +52 -29
  160. data/platform/bb/RubyVM/src/com/rho/sync/SyncThread.java +1 -3
  161. data/platform/bb/build/RubyVM_build.files +1 -0
  162. data/platform/bb/build/bb.rake +29 -9
  163. data/platform/bb/rhodes/BlackBerry_App_Descriptor.xml +23 -0
  164. data/platform/bb/rhodes/platform/5.0/com/rho/RhodesApplicationPlatform.java +1 -1
  165. data/platform/bb/rhodes/platform/5.0/com/rho/db/SqliteCopyResult.java +0 -4
  166. data/platform/bb/rhodes/platform/5.0/com/rho/db/SqliteResult.java +13 -20
  167. data/platform/bb/rhodes/platform/5.0/com/rho/db/SqliteStorage.java +183 -157
  168. data/platform/bb/rhodes/src/com/rho/RhoRubyHelper.java +22 -0
  169. data/platform/bb/rhodes/src/com/rho/RhodesApplicationPlatform.java +1 -1
  170. data/platform/bb/rhodes/src/com/rho/db/SqliteCopyResult.java +0 -4
  171. data/platform/bb/rhodes/src/com/rho/db/SqliteResult.java +13 -20
  172. data/platform/bb/rhodes/src/com/rho/db/SqliteStorage.java +183 -157
  173. data/platform/bb/rhodes/src/com/rho/rubyext/System.java +46 -1
  174. data/platform/bb/rhodes/src/rhomobile/RhodesApplication.java +8 -1
  175. data/platform/bb/rhodes/src/rhomobile/camera/CameraFilesListener.java +13 -3
  176. data/platform/iphone/Classes/AppManager/AppManager.h +5 -1
  177. data/platform/iphone/Classes/AppManager/AppManager.m +170 -7
  178. data/platform/iphone/Classes/DateTimePicker.m +14 -1
  179. data/platform/iphone/Classes/DateTimePickerDelegate.h +2 -0
  180. data/platform/iphone/Classes/DateTimePickerDelegate.m +36 -2
  181. data/platform/iphone/Classes/NativeBar.h +1 -0
  182. data/platform/iphone/Classes/NativeBar.m +15 -3
  183. data/platform/iphone/Classes/Phonebook/phonebook.m +8 -9
  184. data/platform/iphone/Classes/Rhodes.m +50 -6
  185. data/platform/iphone/Classes/SimpleMainView.m +7 -6
  186. data/platform/iphone/Classes/SplitView/RightViewController.h +3 -1
  187. data/platform/iphone/Classes/SplitView/RightViewController.m +14 -1
  188. data/platform/iphone/Classes/TabbedMainView.h +4 -0
  189. data/platform/iphone/Classes/TabbedMainView.m +43 -26
  190. data/platform/iphone/Info.plist +1 -1
  191. data/platform/iphone/RhoLib/RhoLib.xcodeproj/project.pbxproj +4 -0
  192. data/platform/iphone/curl/curl.xcodeproj/project.pbxproj +3 -3
  193. data/platform/iphone/rbuild/iphone.rake +168 -119
  194. data/platform/iphone/rhoextlib/rhoextlib.xcodeproj/project.pbxproj +4 -2
  195. data/platform/iphone/rhorubylib/rhorubylib.xcodeproj/project.pbxproj +3 -3
  196. data/platform/iphone/rhorunner.xcodeproj/project.pbxproj +2 -2
  197. data/platform/iphone/rhosynclib/rhosynclib.xcodeproj/project.pbxproj +3 -3
  198. data/platform/shared/SyncClient/SyncClient.cpp +20 -8
  199. data/platform/shared/SyncClient/SyncClient.h +2 -1
  200. data/platform/shared/common/RhoDefs.h +4 -0
  201. data/platform/shared/common/RhoPort.h +22 -0
  202. data/platform/shared/common/RhoStd.h +5 -0
  203. data/platform/shared/common/RhoTime.cpp +73 -0
  204. data/platform/shared/common/RhoTime.h +26 -53
  205. data/platform/shared/common/RhodesApp.cpp +29 -28
  206. data/platform/shared/common/RhodesApp.h +4 -1
  207. data/platform/shared/common/StringConverter.h +37 -10
  208. data/platform/shared/common/app_build_capabilities.h +2 -0
  209. data/platform/shared/common/rhoparams.cpp +25 -12
  210. data/platform/shared/common/rhoparams.h +10 -8
  211. data/platform/shared/db/DBAdapter.cpp +0 -22
  212. data/platform/shared/json/RJSONTokener.c +15 -23
  213. data/platform/shared/net/AsyncHttp.cpp +9 -8
  214. data/platform/shared/net/HttpServer.cpp +61 -19
  215. data/platform/shared/net/HttpServer.h +2 -0
  216. data/platform/shared/ruby/ext/datetimepicker/datetimepicker.i +3 -0
  217. data/platform/shared/ruby/ext/datetimepicker/datetimepicker_wrap.c +151 -402
  218. data/platform/shared/ruby/ext/nativebar/nativebar.i +3 -0
  219. data/platform/shared/ruby/ext/nativebar/nativebar_wrap.c +154 -403
  220. data/platform/shared/ruby/ext/rho/rhoruby.c +4 -0
  221. data/platform/shared/ruby/ext/rho/rhoruby.h +2 -0
  222. data/platform/shared/ruby/ext/system/system.i +8 -0
  223. data/platform/shared/ruby/ext/system/system_wrap.c +80 -5
  224. data/platform/shared/ruby/file.c +6 -4
  225. data/platform/shared/ruby/gc.c +1 -1
  226. data/platform/shared/ruby/linux/ruby/config.h +7 -2
  227. data/platform/shared/ruby/missing/acosh.c +3 -3
  228. data/platform/shared/ruby/wince/_time.h +1 -1
  229. data/platform/shared/ruby/wince/stdlib.c +1 -1
  230. data/platform/shared/ruby/wince/string_wce.c +2 -2
  231. data/platform/shared/ruby/wince/sys/timeb.c +1 -0
  232. data/platform/shared/ruby/wince/time_wce.c +8 -0
  233. data/platform/shared/ruby/wince/wince.c +7 -7
  234. data/platform/shared/ruby/wince/wince.h +22 -0
  235. data/platform/shared/rubyext/System.cpp +19 -1
  236. data/platform/shared/sqlite/sqlite3.c +18993 -8129
  237. data/platform/shared/sqlite/sqlite3.h +953 -358
  238. data/platform/shared/sqlite/sqlite3ext.h +42 -0
  239. data/platform/shared/sync/SyncEngine.cpp +10 -0
  240. data/platform/shared/sync/SyncSource.cpp +41 -19
  241. data/platform/shared/sync/SyncSource.h +1 -1
  242. data/platform/shared/tcmalloc/rhomem.h +7 -2
  243. data/platform/shared/tcmalloc/windows/port.h +2 -0
  244. data/platform/shared/unzip/unzip.cpp +1 -0
  245. data/platform/shared/xruby/src/com/xruby/compiler/parser/RubyParser.java +11 -1
  246. data/platform/wm/RhoLib/RhoLib.vcproj +182 -24
  247. data/platform/wm/build/wm.rake +16 -3
  248. data/platform/wm/rhodes.sln +106 -113
  249. data/platform/wm/rhodes/Alert.cpp +6 -7
  250. data/platform/wm/rhodes/AppManager.cpp +8 -17
  251. data/platform/wm/rhodes/DateTimePicker.cpp +3 -0
  252. data/platform/wm/rhodes/DateTimePicker.h +2 -0
  253. data/platform/wm/rhodes/MainWindow.cpp +36 -16
  254. data/platform/wm/rhodes/MainWindow.h +6 -3
  255. data/platform/wm/rhodes/OutlookApp.cpp +3 -3
  256. data/platform/wm/rhodes/Rhodes.cpp +46 -27
  257. data/platform/wm/rhodes/Rhodes.rc +16 -3
  258. data/platform/wm/rhodes/RingtoneManager.cpp +7 -7
  259. data/platform/wm/rhodes/RingtoneManager.h +1 -1
  260. data/platform/wm/rhodes/Utils.cpp +2 -1
  261. data/platform/wm/rhodes/bluetooth/Bluetooth.cpp +1 -13
  262. data/platform/wm/rhodes/bluetooth/Bluetooth.h +1 -2
  263. data/platform/wm/rhodes/camera/Camera.cpp +6 -12
  264. data/platform/wm/rhodes/phonebook/phonebook.cpp +11 -11
  265. data/platform/wm/rhodes/phonebook/phonebook.h +1 -1
  266. data/platform/wm/rhodes/resource.h +3 -1
  267. data/platform/wm/rhodes/rho/net/NetRequestImpl.cpp +7 -5
  268. data/platform/wm/rhodes/rho/rubyext/GeoLocationImpl.cpp +6 -6
  269. data/platform/wm/rhodes/rho/rubyext/GeoLocationImpl.h +1 -1
  270. data/platform/wm/rhodes/rho/rubyext/NativeToolbar.cpp +6 -1
  271. data/platform/wm/rhodes/rho/rubyext/SystemImpl.cpp +84 -19
  272. data/platform/wm/rhodes/rho/rubyext/calendar.cpp +2 -2
  273. data/platform/wm/rhodes/rhodes.vcproj +316 -73
  274. data/platform/wm/rhodes/signature/Signature.cpp +336 -6
  275. data/platform/wm/rhodes/signature/Signature.h +55 -0
  276. data/platform/wm/rhodes/stdafx.h +7 -4
  277. data/platform/wm/rubylib/rubylib.vcproj +261 -91
  278. data/platform/wm/sqlite3/sqlite3.vcproj +223 -69
  279. data/platform/wm/syncengine/syncengine.vcproj +220 -66
  280. data/platform/wm/tcmalloc/tcmalloc.vcproj +197 -43
  281. data/platform/wp7/IronRuby/Languages/Ruby/Ruby/Builtins/ConsoleStream.cs +107 -0
  282. data/platform/wp7/IronRuby/Languages/Ruby/Ruby/Runtime/Loader.cs +1037 -0
  283. data/platform/wp7/IronRuby/Languages/Ruby/Ruby/Runtime/RubyUtils.cs +1476 -0
  284. data/platform/wp7/RhoAppRunner/Program.cs +55 -0
  285. data/platform/wp7/RhoAppRunner/Properties/AssemblyInfo.cs +36 -0
  286. data/platform/wp7/RhoAppRunner/RhoAppRunner.csproj +69 -0
  287. data/platform/wp7/RhoRubyExtGen/GenerateInitializers.cmd +7 -0
  288. data/platform/wp7/RhoRubyExtGen/Properties/AssemblyInfo.cs +36 -0
  289. data/platform/wp7/RhoRubyExtGen/RhoAsyncHttp.cs +38 -0
  290. data/platform/wp7/RhoRubyExtGen/RhoDatabase.cs +93 -0
  291. data/platform/wp7/RhoRubyExtGen/RhoJSON.cs +37 -0
  292. data/platform/wp7/RhoRubyExtGen/RhoNativeBar.cs +106 -0
  293. data/platform/wp7/RhoRubyExtGen/RhoRubyExtGen.csproj +75 -0
  294. data/platform/wp7/RhoRubyExtGen/RhoSyncEngine.cs +123 -0
  295. data/platform/wp7/RhoRubyExtGen/RhoWebView.cs +42 -0
  296. data/platform/wp7/RhoRubyLib/Initializers.Generated.cs +309 -0
  297. data/platform/wp7/RhoRubyLib/Properties/AssemblyInfo.cs +36 -0
  298. data/platform/wp7/RhoRubyLib/RhoAppAdapter.cs +96 -0
  299. data/platform/wp7/RhoRubyLib/RhoRuby.cs +296 -0
  300. data/platform/wp7/RhoRubyLib/RhoRubyLib.csproj +155 -0
  301. data/platform/wp7/RhoRubyLib/WP_PlatformAdaptationLayer.cs +107 -0
  302. data/platform/wp7/RhoRubyLib/common/IInputStream.cs +21 -0
  303. data/platform/wp7/RhoRubyLib/common/Mutex.cs +30 -0
  304. data/platform/wp7/RhoRubyLib/common/RhoConf.cs +389 -0
  305. data/platform/wp7/RhoRubyLib/common/RhoEmptyProfiler.cs +27 -0
  306. data/platform/wp7/RhoRubyLib/common/RhoFile.cs +332 -0
  307. data/platform/wp7/RhoRubyLib/common/RhoFilePath.cs +89 -0
  308. data/platform/wp7/RhoRubyLib/common/RhoParamArray.cs +33 -0
  309. data/platform/wp7/RhoRubyLib/common/RhoParams.cs +66 -0
  310. data/platform/wp7/RhoRubyLib/common/RhoProfiler.cs +145 -0
  311. data/platform/wp7/RhoRubyLib/common/RhoResourceMap.cs +68 -0
  312. data/platform/wp7/RhoRubyLib/common/RhoStd.cs +205 -0
  313. data/platform/wp7/RhoRubyLib/common/RhoThread.cs +114 -0
  314. data/platform/wp7/RhoRubyLib/common/RhodesApp.cs +504 -0
  315. data/platform/wp7/RhoRubyLib/common/ThreadQueue.cs +199 -0
  316. data/platform/wp7/RhoRubyLib/common/TimeInterval.cs +56 -0
  317. data/platform/wp7/RhoRubyLib/common/Tokenizer.cs +52 -0
  318. data/platform/wp7/RhoRubyLib/db/DBAdapter.cs +1129 -0
  319. data/platform/wp7/RhoRubyLib/db/DBAttrManager.cs +92 -0
  320. data/platform/wp7/RhoRubyLib/db/DBException.cs +35 -0
  321. data/platform/wp7/RhoRubyLib/db/IDBCallback.cs +10 -0
  322. data/platform/wp7/RhoRubyLib/db/IDBResult.cs +33 -0
  323. data/platform/wp7/RhoRubyLib/db/IDBStorage.cs +32 -0
  324. data/platform/wp7/RhoRubyLib/db/SqliteCopyResult.cs +79 -0
  325. data/platform/wp7/RhoRubyLib/db/SqliteResult.cs +267 -0
  326. data/platform/wp7/RhoRubyLib/db/SqliteStorage.cs +319 -0
  327. data/platform/wp7/RhoRubyLib/json/JSONArrayIterator.cs +63 -0
  328. data/platform/wp7/RhoRubyLib/json/JSONEntry.cs +96 -0
  329. data/platform/wp7/RhoRubyLib/json/JSONStructIterator.cs +77 -0
  330. data/platform/wp7/RhoRubyLib/json/JsonParser.cs +483 -0
  331. data/platform/wp7/RhoRubyLib/json/RJSONTokener.cs +406 -0
  332. data/platform/wp7/RhoRubyLib/logging/IRhoLogSink.cs +12 -0
  333. data/platform/wp7/RhoRubyLib/logging/RhoLogConf.cs +161 -0
  334. data/platform/wp7/RhoRubyLib/logging/RhoLogFileSink.cs +174 -0
  335. data/platform/wp7/RhoRubyLib/logging/RhoLogger.cs +320 -0
  336. data/platform/wp7/RhoRubyLib/net/AsyncHttp.cs +362 -0
  337. data/platform/wp7/RhoRubyLib/net/HttpServer.cs +466 -0
  338. data/platform/wp7/RhoRubyLib/net/NetRequest.cs +717 -0
  339. data/platform/wp7/RhoRubyLib/net/NetResponse.cs +64 -0
  340. data/platform/wp7/RhoRubyLib/net/URI.cs +187 -0
  341. data/platform/wp7/RhoRubyLib/rubyext/RhoAsyncHttp.cs +43 -0
  342. data/platform/wp7/RhoRubyLib/rubyext/RhoDatabase.cs +177 -0
  343. data/platform/wp7/RhoRubyLib/rubyext/RhoJSON.cs +39 -0
  344. data/platform/wp7/RhoRubyLib/rubyext/RhoKernelOps.cs +19 -0
  345. data/platform/wp7/RhoRubyLib/rubyext/RhoNativeBar.cs +117 -0
  346. data/platform/wp7/RhoRubyLib/rubyext/RhoSyncEngine.cs +199 -0
  347. data/platform/wp7/RhoRubyLib/rubyext/RhoWebView.cs +49 -0
  348. data/platform/wp7/RhoRubyLib/sync/ClientRegister.cs +142 -0
  349. data/platform/wp7/RhoRubyLib/sync/ISyncProtocol.cs +23 -0
  350. data/platform/wp7/RhoRubyLib/sync/ISyncStatusListener.cs +10 -0
  351. data/platform/wp7/RhoRubyLib/sync/SyncEngine.cs +1051 -0
  352. data/platform/wp7/RhoRubyLib/sync/SyncNotify.cs +651 -0
  353. data/platform/wp7/RhoRubyLib/sync/SyncProtocol_3.cs +79 -0
  354. data/platform/wp7/RhoRubyLib/sync/SyncSource.cs +1105 -0
  355. data/platform/wp7/RhoRubyLib/sync/SyncThread.cs +301 -0
  356. data/platform/wp7/WPApplication.sln +50 -0
  357. data/platform/wp7/WPApplication/App.xaml +19 -0
  358. data/platform/wp7/WPApplication/App.xaml.cs +211 -0
  359. data/platform/wp7/WPApplication/ApplicationIcon.png +0 -0
  360. data/platform/wp7/WPApplication/Background.png +0 -0
  361. data/platform/wp7/WPApplication/MainPage.xaml +44 -0
  362. data/platform/wp7/WPApplication/MainPage.xaml.cs +132 -0
  363. data/platform/wp7/WPApplication/Properties/AppManifest.xml +6 -0
  364. data/platform/wp7/WPApplication/Properties/AssemblyInfo.cs +35 -0
  365. data/platform/wp7/WPApplication/Properties/WMAppManifest.xml +32 -0
  366. data/platform/wp7/WPApplication/SplashScreenImage.jpg +0 -0
  367. data/platform/wp7/WPApplication/WPApplication.csproj +201 -0
  368. data/platform/wp7/WPApplication/WP_PlatformAdaptationLayer.cs +88 -0
  369. data/platform/wp7/WPApplication/app_manifest.txt +1 -0
  370. data/platform/wp7/WPApplication/readme.htm +40 -0
  371. data/platform/wp7/WPApplication/readme2.htm +37 -0
  372. data/platform/wp7/WPApplication/rho/apps/app/Model1/edit.bb.erb +29 -0
  373. data/platform/wp7/WPApplication/rho/apps/app/Model1/edit.erb +32 -0
  374. data/platform/wp7/WPApplication/rho/apps/app/Model1/index.bb.erb +21 -0
  375. data/platform/wp7/WPApplication/rho/apps/app/Model1/index.erb +26 -0
  376. data/platform/wp7/WPApplication/rho/apps/app/Model1/model1.rb +10 -0
  377. data/platform/wp7/WPApplication/rho/apps/app/Model1/model1_controller.rb +58 -0
  378. data/platform/wp7/WPApplication/rho/apps/app/Model1/new.bb.erb +29 -0
  379. data/platform/wp7/WPApplication/rho/apps/app/Model1/new.erb +31 -0
  380. data/platform/wp7/WPApplication/rho/apps/app/Model1/show.bb.erb +26 -0
  381. data/platform/wp7/WPApplication/rho/apps/app/Model1/show.erb +28 -0
  382. data/platform/wp7/WPApplication/rho/apps/app/Settings/controller.rb +75 -0
  383. data/platform/wp7/WPApplication/rho/apps/app/Settings/home.bb.erb +17 -0
  384. data/platform/wp7/WPApplication/rho/apps/app/Settings/home.erb +20 -0
  385. data/platform/wp7/WPApplication/rho/apps/app/Settings/index.bb.erb +32 -0
  386. data/platform/wp7/WPApplication/rho/apps/app/Settings/index.erb +30 -0
  387. data/platform/wp7/WPApplication/rho/apps/app/Settings/login.bb.erb +35 -0
  388. data/platform/wp7/WPApplication/rho/apps/app/Settings/login.erb +27 -0
  389. data/platform/wp7/WPApplication/rho/apps/app/Settings/reset.bb.erb +15 -0
  390. data/platform/wp7/WPApplication/rho/apps/app/Settings/reset.erb +17 -0
  391. data/platform/wp7/WPApplication/rho/apps/app/Settings/wait.bb.erb +3 -0
  392. data/platform/wp7/WPApplication/rho/apps/app/Settings/wait.erb +5 -0
  393. data/platform/wp7/WPApplication/rho/apps/app/application.rb +16 -0
  394. data/platform/wp7/WPApplication/rho/apps/app/helpers/application_helper.rb +126 -0
  395. data/platform/wp7/WPApplication/rho/apps/app/helpers/browser_helper.rb +18 -0
  396. data/platform/wp7/WPApplication/rho/apps/app/index.bb.erb +26 -0
  397. data/platform/wp7/WPApplication/rho/apps/app/index.erb +26 -0
  398. data/platform/wp7/WPApplication/rho/apps/app/layout.erb +45 -0
  399. data/platform/wp7/WPApplication/rho/apps/app/loading.html +11 -0
  400. data/platform/wp7/WPApplication/rho/apps/app_manifest.txt +1 -0
  401. data/platform/wp7/WPApplication/rho/apps/public/css/android.css +330 -0
  402. data/platform/wp7/WPApplication/rho/apps/public/css/blackberry.css +115 -0
  403. data/platform/wp7/WPApplication/rho/apps/public/css/iphone.css +410 -0
  404. data/platform/wp7/WPApplication/rho/apps/public/css/windows_mobile.css +222 -0
  405. data/platform/wp7/WPApplication/rho/apps/public/images/IUI_LICENSE.txt +21 -0
  406. data/platform/wp7/WPApplication/rho/apps/public/images/android/btn_check_off.png +0 -0
  407. data/platform/wp7/WPApplication/rho/apps/public/images/android/btn_check_on.png +0 -0
  408. data/platform/wp7/WPApplication/rho/apps/public/images/android/btn_radio_off.png +0 -0
  409. data/platform/wp7/WPApplication/rho/apps/public/images/android/btn_radio_on.png +0 -0
  410. data/platform/wp7/WPApplication/rho/apps/public/images/android/disclosure.png +0 -0
  411. data/platform/wp7/WPApplication/rho/apps/public/images/android/ic_menu_more.png +0 -0
  412. data/platform/wp7/WPApplication/rho/apps/public/images/backButton.png +0 -0
  413. data/platform/wp7/WPApplication/rho/apps/public/images/blueButton.png +0 -0
  414. data/platform/wp7/WPApplication/rho/apps/public/images/cancel.png +0 -0
  415. data/platform/wp7/WPApplication/rho/apps/public/images/grayButton.png +0 -0
  416. data/platform/wp7/WPApplication/rho/apps/public/images/iphone/disclosure.png +0 -0
  417. data/platform/wp7/WPApplication/rho/apps/public/images/iphone/disclosure_detail.png +0 -0
  418. data/platform/wp7/WPApplication/rho/apps/public/images/iphone/jqtouch/backButton.png +0 -0
  419. data/platform/wp7/WPApplication/rho/apps/public/images/iphone/jqtouch/blueButton.png +0 -0
  420. data/platform/wp7/WPApplication/rho/apps/public/images/iphone/jqtouch/cancel.png +0 -0
  421. data/platform/wp7/WPApplication/rho/apps/public/images/iphone/jqtouch/chevron.png +0 -0
  422. data/platform/wp7/WPApplication/rho/apps/public/images/iphone/jqtouch/grayButton.png +0 -0
  423. data/platform/wp7/WPApplication/rho/apps/public/images/iphone/jqtouch/listArrowSel.png +0 -0
  424. data/platform/wp7/WPApplication/rho/apps/public/images/iphone/jqtouch/listGroup.png +0 -0
  425. data/platform/wp7/WPApplication/rho/apps/public/images/iphone/jqtouch/loading.gif +0 -0
  426. data/platform/wp7/WPApplication/rho/apps/public/images/iphone/jqtouch/on_off.png +0 -0
  427. data/platform/wp7/WPApplication/rho/apps/public/images/iphone/jqtouch/pinstripes.png +0 -0
  428. data/platform/wp7/WPApplication/rho/apps/public/images/iphone/jqtouch/selection.png +0 -0
  429. data/platform/wp7/WPApplication/rho/apps/public/images/iphone/jqtouch/thumb.png +0 -0
  430. data/platform/wp7/WPApplication/rho/apps/public/images/iphone/jqtouch/toggle.png +0 -0
  431. data/platform/wp7/WPApplication/rho/apps/public/images/iphone/jqtouch/toggleOn.png +0 -0
  432. data/platform/wp7/WPApplication/rho/apps/public/images/iphone/jqtouch/toolButton.png +0 -0
  433. data/platform/wp7/WPApplication/rho/apps/public/images/iphone/jqtouch/toolbar.png +0 -0
  434. data/platform/wp7/WPApplication/rho/apps/public/images/iphone/jqtouch/whiteButton.png +0 -0
  435. data/platform/wp7/WPApplication/rho/apps/public/images/iphone/radiobutton.png +0 -0
  436. data/platform/wp7/WPApplication/rho/apps/public/images/iphone/select.png +0 -0
  437. data/platform/wp7/WPApplication/rho/apps/public/images/iphone/switch.png +0 -0
  438. data/platform/wp7/WPApplication/rho/apps/public/images/iui-logo-touch-icon.png +0 -0
  439. data/platform/wp7/WPApplication/rho/apps/public/images/listArrow.png +0 -0
  440. data/platform/wp7/WPApplication/rho/apps/public/images/listArrowDown.png +0 -0
  441. data/platform/wp7/WPApplication/rho/apps/public/images/listArrowSel.png +0 -0
  442. data/platform/wp7/WPApplication/rho/apps/public/images/listGroup.png +0 -0
  443. data/platform/wp7/WPApplication/rho/apps/public/images/loading.gif +0 -0
  444. data/platform/wp7/WPApplication/rho/apps/public/images/pinstripes.png +0 -0
  445. data/platform/wp7/WPApplication/rho/apps/public/images/right_button.png +0 -0
  446. data/platform/wp7/WPApplication/rho/apps/public/images/selection.png +0 -0
  447. data/platform/wp7/WPApplication/rho/apps/public/images/thumb.png +0 -0
  448. data/platform/wp7/WPApplication/rho/apps/public/images/toggle.png +0 -0
  449. data/platform/wp7/WPApplication/rho/apps/public/images/toggleOn.png +0 -0
  450. data/platform/wp7/WPApplication/rho/apps/public/images/toolButton.png +0 -0
  451. data/platform/wp7/WPApplication/rho/apps/public/images/toolButton_new.png +0 -0
  452. data/platform/wp7/WPApplication/rho/apps/public/images/toolbar.png +0 -0
  453. data/platform/wp7/WPApplication/rho/apps/public/images/whiteButton.png +0 -0
  454. data/platform/wp7/WPApplication/rho/apps/public/jqtouch/jqtouch-iphone.css +9 -0
  455. data/platform/wp7/WPApplication/rho/apps/public/jqtouch/jqtouch.css +374 -0
  456. data/platform/wp7/WPApplication/rho/apps/public/jqtouch/jqtouch.js +742 -0
  457. data/platform/wp7/WPApplication/rho/apps/public/jqtouch/jqtouch.transitions.js +60 -0
  458. data/platform/wp7/WPApplication/rho/apps/public/jqtouch/jquery.1.3.2.min.js +19 -0
  459. data/platform/wp7/WPApplication/rho/apps/public/js/application.js +1 -0
  460. data/platform/wp7/WPApplication/rho/apps/public/js/rho.js +4 -0
  461. data/platform/wp7/WPApplication/rho/apps/public/js/rhogeolocation-wm.js +59 -0
  462. data/platform/wp7/WPApplication/rho/apps/public/js/rhogeolocation.js +11 -0
  463. data/platform/wp7/WPApplication/rho/apps/rhoconfig.txt +32 -0
  464. data/platform/wp7/WPApplication/rhoconfig.txt +32 -0
  465. data/platform/wp7/WPApplication/windows_mobile.css +222 -0
  466. data/platform/wp7/build/wp.rake +261 -0
  467. data/platform/wp7/rhodes.sln +79 -0
  468. data/platform/wp7/rhodes/App.xaml +19 -0
  469. data/platform/wp7/rhodes/App.xaml.cs +144 -0
  470. data/platform/wp7/rhodes/Background.png +0 -0
  471. data/platform/wp7/rhodes/MainPage.xaml +44 -0
  472. data/platform/wp7/rhodes/MainPage.xaml.cs +98 -0
  473. data/platform/wp7/rhodes/Properties/AppManifest.xml +6 -0
  474. data/platform/wp7/rhodes/Properties/AssemblyInfo.cs +35 -0
  475. data/platform/wp7/rhodes/Properties/WMAppManifest.xml +31 -0
  476. data/platform/wp7/rhodes/Rhodes.csproj +127 -0
  477. data/platform/wp7/rhodes/SplashScreenImage.jpg +0 -0
  478. data/platform/wp7/rhodes/icon.png +0 -0
  479. data/platform/wp7/sqlite3/Properties/AssemblyInfo.cs +35 -0
  480. data/platform/wp7/sqlite3/SQLiteClient.cs +550 -0
  481. data/platform/wp7/sqlite3/SqliteWrapper/BtreeInt_h.cs +774 -0
  482. data/platform/wp7/sqlite3/SqliteWrapper/Btree_h.cs +280 -0
  483. data/platform/wp7/sqlite3/SqliteWrapper/ClassDiagram1.cd +1306 -0
  484. data/platform/wp7/sqlite3/SqliteWrapper/Delagates.cs +365 -0
  485. data/platform/wp7/sqlite3/SqliteWrapper/Hash_h.cs +133 -0
  486. data/platform/wp7/sqlite3/SqliteWrapper/VdbeInt_h.cs +620 -0
  487. data/platform/wp7/sqlite3/SqliteWrapper/Vdbe_h.cs +302 -0
  488. data/platform/wp7/sqlite3/SqliteWrapper/_Custom.cs +449 -0
  489. data/platform/wp7/sqlite3/SqliteWrapper/alter_c.cs +872 -0
  490. data/platform/wp7/sqlite3/SqliteWrapper/analyze_c.cs +757 -0
  491. data/platform/wp7/sqlite3/SqliteWrapper/attach_c.cs +628 -0
  492. data/platform/wp7/sqlite3/SqliteWrapper/auth_c.cs +268 -0
  493. data/platform/wp7/sqlite3/SqliteWrapper/backup_c.cs +737 -0
  494. data/platform/wp7/sqlite3/SqliteWrapper/bitvec_c.cs +509 -0
  495. data/platform/wp7/sqlite3/SqliteWrapper/btmutex_c.cs +379 -0
  496. data/platform/wp7/sqlite3/SqliteWrapper/btree_c.cs +9138 -0
  497. data/platform/wp7/sqlite3/SqliteWrapper/build_c.cs +4189 -0
  498. data/platform/wp7/sqlite3/SqliteWrapper/callback_c.cs +548 -0
  499. data/platform/wp7/sqlite3/SqliteWrapper/complete_c.cs +342 -0
  500. data/platform/wp7/sqlite3/SqliteWrapper/ctime_cs.cs +408 -0
  501. data/platform/wp7/sqlite3/SqliteWrapper/date_c.cs +1317 -0
  502. data/platform/wp7/sqlite3/SqliteWrapper/delete_c.cs +726 -0
  503. data/platform/wp7/sqlite3/SqliteWrapper/expr_c.cs +4406 -0
  504. data/platform/wp7/sqlite3/SqliteWrapper/fault_c.cs +115 -0
  505. data/platform/wp7/sqlite3/SqliteWrapper/fkey_c.cs +1330 -0
  506. data/platform/wp7/sqlite3/SqliteWrapper/func_c.cs +2025 -0
  507. data/platform/wp7/sqlite3/SqliteWrapper/global_c.cs +228 -0
  508. data/platform/wp7/sqlite3/SqliteWrapper/hash_c.cs +351 -0
  509. data/platform/wp7/sqlite3/SqliteWrapper/hwtime_c.cs +101 -0
  510. data/platform/wp7/sqlite3/SqliteWrapper/insert_c.cs +2122 -0
  511. data/platform/wp7/sqlite3/SqliteWrapper/journal_c.cs +247 -0
  512. data/platform/wp7/sqlite3/SqliteWrapper/keywordhash_h.cs +302 -0
  513. data/platform/wp7/sqlite3/SqliteWrapper/legacy_c.cs +223 -0
  514. data/platform/wp7/sqlite3/SqliteWrapper/loadext_c.cs +683 -0
  515. data/platform/wp7/sqlite3/SqliteWrapper/main_c.cs +2716 -0
  516. data/platform/wp7/sqlite3/SqliteWrapper/malloc_c.cs +977 -0
  517. data/platform/wp7/sqlite3/SqliteWrapper/mem_Pool.cs +394 -0
  518. data/platform/wp7/sqlite3/SqliteWrapper/memjournal_c.cs +315 -0
  519. data/platform/wp7/sqlite3/SqliteWrapper/mutex_c.cs +182 -0
  520. data/platform/wp7/sqlite3/SqliteWrapper/mutex_h.cs +91 -0
  521. data/platform/wp7/sqlite3/SqliteWrapper/mutex_noop_c.cs +202 -0
  522. data/platform/wp7/sqlite3/SqliteWrapper/mutex_w32.cs +344 -0
  523. data/platform/wp7/sqlite3/SqliteWrapper/notify_c.cs +347 -0
  524. data/platform/wp7/sqlite3/SqliteWrapper/opcodes_c.cs +171 -0
  525. data/platform/wp7/sqlite3/SqliteWrapper/opcodes_h.cs +346 -0
  526. data/platform/wp7/sqlite3/SqliteWrapper/os_c.cs +367 -0
  527. data/platform/wp7/sqlite3/SqliteWrapper/os_common_h.cs +174 -0
  528. data/platform/wp7/sqlite3/SqliteWrapper/os_h.cs +295 -0
  529. data/platform/wp7/sqlite3/SqliteWrapper/os_win_c.cs +1255 -0
  530. data/platform/wp7/sqlite3/SqliteWrapper/pager_c.cs +6078 -0
  531. data/platform/wp7/sqlite3/SqliteWrapper/pager_h.cs +188 -0
  532. data/platform/wp7/sqlite3/SqliteWrapper/parse_c.cs +4045 -0
  533. data/platform/wp7/sqlite3/SqliteWrapper/parse_h.cs +331 -0
  534. data/platform/wp7/sqlite3/SqliteWrapper/pcache1_c.cs +969 -0
  535. data/platform/wp7/sqlite3/SqliteWrapper/pcache_c.cs +712 -0
  536. data/platform/wp7/sqlite3/SqliteWrapper/pcache_h.cs +213 -0
  537. data/platform/wp7/sqlite3/SqliteWrapper/pragma_c.cs +1767 -0
  538. data/platform/wp7/sqlite3/SqliteWrapper/prepare_c.cs +1015 -0
  539. data/platform/wp7/sqlite3/SqliteWrapper/printf_c.cs +1300 -0
  540. data/platform/wp7/sqlite3/SqliteWrapper/random_c.cs +201 -0
  541. data/platform/wp7/sqlite3/SqliteWrapper/resolve_c.cs +1396 -0
  542. data/platform/wp7/sqlite3/SqliteWrapper/rowset_c.cs +519 -0
  543. data/platform/wp7/sqlite3/SqliteWrapper/select_c.cs +4878 -0
  544. data/platform/wp7/sqlite3/SqliteWrapper/sqlite3_h.cs +6253 -0
  545. data/platform/wp7/sqlite3/SqliteWrapper/sqlite3ext_h.cs +397 -0
  546. data/platform/wp7/sqlite3/SqliteWrapper/sqliteInt_h.cs +4075 -0
  547. data/platform/wp7/sqlite3/SqliteWrapper/sqliteLimit_h.cs +214 -0
  548. data/platform/wp7/sqlite3/SqliteWrapper/sqliteicu_h.cs +39 -0
  549. data/platform/wp7/sqlite3/SqliteWrapper/status_c.cs +155 -0
  550. data/platform/wp7/sqlite3/SqliteWrapper/table_c.cs +222 -0
  551. data/platform/wp7/sqlite3/SqliteWrapper/tokenize_c.cs +673 -0
  552. data/platform/wp7/sqlite3/SqliteWrapper/trigger_c.cs +1219 -0
  553. data/platform/wp7/sqlite3/SqliteWrapper/update_c.cs +766 -0
  554. data/platform/wp7/sqlite3/SqliteWrapper/utf_c.cs +612 -0
  555. data/platform/wp7/sqlite3/SqliteWrapper/util_c.cs +1476 -0
  556. data/platform/wp7/sqlite3/SqliteWrapper/vacuum_c.cs +382 -0
  557. data/platform/wp7/sqlite3/SqliteWrapper/vdbe_c.cs +6566 -0
  558. data/platform/wp7/sqlite3/SqliteWrapper/vdbeapi_c.cs +1557 -0
  559. data/platform/wp7/sqlite3/SqliteWrapper/vdbeaux_c.cs +4019 -0
  560. data/platform/wp7/sqlite3/SqliteWrapper/vdbeblob_c.cs +396 -0
  561. data/platform/wp7/sqlite3/SqliteWrapper/vdbemem_c.cs +1480 -0
  562. data/platform/wp7/sqlite3/SqliteWrapper/vdbetrace_c.cs +181 -0
  563. data/platform/wp7/sqlite3/SqliteWrapper/vtab_c.cs +957 -0
  564. data/platform/wp7/sqlite3/SqliteWrapper/walker_c.cs +174 -0
  565. data/platform/wp7/sqlite3/SqliteWrapper/where_c.cs +4651 -0
  566. data/platform/wp7/sqlite3/sqlite3.csproj +155 -0
  567. data/rakefile.rb +60 -2
  568. data/res/build-tools/7za.exe +0 -0
  569. data/res/build-tools/RhoAppRunner.exe +0 -0
  570. data/res/build-tools/xruby-0.3.3.jar +0 -0
  571. data/res/generators/rhogen.rb +9 -1
  572. data/res/generators/templates/application/app/Settings/reset.erb +1 -1
  573. data/res/generators/templates/application/app/layout.erb +17 -10
  574. data/res/generators/templates/application/build.yml +5 -3
  575. data/res/generators/templates/application/public/jqtouch/changes.txt +20 -0
  576. data/res/generators/templates/application/public/jqtouch/jqtouch.js +12 -4
  577. data/res/generators/templates/application/public/jqtouch/jquery.1.3.2.min.js +1 -1
  578. data/res/generators/templates/application/public/js/wp7.js +7 -0
  579. data/res/generators/templates/model/controller.rb +5 -6
  580. data/rhobuild.yml.example +1 -0
  581. data/rhodes.gemspec +2 -1
  582. data/spec/framework_spec/app/spec/core/dir/close_spec.rb +1 -1
  583. data/spec/framework_spec/app/spec/core/dir/shared/pwd.rb +13 -11
  584. data/spec/framework_spec/app/spec/core/env/shared/store.rb +12 -10
  585. data/spec/framework_spec/app/spec/core/env/update_spec.rb +1 -0
  586. data/spec/framework_spec/app/spec/core/file/expand_path_spec.rb +3 -2
  587. data/spec/framework_spec/app/spec/core/file/fixtures/file_types.rb +7 -1
  588. data/spec/framework_spec/app/spec/core/file/flock_spec.rb +8 -1
  589. data/spec/framework_spec/app/spec/core/file/ftype_spec.rb +5 -3
  590. data/spec/framework_spec/app/spec/core/file/lchmod_spec.rb +1 -1
  591. data/spec/framework_spec/app/spec/core/file/setgid_spec.rb +1 -1
  592. data/spec/framework_spec/app/spec/core/file/setuid_spec.rb +1 -1
  593. data/spec/framework_spec/app/spec/core/file/stat/ftype_spec.rb +6 -4
  594. data/spec/framework_spec/app/spec/core/file/truncate_spec.rb +5 -1
  595. data/spec/framework_spec/app/spec/core/float/to_s_spec.rb +1 -1
  596. data/spec/framework_spec/app/spec/core/process/gid_spec.rb +5 -3
  597. data/spec/framework_spec/app/spec/core/process/groups_spec.rb +11 -9
  598. data/spec/framework_spec/app/spec/core/process/uid_spec.rb +5 -3
  599. data/spec/framework_spec/app/spec/language/execution_spec.rb +10 -6
  600. data/spec/framework_spec/app/spec/shared/file/directory.rb +6 -1
  601. data/spec/framework_spec/app/spec/shared/file/executable.rb +7 -1
  602. data/spec/framework_spec/app/spec/shared/file/file.rb +6 -1
  603. data/spec/framework_spec/app/spec/shared/file/readable.rb +13 -4
  604. data/spec/framework_spec/app/spec/shared/file/writable.rb +6 -1
  605. data/spec/phone_spec/app/spec/rho_controller_spec.rb +11 -0
  606. data/spec/phone_spec/app/spec/rho_spec.rb +11 -0
  607. data/spec/phone_spec/app/spec/rhom_object_spec.rb +102 -6
  608. data/spec/phone_spec/app/spec/string/end_with_spec.rb +4 -1
  609. data/spec/phone_spec/app/spec/string/slice_spec.rb +5 -1
  610. data/spec/phone_spec/app/spec/string/start_with_spec.rb +4 -0
  611. data/spec/phone_spec/app/spec/syncengine_spec.rb +73 -6
  612. data/spec/phone_spec/app/spec_runner.rb +7 -3
  613. metadata +380 -41
  614. data/Manifest.txt +0 -5819
  615. data/platform/bb/Hsqldb/Hsqldb.cso +0 -5
  616. data/platform/bb/Hsqldb/Hsqldb.jdp +0 -197
  617. data/platform/bb/RhoBundle/RhoBundle.cso +0 -5
  618. data/platform/bb/RhoBundle/RhoBundle.jdp +0 -42
  619. data/platform/bb/RubyVM/RubyVM.cso +0 -5
  620. data/platform/bb/RubyVM/RubyVM.jdp +0 -467
  621. data/platform/bb/rhodes/rhodes.csl +0 -3
  622. data/platform/bb/rhodes/rhodes.cso +0 -5
  623. data/platform/bb/rhodes/rhodes.jdp +0 -104
@@ -0,0 +1,1300 @@
1
+ using System;
2
+ using System.Diagnostics;
3
+ using System.Runtime.InteropServices;
4
+ using System.Text;
5
+
6
+ namespace Community.CsharpSqlite
7
+ {
8
+ using etByte = System.Boolean;
9
+ using i64 = System.Int64;
10
+ using u64 = System.UInt64;
11
+ using LONGDOUBLE_TYPE = System.Double;
12
+ using sqlite_u3264 = System.UInt64;
13
+ using va_list = System.Object;
14
+
15
+ public partial class Sqlite3
16
+ {
17
+ /*
18
+ ** The "printf" code that follows dates from the 1980's. It is in
19
+ ** the public domain. The original comments are included here for
20
+ ** completeness. They are very out-of-date but might be useful as
21
+ ** an historical reference. Most of the "enhancements" have been backed
22
+ ** out so that the functionality is now the same as standard printf().
23
+ **
24
+ **************************************************************************
25
+ **
26
+ ** The following modules is an enhanced replacement for the "printf" subroutines
27
+ ** found in the standard C library. The following enhancements are
28
+ ** supported:
29
+ **
30
+ ** + Additional functions. The standard set of "printf" functions
31
+ ** includes printf, fprintf, sprintf, vprintf, vfprintf, and
32
+ ** vsprintf. This module adds the following:
33
+ **
34
+ ** * snprintf -- Works like sprintf, but has an extra argument
35
+ ** which is the size of the buffer written to.
36
+ **
37
+ ** * mprintf -- Similar to sprintf. Writes output to memory
38
+ ** obtained from malloc.
39
+ **
40
+ ** * xprintf -- Calls a function to dispose of output.
41
+ **
42
+ ** * nprintf -- No output, but returns the number of characters
43
+ ** that would have been output by printf.
44
+ **
45
+ ** * A v- version (ex: vsnprintf) of every function is also
46
+ ** supplied.
47
+ **
48
+ ** + A few extensions to the formatting notation are supported:
49
+ **
50
+ ** * The "=" flag (similar to "-") causes the output to be
51
+ ** be centered in the appropriately sized field.
52
+ **
53
+ ** * The %b field outputs an integer in binary notation.
54
+ **
55
+ ** * The %c field now accepts a precision. The character output
56
+ ** is repeated by the number of times the precision specifies.
57
+ **
58
+ ** * The %' field works like %c, but takes as its character the
59
+ ** next character of the format string, instead of the next
60
+ ** argument. For example, printf("%.78'-") prints 78 minus
61
+ ** signs, the same as printf("%.78c",'-').
62
+ **
63
+ ** + When compiled using GCC on a SPARC, this version of printf is
64
+ ** faster than the library printf for SUN OS 4.1.
65
+ **
66
+ ** + All functions are fully reentrant.
67
+ **
68
+ *************************************************************************
69
+ ** Included in SQLite3 port to C#-SQLite; 2008 Noah B Hart
70
+ ** C#-SQLite is an independent reimplementation of the SQLite software library
71
+ **
72
+ ** SQLITE_SOURCE_ID: 2010-03-09 19:31:43 4ae453ea7be69018d8c16eb8dabe05617397dc4dy
73
+ **
74
+ ** $Header$
75
+ *************************************************************************
76
+ */
77
+ //#include "sqliteInt.h"
78
+
79
+ /*
80
+ ** Conversion types fall into various categories as defined by the
81
+ ** following enumeration.
82
+ */
83
+ //#define etRADIX 1 /* Integer types. %d, %x, %o, and so forth */
84
+ //#define etFLOAT 2 /* Floating point. %f */
85
+ //#define etEXP 3 /* Exponentional notation. %e and %E */
86
+ //#define etGENERIC 4 /* Floating or exponential, depending on exponent. %g */
87
+ //#define etSIZE 5 /* Return number of characters processed so far. %n */
88
+ //#define etSTRING 6 /* Strings. %s */
89
+ //#define etDYNSTRING 7 /* Dynamically allocated strings. %z */
90
+ //#define etPERCENT 8 /* Percent symbol. %% */
91
+ //#define etCHARX 9 /* Characters. %c */
92
+ ///* The rest are extensions, not normally found in printf() */
93
+ //#define etSQLESCAPE 10 /* Strings with '\'' doubled. %q */
94
+ //#define etSQLESCAPE2 11 /* Strings with '\'' doubled and enclosed in '',
95
+ // NULL pointers replaced by SQL NULL. %Q */
96
+ //#define etTOKEN 12 /* a pointer to a Token structure */
97
+ //#define etSRCLIST 13 /* a pointer to a SrcList */
98
+ //#define etPOINTER 14 /* The %p conversion */
99
+ //#define etSQLESCAPE3 15 /* %w -> Strings with '\"' doubled */
100
+ //#define etORDINAL 16 /* %r -> 1st, 2nd, 3rd, 4th, etc. English only */
101
+
102
+ //#define etINVALID 0 /* Any unrecognized conversion type */
103
+
104
+ const int etRADIX = 1; /* Integer types. %d, %x, %o, and so forth */
105
+ const int etFLOAT = 2; /* Floating point. %f */
106
+ const int etEXP = 3; /* Exponentional notation. %e and %E */
107
+ const int etGENERIC = 4; /* Floating or exponential, depending on exponent. %g */
108
+ const int etSIZE = 5; /* Return number of characters processed so far. %n */
109
+ const int etSTRING = 6; /* Strings. %s */
110
+ const int etDYNSTRING = 7; /* Dynamically allocated strings. %z */
111
+ const int etPERCENT = 8; /* Percent symbol. %% */
112
+ const int etCHARX = 9; /* Characters. %c */
113
+ /* The rest are extensions, not normally found in printf() */
114
+ const int etSQLESCAPE = 10; /* Strings with '\'' doubled. %q */
115
+ const int etSQLESCAPE2 = 11; /* Strings with '\'' doubled and enclosed in '',
116
+ NULL pointers replaced by SQL NULL. %Q */
117
+ const int etTOKEN = 12; /* a pointer to a Token structure */
118
+ const int etSRCLIST = 13; /* a pointer to a SrcList */
119
+ const int etPOINTER = 14; /* The %p conversion */
120
+ const int etSQLESCAPE3 = 15; /* %w . Strings with '\"' doubled */
121
+ const int etORDINAL = 16; /* %r . 1st, 2nd, 3rd, 4th, etc. English only */
122
+ const int etINVALID = 0; /* Any unrecognized conversion type */
123
+
124
+ /*
125
+ ** An "etByte" is an 8-bit unsigned value.
126
+ */
127
+ //typedef unsigned char etByte;
128
+
129
+ /*
130
+ ** Each builtin conversion character (ex: the 'd' in "%d") is described
131
+ ** by an instance of the following structure
132
+ */
133
+ public class et_info
134
+ { /* Information about each format field */
135
+ public char fmttype; /* The format field code letter */
136
+ public byte _base; /* The _base for radix conversion */
137
+ public byte flags; /* One or more of FLAG_ constants below */
138
+ public byte type; /* Conversion paradigm */
139
+ public byte charset; /* Offset into aDigits[] of the digits string */
140
+ public byte prefix; /* Offset into aPrefix[] of the prefix string */
141
+ /*
142
+ * Constructor
143
+ */
144
+ public et_info( char fmttype,
145
+ byte _base,
146
+ byte flags,
147
+ byte type,
148
+ byte charset,
149
+ byte prefix
150
+ )
151
+ {
152
+ this.fmttype = fmttype;
153
+ this._base = _base;
154
+ this.flags = flags;
155
+ this.type = type;
156
+ this.charset = charset;
157
+ this.prefix = prefix;
158
+ }
159
+
160
+ }
161
+
162
+ /*
163
+ ** Allowed values for et_info.flags
164
+ */
165
+ const byte FLAG_SIGNED = 1; /* True if the value to convert is signed */
166
+ const byte FLAG_INTERN = 2; /* True if for internal use only */
167
+ const byte FLAG_STRING = 4; /* Allow infinity precision */
168
+
169
+
170
+ /*
171
+ ** The following table is searched linearly, so it is good to put the
172
+ ** most frequently used conversion types first.
173
+ */
174
+ static string aDigits = "0123456789ABCDEF0123456789abcdef";
175
+ static string aPrefix = "-x0\000X0";
176
+ static et_info[] fmtinfo = new et_info[] {
177
+ new et_info( 'd', 10, 1, etRADIX, 0, 0 ),
178
+ new et_info( 's', 0, 4, etSTRING, 0, 0 ),
179
+ new et_info( 'g', 0, 1, etGENERIC, 30, 0 ),
180
+ new et_info( 'z', 0, 4, etDYNSTRING, 0, 0 ),
181
+ new et_info( 'q', 0, 4, etSQLESCAPE, 0, 0 ),
182
+ new et_info( 'Q', 0, 4, etSQLESCAPE2, 0, 0 ),
183
+ new et_info( 'w', 0, 4, etSQLESCAPE3, 0, 0 ),
184
+ new et_info( 'c', 0, 0, etCHARX, 0, 0 ),
185
+ new et_info( 'o', 8, 0, etRADIX, 0, 2 ),
186
+ new et_info( 'u', 10, 0, etRADIX, 0, 0 ),
187
+ new et_info( 'x', 16, 0, etRADIX, 16, 1 ),
188
+ new et_info( 'X', 16, 0, etRADIX, 0, 4 ),
189
+ #if !SQLITE_OMIT_FLOATING_POINT
190
+ new et_info( 'f', 0, 1, etFLOAT, 0, 0 ),
191
+ new et_info( 'e', 0, 1, etEXP, 30, 0 ),
192
+ new et_info( 'E', 0, 1, etEXP, 14, 0 ),
193
+ new et_info( 'G', 0, 1, etGENERIC, 14, 0 ),
194
+ #endif
195
+ new et_info( 'i', 10, 1, etRADIX, 0, 0 ),
196
+ new et_info( 'n', 0, 0, etSIZE, 0, 0 ),
197
+ new et_info( '%', 0, 0, etPERCENT, 0, 0 ),
198
+ new et_info( 'p', 16, 0, etPOINTER, 0, 1 ),
199
+
200
+ /* All the rest have the FLAG_INTERN bit set and are thus for internal
201
+ ** use only */
202
+ new et_info( 'T', 0, 2, etTOKEN, 0, 0 ),
203
+ new et_info( 'S', 0, 2, etSRCLIST, 0, 0 ),
204
+ new et_info( 'r', 10, 3, etORDINAL, 0, 0 ),
205
+ };
206
+ /*
207
+ ** If SQLITE_OMIT_FLOATING_POINT is defined, then none of the floating point
208
+ ** conversions will work.
209
+ */
210
+ #if !SQLITE_OMIT_FLOATING_POINT
211
+ /*
212
+ ** "*val" is a double such that 0.1 <= *val < 10.0
213
+ ** Return the ascii code for the leading digit of *val, then
214
+ ** multiply "*val" by 10.0 to renormalize.
215
+ **
216
+ ** Example:
217
+ ** input: *val = 3.14159
218
+ ** output: *val = 1.4159 function return = '3'
219
+ **
220
+ ** The counter *cnt is incremented each time. After counter exceeds
221
+ ** 16 (the number of significant digits in a 64-bit float) '0' is
222
+ ** always returned.
223
+ */
224
+ static char et_getdigit( ref LONGDOUBLE_TYPE val, ref int cnt )
225
+ {
226
+ int digit;
227
+ LONGDOUBLE_TYPE d;
228
+ if ( cnt++ >= 16 ) return '\0';
229
+ digit = (int)val;
230
+ d = digit;
231
+ //digit += '0';
232
+ val = ( val - d ) * 10.0;
233
+ return (char)digit;
234
+ }
235
+ #endif // * SQLITE_OMIT_FLOATING_POINT */
236
+
237
+ /*
238
+ ** Append N space characters to the given string buffer.
239
+ */
240
+ static void appendSpace( StrAccum pAccum, int N )
241
+ {
242
+ //static const char zSpaces[] = " ";
243
+ //while( N>=zSpaces.Length-1 ){
244
+ // sqlite3StrAccumAppend(pAccum, zSpaces, zSpaces.Length-1);
245
+ // N -= zSpaces.Length-1;
246
+ //}
247
+ //if( N>0 ){
248
+ // sqlite3StrAccumAppend(pAccum, zSpaces, N);
249
+ //}
250
+ pAccum.zText.AppendFormat( "{0," + N + "}", "" );
251
+ }
252
+
253
+ /*
254
+ ** On machines with a small stack size, you can redefine the
255
+ ** SQLITE_PRINT_BUF_SIZE to be less than 350.
256
+ */
257
+ #if !SQLITE_PRINT_BUF_SIZE
258
+ # if (SQLITE_SMALL_STACK)
259
+ const int SQLITE_PRINT_BUF_SIZE = 50;
260
+ # else
261
+ const int SQLITE_PRINT_BUF_SIZE = 350;
262
+ #endif
263
+ #endif
264
+ const int etBUFSIZE = SQLITE_PRINT_BUF_SIZE; /* Size of the output buffer */
265
+
266
+ /*
267
+ ** The root program. All variations call this core.
268
+ **
269
+ ** INPUTS:
270
+ ** func This is a pointer to a function taking three arguments
271
+ ** 1. A pointer to anything. Same as the "arg" parameter.
272
+ ** 2. A pointer to the list of characters to be output
273
+ ** (Note, this list is NOT null terminated.)
274
+ ** 3. An integer number of characters to be output.
275
+ ** (Note: This number might be zero.)
276
+ **
277
+ ** arg This is the pointer to anything which will be passed as the
278
+ ** first argument to "func". Use it for whatever you like.
279
+ **
280
+ ** fmt This is the format string, as in the usual print.
281
+ **
282
+ ** ap This is a pointer to a list of arguments. Same as in
283
+ ** vfprint.
284
+ **
285
+ ** OUTPUTS:
286
+ ** The return value is the total number of characters sent to
287
+ ** the function "func". Returns -1 on a error.
288
+ **
289
+ ** Note that the order in which automatic variables are declared below
290
+ ** seems to make a big difference in determining how fast this beast
291
+ ** will run.
292
+ */
293
+ static char[] buf = new char[etBUFSIZE]; /* Conversion buffer */
294
+ static void sqlite3VXPrintf(
295
+ StrAccum pAccum, /* Accumulate results here */
296
+ int useExtended, /* Allow extended %-conversions */
297
+ string fmt, /* Format string */
298
+ va_list[] ap /* arguments */
299
+ )
300
+ {
301
+ int c; /* Next character in the format string */
302
+ int bufpt; /* Pointer to the conversion buffer */
303
+ int precision; /* Precision of the current field */
304
+ int length; /* Length of the field */
305
+ int idx; /* A general purpose loop counter */
306
+ int width; /* Width of the current field */
307
+ etByte flag_leftjustify; /* True if "-" flag is present */
308
+ etByte flag_plussign; /* True if "+" flag is present */
309
+ etByte flag_blanksign; /* True if " " flag is present */
310
+ etByte flag_alternateform; /* True if "#" flag is present */
311
+ etByte flag_altform2; /* True if "!" flag is present */
312
+ etByte flag_zeropad; /* True if field width constant starts with zero */
313
+ etByte flag_long; /* True if "l" flag is present */
314
+ etByte flag_longlong; /* True if the "ll" flag is present */
315
+ etByte done; /* Loop termination flag */
316
+ i64 longvalue;
317
+ LONGDOUBLE_TYPE realvalue; /* Value for real types */
318
+ et_info infop; /* Pointer to the appropriate info structure */
319
+ //char[] buf = new char[etBUFSIZE]; /* Conversion buffer */
320
+ char prefix; /* Prefix character. "+" or "-" or " " or '\0'. */
321
+ byte xtype = 0; /* Conversion paradigm */
322
+ // Not used in C# -- string zExtra; /* Extra memory used for etTCLESCAPE conversions */
323
+ #if !SQLITE_OMIT_FLOATING_POINT
324
+ int exp, e2; /* exponent of real numbers */
325
+ double rounder; /* Used for rounding floating point values */
326
+ etByte flag_dp; /* True if decimal point should be shown */
327
+ etByte flag_rtz; /* True if trailing zeros should be removed */
328
+ etByte flag_exp; /* True to force display of the exponent */
329
+ int nsd; /* Number of significant digits returned */
330
+ #endif
331
+ length = 0;
332
+ bufpt = 0;
333
+ int _fmt = 0; // Work around string pointer
334
+ fmt += '\0';
335
+
336
+ for ( ; _fmt <= fmt.Length && ( c = fmt[_fmt] ) != 0; ++_fmt )
337
+ {
338
+ if ( c != '%' )
339
+ {
340
+ int amt;
341
+ bufpt = _fmt;
342
+ amt = 1;
343
+ while ( _fmt < fmt.Length && ( c = ( fmt[++_fmt] ) ) != '%' && c != 0 ) amt++;
344
+ sqlite3StrAccumAppend( pAccum, fmt.Substring( bufpt, amt ), amt );
345
+ if ( c == 0 ) break;
346
+ }
347
+ if ( _fmt < fmt.Length && ( c = ( fmt[++_fmt] ) ) == 0 )
348
+ {
349
+ sqlite3StrAccumAppend( pAccum, "%", 1 );
350
+ break;
351
+ }
352
+ /* Find out what flags are present */
353
+ flag_leftjustify = flag_plussign = flag_blanksign =
354
+ flag_alternateform = flag_altform2 = flag_zeropad = false;
355
+ done = false;
356
+ do
357
+ {
358
+ switch ( c )
359
+ {
360
+ case '-': flag_leftjustify = true; break;
361
+ case '+': flag_plussign = true; break;
362
+ case ' ': flag_blanksign = true; break;
363
+ case '#': flag_alternateform = true; break;
364
+ case '!': flag_altform2 = true; break;
365
+ case '0': flag_zeropad = true; break;
366
+ default: done = true; break;
367
+ }
368
+ } while ( !done && _fmt < fmt.Length - 1 && ( c = ( fmt[++_fmt] ) ) != 0 );
369
+ /* Get the field width */
370
+ width = 0;
371
+ if ( c == '*' )
372
+ {
373
+ width = (int)va_arg( ap, "int" );
374
+ if ( width < 0 )
375
+ {
376
+ flag_leftjustify = true;
377
+ width = -width;
378
+ }
379
+ c = fmt[++_fmt];
380
+ }
381
+ else
382
+ {
383
+ while ( c >= '0' && c <= '9' )
384
+ {
385
+ width = width * 10 + c - '0';
386
+ c = fmt[++_fmt];
387
+ }
388
+ }
389
+ if ( width > etBUFSIZE - 10 )
390
+ {
391
+ width = etBUFSIZE - 12;
392
+ }
393
+ /* Get the precision */
394
+ if ( c == '.' )
395
+ {
396
+ precision = 0;
397
+ c = fmt[++_fmt];
398
+ if ( c == '*' )
399
+ {
400
+ precision = (int)va_arg( ap, "int" );
401
+ if ( precision < 0 ) precision = -precision;
402
+ c = fmt[++_fmt];
403
+ }
404
+ else
405
+ {
406
+ while ( c >= '0' && c <= '9' )
407
+ {
408
+ precision = precision * 10 + c - '0';
409
+ c = fmt[++_fmt];
410
+ }
411
+ }
412
+ }
413
+ else
414
+ {
415
+ precision = -1;
416
+ }
417
+ /* Get the conversion type modifier */
418
+ if ( c == 'l' )
419
+ {
420
+ flag_long = true;
421
+ c = fmt[++_fmt];
422
+ if ( c == 'l' )
423
+ {
424
+ flag_longlong = true;
425
+ c = fmt[++_fmt];
426
+ }
427
+ else
428
+ {
429
+ flag_longlong = false;
430
+ }
431
+ }
432
+ else
433
+ {
434
+ flag_long = flag_longlong = false;
435
+ }
436
+ /* Fetch the info entry for the field */
437
+ infop = fmtinfo[0];
438
+ xtype = etINVALID;
439
+ for ( idx = 0; idx < ArraySize( fmtinfo ); idx++ )
440
+ {
441
+ if ( c == fmtinfo[idx].fmttype )
442
+ {
443
+ infop = fmtinfo[idx];
444
+ if ( useExtended != 0 || ( infop.flags & FLAG_INTERN ) == 0 )
445
+ {
446
+ xtype = infop.type;
447
+ }
448
+ else
449
+ {
450
+ return;
451
+ }
452
+ break;
453
+ }
454
+ }
455
+ //zExtra = null;
456
+
457
+ /* Limit the precision to prevent overflowing buf[] during conversion */
458
+ if ( precision > etBUFSIZE - 40 && ( infop.flags & FLAG_STRING ) == 0 )
459
+ {
460
+ precision = etBUFSIZE - 40;
461
+ }
462
+
463
+ /*
464
+ ** At this point, variables are initialized as follows:
465
+ **
466
+ ** flag_alternateform TRUE if a '#' is present.
467
+ ** flag_altform2 TRUE if a '!' is present.
468
+ ** flag_plussign TRUE if a '+' is present.
469
+ ** flag_leftjustify TRUE if a '-' is present or if the
470
+ ** field width was negative.
471
+ ** flag_zeropad TRUE if the width began with 0.
472
+ ** flag_long TRUE if the letter 'l' (ell) prefixed
473
+ ** the conversion character.
474
+ ** flag_longlong TRUE if the letter 'll' (ell ell) prefixed
475
+ ** the conversion character.
476
+ ** flag_blanksign TRUE if a ' ' is present.
477
+ ** width The specified field width. This is
478
+ ** always non-negative. Zero is the default.
479
+ ** precision The specified precision. The default
480
+ ** is -1.
481
+ ** xtype The class of the conversion.
482
+ ** infop Pointer to the appropriate info struct.
483
+ */
484
+ switch ( xtype )
485
+ {
486
+ case etPOINTER:
487
+ flag_longlong = true;// char*.Length == sizeof(i64);
488
+ flag_long = false;// char*.Length == sizeof(long);
489
+ /* Fall through into the next case */
490
+ goto case etRADIX;
491
+ case etORDINAL:
492
+ case etRADIX:
493
+ if ( ( infop.flags & FLAG_SIGNED ) != 0 )
494
+ {
495
+ i64 v;
496
+ if ( flag_longlong )
497
+ {
498
+ v = (long)va_arg( ap, "i64" );
499
+ }
500
+ else if ( flag_long )
501
+ {
502
+ v = (long)va_arg( ap, "long int" );
503
+ }
504
+ else
505
+ {
506
+ v = (int)va_arg( ap, "int" );
507
+ }
508
+ if ( v < 0 )
509
+ {
510
+ longvalue = -v;
511
+ prefix = '-';
512
+ }
513
+ else
514
+ {
515
+ longvalue = v;
516
+ if ( flag_plussign ) prefix = '+';
517
+ else if ( flag_blanksign ) prefix = ' ';
518
+ else prefix = '\0';
519
+ }
520
+ }
521
+ else
522
+ {
523
+ if ( flag_longlong )
524
+ {
525
+ longvalue = (i64)va_arg( ap, "longlong int" );
526
+ }
527
+ else if ( flag_long )
528
+ {
529
+ longvalue = (i64)va_arg( ap, "long int" );
530
+ }
531
+ else
532
+ {
533
+ longvalue = (i64)va_arg( ap, "long" );
534
+ }
535
+ prefix = '\0';
536
+ }
537
+ if ( longvalue == 0 ) flag_alternateform = false;
538
+ if ( flag_zeropad && precision < width - ( ( prefix != '\0' ) ? 1 : 0 ) )
539
+ {
540
+ precision = width - ( ( prefix != '\0' ) ? 1 : 0 );
541
+ }
542
+ bufpt = buf.Length;//[etBUFSIZE-1];
543
+ char[] _bufOrd = null;
544
+ if ( xtype == etORDINAL )
545
+ {
546
+ char[] zOrd = "thstndrd".ToCharArray();
547
+ int x = (int)( longvalue % 10 );
548
+ if ( x >= 4 || ( longvalue / 10 ) % 10 == 1 )
549
+ {
550
+ x = 0;
551
+ }
552
+ _bufOrd = new char[2];
553
+ _bufOrd[0] = zOrd[x * 2];
554
+ _bufOrd[1] = zOrd[x * 2 + 1];
555
+ //bufpt -= 2;
556
+ }
557
+ {
558
+
559
+ char[] _buf;
560
+ switch ( infop._base )
561
+ {
562
+ case 16:
563
+ _buf = longvalue.ToString( "x" ).ToCharArray();
564
+ break;
565
+ case 8:
566
+ _buf = Convert.ToString( (long)longvalue, 8 ).ToCharArray();
567
+ break;
568
+ default:
569
+ {
570
+ if ( flag_zeropad )
571
+ _buf = longvalue.ToString( new string( '0', width - ( ( prefix != '\0' ) ? 1 : 0 ) ) ).ToCharArray();
572
+ else
573
+ _buf = longvalue.ToString().ToCharArray();
574
+ }
575
+ break;
576
+ }
577
+ bufpt = buf.Length - _buf.Length - ( _bufOrd == null ? 0 : 2 );
578
+ Array.Copy( _buf, 0, buf, bufpt, _buf.Length );
579
+ if ( _bufOrd != null )
580
+ {
581
+ buf[buf.Length - 1] = _bufOrd[1];
582
+ buf[buf.Length - 2] = _bufOrd[0];
583
+ }
584
+ //char* cset; /* Use registers for speed */
585
+ //int _base;
586
+ //cset = aDigits[infop.charset];
587
+ //_base = infop._base;
588
+ //do
589
+ //{ /* Convert to ascii */
590
+ // *(--bufpt) = cset[longvalue % (ulong)_base];
591
+ // longvalue = longvalue / (ulong)_base;
592
+ //} while (longvalue > 0);
593
+ }
594
+ length = buf.Length - bufpt;//length = (int)(&buf[etBUFSIZE-1]-bufpt);
595
+ for ( idx = precision - length; idx > 0; idx-- )
596
+ {
597
+ buf[( --bufpt )] = '0'; /* Zero pad */
598
+ }
599
+ if ( prefix != '\0' ) buf[--bufpt] = prefix; /* Add sign */
600
+ if ( flag_alternateform && infop.prefix != 0 )
601
+ { /* Add "0" or "0x" */
602
+ int pre;
603
+ char x;
604
+ pre = infop.prefix;
605
+ for ( ; ( x = aPrefix[pre] ) != 0; pre++ ) buf[--bufpt] = x;
606
+ }
607
+ length = buf.Length - bufpt;//length = (int)(&buf[etBUFSIZE-1]-bufpt);
608
+ break;
609
+ case etFLOAT:
610
+ case etEXP:
611
+ case etGENERIC:
612
+ realvalue = (double)va_arg( ap, "double" );
613
+ #if SQLITE_OMIT_FLOATING_POINT
614
+ length = 0;
615
+ #else
616
+ if (precision < 0) precision = 6; /* Set default precision */
617
+ if ( precision > etBUFSIZE / 2 - 10 ) precision = etBUFSIZE / 2 - 10;
618
+ if ( realvalue < 0.0 )
619
+ {
620
+ realvalue = -realvalue;
621
+ prefix = '-';
622
+ }
623
+ else
624
+ {
625
+ if ( flag_plussign ) prefix = '+';
626
+ else if ( flag_blanksign ) prefix = ' ';
627
+ else prefix = '\0';
628
+ }
629
+ if ( xtype == etGENERIC && precision > 0 ) precision--;
630
+ #if FALSE
631
+ /* Rounding works like BSD when the constant 0.4999 is used. Wierd! */
632
+ for(idx=precision, rounder=0.4999; idx>0; idx--, rounder*=0.1);
633
+ #else
634
+ /* It makes more sense to use 0.5 */
635
+ for ( idx = precision, rounder = 0.5; idx > 0; idx--, rounder *= 0.1 ) { }
636
+ #endif
637
+ if ( xtype == etFLOAT ) realvalue += rounder;
638
+ /* Normalize realvalue to within 10.0 > realvalue >= 1.0 */
639
+ exp = 0;
640
+ double d = 0;
641
+ if ( Double.IsNaN( realvalue ) || !( Double.TryParse( Convert.ToString( realvalue ), out d ) ) )//if( sqlite3IsNaN((double)realvalue) )
642
+ {
643
+ buf[0] = 'N'; buf[1] = 'a'; buf[2] = 'N';// "NaN"
644
+ length = 3;
645
+ break;
646
+ }
647
+ if ( realvalue > 0.0 )
648
+ {
649
+ while ( realvalue >= 1e32 && exp <= 350 ) { realvalue *= 1e-32; exp += 32; }
650
+ while ( realvalue >= 1e8 && exp <= 350 ) { realvalue *= 1e-8; exp += 8; }
651
+ while ( realvalue >= 10.0 && exp <= 350 ) { realvalue *= 0.1; exp++; }
652
+ while ( realvalue < 1e-8 ) { realvalue *= 1e8; exp -= 8; }
653
+ while ( realvalue < 1.0 ) { realvalue *= 10.0; exp--; }
654
+ if ( exp > 350 )
655
+ {
656
+ if ( prefix == '-' )
657
+ {
658
+ buf[0] = '-'; buf[1] = 'I'; buf[2] = 'n'; buf[3] = 'f';// "-Inf"
659
+ bufpt = 4;
660
+ }
661
+ else if ( prefix == '+' )
662
+ {
663
+ buf[0] = '+'; buf[1] = 'I'; buf[2] = 'n'; buf[3] = 'f';// "+Inf"
664
+ bufpt = 4;
665
+ }
666
+ else
667
+ {
668
+ buf[0] = 'I'; buf[1] = 'n'; buf[2] = 'f';// "Inf"
669
+ bufpt = 3;
670
+ }
671
+ length = sqlite3Strlen30( bufpt );// sqlite3Strlen30(bufpt);
672
+ bufpt = 0;
673
+ break;
674
+ }
675
+ }
676
+ bufpt = 0;
677
+ /*
678
+ ** If the field type is etGENERIC, then convert to either etEXP
679
+ ** or etFLOAT, as appropriate.
680
+ */
681
+ flag_exp = xtype == etEXP;
682
+ if ( xtype != etFLOAT )
683
+ {
684
+ realvalue += rounder;
685
+ if ( realvalue >= 10.0 ) { realvalue *= 0.1; exp++; }
686
+ }
687
+ if ( xtype == etGENERIC )
688
+ {
689
+ flag_rtz = !flag_alternateform;
690
+ if ( exp < -4 || exp > precision )
691
+ {
692
+ xtype = etEXP;
693
+ }
694
+ else
695
+ {
696
+ precision = precision - exp;
697
+ xtype = etFLOAT;
698
+ }
699
+ }
700
+ else
701
+ {
702
+ flag_rtz = false;
703
+ }
704
+ if ( xtype == etEXP )
705
+ {
706
+ e2 = 0;
707
+ }
708
+ else
709
+ {
710
+ e2 = exp;
711
+ }
712
+ nsd = 0;
713
+ flag_dp = ( precision > 0 ? true : false ) | flag_alternateform | flag_altform2;
714
+ /* The sign in front of the number */
715
+ if ( prefix != '\0' )
716
+ {
717
+ buf[bufpt++] = prefix;
718
+ }
719
+ /* Digits prior to the decimal point */
720
+ if ( e2 < 0 )
721
+ {
722
+ buf[bufpt++] = '0';
723
+ }
724
+ else
725
+ {
726
+ for ( ; e2 >= 0; e2-- )
727
+ {
728
+ buf[bufpt++] = (char)( et_getdigit( ref realvalue, ref nsd ) + '0' ); // *(bufpt++) = et_getdigit(ref realvalue, ref nsd);
729
+ }
730
+
731
+ }
732
+ /* The decimal point */
733
+ if ( flag_dp )
734
+ {
735
+ buf[bufpt++] = '.';
736
+ }
737
+ /* "0" digits after the decimal point but before the first
738
+ ** significant digit of the number */
739
+ for ( e2++; e2 < 0; precision--, e2++ )
740
+ {
741
+ Debug.Assert( precision > 0 );
742
+ buf[bufpt++] = '0';
743
+ }
744
+ /* Significant digits after the decimal point */
745
+ while ( ( precision-- ) > 0 )
746
+ {
747
+ buf[bufpt++] = (char)( et_getdigit( ref realvalue, ref nsd ) + '0' ); // *(bufpt++) = et_getdigit(&realvalue, nsd);
748
+ }
749
+ /* Remove trailing zeros and the "." if no digits follow the "." */
750
+ if ( flag_rtz && flag_dp )
751
+ {
752
+ while ( buf[bufpt - 1] == '0' ) buf[--bufpt] = '\0';
753
+ Debug.Assert( bufpt > 0 );
754
+ if ( buf[bufpt - 1] == '.' )
755
+ {
756
+ if ( flag_altform2 )
757
+ {
758
+ buf[( bufpt++ )] = '0';
759
+ }
760
+ else
761
+ {
762
+ buf[( --bufpt )] = '0';
763
+ }
764
+ }
765
+ }
766
+ /* Add the "eNNN" suffix */
767
+ if ( flag_exp || xtype == etEXP )
768
+ {
769
+ buf[bufpt++] = aDigits[infop.charset];
770
+ if ( exp < 0 )
771
+ {
772
+ buf[bufpt++] = '-'; exp = -exp;
773
+ }
774
+ else
775
+ {
776
+ buf[bufpt++] = '+';
777
+ }
778
+ if ( exp >= 100 )
779
+ {
780
+ buf[bufpt++] = (char)( exp / 100 + '0' ); /* 100's digit */
781
+ exp %= 100;
782
+ }
783
+ buf[bufpt++] = (char)( exp / 10 + '0' ); /* 10's digit */
784
+ buf[bufpt++] = (char)( exp % 10 + '0' ); /* 1's digit */
785
+ }
786
+ //bufpt = 0;
787
+
788
+ /* The converted number is in buf[] and zero terminated. Output it.
789
+ ** Note that the number is in the usual order, not reversed as with
790
+ ** integer conversions. */
791
+ length = bufpt;//length = (int)(bufpt-buf);
792
+ bufpt = 0;
793
+
794
+ /* Special case: Add leading zeros if the flag_zeropad flag is
795
+ ** set and we are not left justified */
796
+ if ( flag_zeropad && !flag_leftjustify && length < width )
797
+ {
798
+ int i;
799
+ int nPad = width - length;
800
+ for ( i = width; i >= nPad; i-- )
801
+ {
802
+ buf[bufpt + i] = buf[bufpt + i - nPad];
803
+ }
804
+ i = ( prefix != '\0' ? 1 : 0 );
805
+ while ( nPad-- != 0 ) buf[( bufpt++ ) + i] = '0';
806
+ length = width;
807
+ bufpt = 0;
808
+ }
809
+ #endif //* !defined(SQLITE_OMIT_FLOATING_POINT) */
810
+ break;
811
+ case etSIZE:
812
+ ap[0] = pAccum.nChar; // *(va_arg(ap,int*)) = pAccum.nChar;
813
+ length = width = 0;
814
+ break;
815
+ case etPERCENT:
816
+ buf[0] = '%';
817
+ bufpt = 0;
818
+ length = 1;
819
+ break;
820
+ case etCHARX:
821
+ c = (char)va_arg( ap, "char" );
822
+ buf[0] = (char)c;
823
+ if ( precision >= 0 )
824
+ {
825
+ for ( idx = 1; idx < precision; idx++ ) buf[idx] = (char)c;
826
+ length = precision;
827
+ }
828
+ else
829
+ {
830
+ length = 1;
831
+ }
832
+ bufpt = 0;
833
+ break;
834
+ case etSTRING:
835
+ case etDYNSTRING:
836
+ bufpt = 0;//
837
+ string bufStr = (string)va_arg( ap, "string" );
838
+ if ( bufStr.Length > buf.Length ) buf = new char[bufStr.Length];
839
+ bufStr.ToCharArray().CopyTo( buf, 0 );
840
+ bufpt = bufStr.Length;
841
+ if ( bufpt == 0 )
842
+ {
843
+ buf[0] = '\0';
844
+ }
845
+ else if ( xtype == etDYNSTRING )
846
+ {
847
+ // zExtra = bufpt;
848
+ }
849
+ if ( precision >= 0 )
850
+ {
851
+ for ( length = 0; length < precision && length < bufStr.Length && buf[length] != 0; length++ ) { }
852
+ //length += precision;
853
+ }
854
+ else
855
+ {
856
+ length = sqlite3Strlen30( bufpt );
857
+ }
858
+ bufpt = 0;
859
+ break;
860
+ case etSQLESCAPE:
861
+ case etSQLESCAPE2:
862
+ case etSQLESCAPE3:
863
+ {
864
+ int i; int j; int k; int n;
865
+ bool isnull;
866
+ bool needQuote;
867
+ char ch;
868
+ char q = ( ( xtype == etSQLESCAPE3 ) ? '"' : '\'' ); /* Quote character */
869
+ string escarg = (string)va_arg( ap, "char*" ) + '\0';
870
+ isnull = ( escarg == "" || escarg == "NULL\0" );
871
+ if ( isnull ) escarg = ( xtype == etSQLESCAPE2 ) ? "NULL\0" : "(NULL)\0";
872
+ k = precision;
873
+ for (i = n = 0; k != 0 && (ch = escarg[i]) != 0; i++, k--)
874
+ {
875
+ if ( ch == q ) n++;
876
+ }
877
+ needQuote = !isnull && ( xtype == etSQLESCAPE2 );
878
+ n += i + 1 + ( needQuote ? 2 : 0 );
879
+ if ( n > etBUFSIZE )
880
+ {
881
+ buf = new char[n];//bufpt = zExtra = sqlite3Malloc(n);
882
+ //if ( bufpt == 0 )
883
+ //{
884
+ // pAccum->mallocFailed = 1;
885
+ // return;
886
+ //}
887
+ bufpt = 0; //Start of Buffer
888
+ }
889
+ else
890
+ {
891
+ //bufpt = buf;
892
+ bufpt = 0; //Start of Buffer
893
+ }
894
+ j = 0;
895
+ if ( needQuote ) buf[bufpt + j++] = q;
896
+ k = i;
897
+ for ( i = 0; i < k; i++ )
898
+ {
899
+ buf[bufpt + j++] = ch = escarg[i];
900
+ if ( ch == q ) buf[bufpt + j++] = ch;
901
+ }
902
+ if ( needQuote ) buf[bufpt + j++] = q;
903
+ buf[bufpt + j] = '\0';
904
+ length = j;
905
+ /* The precision in %q and %Q means how many input characters to
906
+ ** consume, not the length of the output...
907
+ ** if( precision>=0 && precision<length ) length = precision; */
908
+ break;
909
+ }
910
+ case etTOKEN:
911
+ {
912
+ Token pToken = (Token)va_arg( ap, "Token" );
913
+ if ( pToken != null )
914
+ {
915
+ sqlite3StrAccumAppend( pAccum, pToken.z.ToString(), (int)pToken.n );
916
+ }
917
+ length = width = 0;
918
+ break;
919
+ }
920
+ case etSRCLIST:
921
+ {
922
+ SrcList pSrc = (SrcList)va_arg( ap, "SrcList" );
923
+ int k = (int)va_arg( ap, "int" );
924
+ SrcList_item pItem = pSrc.a[k];
925
+ Debug.Assert( k >= 0 && k < pSrc.nSrc );
926
+ if ( pItem.zDatabase != null )
927
+ {
928
+ sqlite3StrAccumAppend( pAccum, pItem.zDatabase, -1 );
929
+ sqlite3StrAccumAppend( pAccum, ".", 1 );
930
+ }
931
+ sqlite3StrAccumAppend( pAccum, pItem.zName, -1 );
932
+ length = width = 0;
933
+ break;
934
+ }
935
+ default:
936
+ {
937
+ Debug.Assert( xtype == etINVALID );
938
+ return;
939
+ }
940
+ }/* End switch over the format type */
941
+ /*
942
+ ** The text of the conversion is pointed to by "bufpt" and is
943
+ ** "length" characters long. The field width is "width". Do
944
+ ** the output.
945
+ */
946
+ if ( !flag_leftjustify )
947
+ {
948
+ int nspace;
949
+ nspace = width - length;// -2;
950
+ if ( nspace > 0 )
951
+ {
952
+ appendSpace( pAccum, nspace );
953
+ }
954
+ }
955
+ if ( length > 0 )
956
+ {
957
+ sqlite3StrAccumAppend( pAccum, new string( buf, bufpt, length ), length );
958
+ }
959
+ if ( flag_leftjustify )
960
+ {
961
+ int nspace;
962
+ nspace = width - length;
963
+ if ( nspace > 0 )
964
+ {
965
+ appendSpace( pAccum, nspace );
966
+ }
967
+ }
968
+ //if( zExtra ){
969
+ // sqlite3DbFree(db,ref zExtra);
970
+ //}
971
+ }/* End for loop over the format string */
972
+ } /* End of function */
973
+
974
+ /*
975
+ ** Append N bytes of text from z to the StrAccum object.
976
+ */
977
+
978
+ static void sqlite3StrAccumAppend( StrAccum p, string z, int N )
979
+ {
980
+ Debug.Assert( z != null || N == 0 );
981
+ if ( p.tooBig != 0 )//|| p.mallocFailed != 0 )
982
+ {
983
+ testcase( p.tooBig );
984
+ //testcase( p.mallocFailed );
985
+ return;
986
+ }
987
+ if ( N < 0 )
988
+ {
989
+ N = sqlite3Strlen30( z );
990
+ }
991
+ if ( N == 0 || NEVER( z == null ) )
992
+ {
993
+ return;
994
+ }
995
+ //if ( p.nChar + N >= p.nAlloc )
996
+ //{
997
+ // char* zNew;
998
+ // if ( !p.useMalloc )
999
+ // {
1000
+ // p.tooBig = 1;
1001
+ // N = p.nAlloc - p.nChar - 1;
1002
+ // if ( N <= 0 )
1003
+ // {
1004
+ // return;
1005
+ // }
1006
+ // }
1007
+ // else
1008
+ // {
1009
+ // i64 szNew = p.nChar;
1010
+ // szNew += N + 1;
1011
+ // if ( szNew > p.mxAlloc )
1012
+ // {
1013
+ // sqlite3StrAccumReset( p );
1014
+ // p.tooBig = 1;
1015
+ // return;
1016
+ // }
1017
+ // else
1018
+ // {
1019
+ // p.nAlloc = (int)szNew;
1020
+ // }
1021
+ // zNew = sqlite3DbMalloc( p.nAlloc );
1022
+ // if ( zNew )
1023
+ // {
1024
+ // memcpy( zNew, p.zText, p.nChar );
1025
+ // sqlite3StrAccumReset( p );
1026
+ // p.zText = zNew;
1027
+ // }
1028
+ // else
1029
+ // {
1030
+ // p.mallocFailed = 1;
1031
+ // sqlite3StrAccumReset( p );
1032
+ // return;
1033
+ // }
1034
+ // }
1035
+ //}
1036
+ //memcpy( &p.zText[p.nChar], z, N );
1037
+ p.zText.Append( z.Substring( 0, N <= z.Length ? N : z.Length ) );
1038
+ p.nChar += N;
1039
+ }
1040
+
1041
+ /*
1042
+ ** Finish off a string by making sure it is zero-terminated.
1043
+ ** Return a pointer to the resulting string. Return a NULL
1044
+ ** pointer if any kind of error was encountered.
1045
+ */
1046
+ static string sqlite3StrAccumFinish( StrAccum p )
1047
+ {
1048
+ //if (p.zText.Length > 0)
1049
+ //{
1050
+ // p.zText[p.nChar] = 0;
1051
+ // if (p.useMalloc && p.zText == p.zBase)
1052
+ // {
1053
+ // p.zText = sqlite3DbMalloc(p.nChar + 1);
1054
+ // if (p.zText)
1055
+ // {
1056
+ // memcpy(p.zText, p.zBase, p.nChar + 1);
1057
+ // }
1058
+ // else
1059
+ // {
1060
+ // p.mallocFailed = 1;
1061
+ // }
1062
+ // }
1063
+ //}
1064
+ return p.zText.ToString();
1065
+ }
1066
+
1067
+ /*
1068
+ ** Reset an StrAccum string. Reclaim all malloced memory.
1069
+ */
1070
+ static void sqlite3StrAccumReset( StrAccum p )
1071
+ {
1072
+ if ( p.zText.ToString() != p.zBase.ToString() )
1073
+ {
1074
+ sqlite3DbFree( p.db, ref p.zText );
1075
+ }
1076
+ p.zText.Length = 0;
1077
+ }
1078
+
1079
+ /*
1080
+ ** Initialize a string accumulator
1081
+ */
1082
+ static void sqlite3StrAccumInit( StrAccum p, StringBuilder zBase, int n, int mx )
1083
+ {
1084
+ p.zBase.Length = 0;
1085
+ if ( p.zBase.Capacity < n ) p.zBase.Capacity = n;
1086
+ p.zText.Length = 0;
1087
+ if ( p.zText.Capacity < n ) p.zBase.Capacity = n;
1088
+ p.db = null;
1089
+ p.nChar = 0;
1090
+ p.nAlloc = n;
1091
+ p.mxAlloc = mx;
1092
+ p.useMalloc = 1;
1093
+ p.tooBig = 0;
1094
+ //p.mallocFailed = 0;
1095
+ }
1096
+ /*
1097
+ ** Print into memory obtained from sqliteMalloc(). Use the internal
1098
+ ** %-conversion extensions.
1099
+ */
1100
+ static StrAccum acc = new StrAccum(SQLITE_PRINT_BUF_SIZE);
1101
+ static string sqlite3VMPrintf( sqlite3 db, string zFormat, params va_list[] ap )
1102
+ {
1103
+ if ( zFormat == null ) return null;
1104
+ if ( ap.Length == 0 ) return zFormat;
1105
+ string z;
1106
+ Debug.Assert( db != null );
1107
+ sqlite3StrAccumInit( acc, null,SQLITE_PRINT_BUF_SIZE,
1108
+ db.aLimit[SQLITE_LIMIT_LENGTH] );
1109
+ acc.db = db;
1110
+ acc.zText.Length = 0;
1111
+ sqlite3VXPrintf( acc, 1, zFormat, ap );
1112
+ z = sqlite3StrAccumFinish( acc );
1113
+ // if ( acc.mallocFailed != 0 )
1114
+ // {
1115
+ ////// db.mallocFailed = 1;
1116
+ // }
1117
+ return z;
1118
+ }
1119
+
1120
+ /*
1121
+ ** Print into memory obtained from sqliteMalloc(). Use the internal
1122
+ ** %-conversion extensions.
1123
+ */
1124
+ static string sqlite3MPrintf( sqlite3 db, string zFormat, params va_list[] ap )
1125
+ {
1126
+ //va_list ap;
1127
+ string z;
1128
+ va_start( ap, zFormat );
1129
+ z = sqlite3VMPrintf( db, zFormat, ap );
1130
+ va_end( ap );
1131
+ return z;
1132
+ }
1133
+
1134
+ /*
1135
+ ** Like sqlite3MPrintf(), but call sqlite3DbFree() on zStr after formatting
1136
+ ** the string and before returnning. This routine is intended to be used
1137
+ ** to modify an existing string. For example:
1138
+ **
1139
+ ** x = sqlite3MPrintf(db, x, "prefix %s suffix", x);
1140
+ **
1141
+ */
1142
+ static string sqlite3MAppendf( sqlite3 db, string zStr, string zFormat, params va_list[] ap )
1143
+ {
1144
+ //va_list ap;
1145
+ string z;
1146
+ va_start( ap, zFormat );
1147
+ z = sqlite3VMPrintf( db, zFormat, ap );
1148
+ va_end( ap );
1149
+ sqlite3DbFree( db, ref zStr );
1150
+ return z;
1151
+ }
1152
+
1153
+ /*
1154
+ ** Print into memory obtained from sqlite3Malloc(). Omit the internal
1155
+ ** %-conversion extensions.
1156
+ */
1157
+ static string sqlite3_vmprintf( string zFormat, params va_list[] ap )
1158
+ {
1159
+ string z;
1160
+ //StrAccum acc = new StrAccum(SQLITE_PRINT_BUF_SIZE);
1161
+ #if !SQLITE_OMIT_AUTOINIT
1162
+ if ( sqlite3_initialize() != 0 ) return "";
1163
+ #endif
1164
+ sqlite3StrAccumInit( acc, null, SQLITE_PRINT_BUF_SIZE, SQLITE_PRINT_BUF_SIZE );//zBase).Length;
1165
+ sqlite3VXPrintf( acc, 0, zFormat, ap );
1166
+ z = sqlite3StrAccumFinish( acc );
1167
+ return z;
1168
+ }
1169
+
1170
+ /*
1171
+ ** Print into memory obtained from sqlite3Malloc()(). Omit the internal
1172
+ ** %-conversion extensions.
1173
+ */
1174
+ static public string sqlite3_mprintf( string zFormat, params va_list[] ap )
1175
+ { //, ...){
1176
+ //va_list ap;
1177
+ string z;
1178
+ #if !SQLITE_OMIT_AUTOINIT
1179
+ if ( sqlite3_initialize() != 0 ) return "";
1180
+ #endif
1181
+ va_start( ap, zFormat );
1182
+ z = sqlite3_vmprintf( zFormat, ap );
1183
+ va_end( ap );
1184
+ return z;
1185
+ }
1186
+
1187
+ /*
1188
+ ** sqlite3_snprintf() works like snprintf() except that it ignores the
1189
+ ** current locale settings. This is important for SQLite because we
1190
+ ** are not able to use a "," as the decimal point in place of "." as
1191
+ ** specified by some locales.
1192
+ */
1193
+ static public string sqlite3_snprintf(int n, ref StringBuilder zBuf, string zFormat, params va_list[] ap)
1194
+ {
1195
+ //va_list ap;
1196
+ //StrAccum acc = new StrAccum( SQLITE_PRINT_BUF_SIZE );
1197
+
1198
+ if ( n <= 0 )
1199
+ {
1200
+ return zBuf.ToString();
1201
+ }
1202
+ sqlite3StrAccumInit( acc, null, n, 0 );
1203
+ acc.useMalloc = 0;
1204
+ va_start( ap, zFormat );
1205
+ sqlite3VXPrintf( acc, 0, zFormat, ap );
1206
+ va_end( ap );
1207
+ zBuf.Length = 0;
1208
+ zBuf.Append( sqlite3StrAccumFinish( acc ) );
1209
+ if ( n - 1 < zBuf.Length ) zBuf.Length = n - 1;
1210
+ return zBuf.ToString();
1211
+ }
1212
+
1213
+ static public string sqlite3_snprintf( int n, ref string zBuf, string zFormat, params va_list[] ap )
1214
+ {
1215
+ string z;
1216
+ //va_list ap;
1217
+ //StrAccum acc = new StrAccum();
1218
+
1219
+ if ( n <= 0 )
1220
+ {
1221
+ return zBuf;
1222
+ }
1223
+ sqlite3StrAccumInit( acc, null, n, 0 );
1224
+ acc.useMalloc = 0;
1225
+ va_start( ap, zFormat );
1226
+ sqlite3VXPrintf( acc, 0, zFormat, ap );
1227
+ va_end( ap );
1228
+ z = sqlite3StrAccumFinish( acc );
1229
+ return ( zBuf = z );
1230
+ }
1231
+
1232
+ /*
1233
+ ** This is the routine that actually formats the sqlite3_log() message.
1234
+ ** We house it in a separate routine from sqlite3_log() to avoid using
1235
+ ** stack space on small-stack systems when logging is disabled.
1236
+ **
1237
+ ** sqlite3_log() must render into a static buffer. It cannot dynamically
1238
+ ** allocate memory because it might be called while the memory allocator
1239
+ ** mutex is held.
1240
+ */
1241
+ static void renderLogMsg(int iErrCode, string zFormat, params object[] ap){
1242
+ //StrAccum acc; /* String accumulator */
1243
+ //char zMsg[SQLITE_PRINT_BUF_SIZE*3]; /* Complete log message */
1244
+
1245
+ sqlite3StrAccumInit(acc, null, SQLITE_PRINT_BUF_SIZE * 3, 0);
1246
+ acc.useMalloc = 0;
1247
+ sqlite3VXPrintf(acc, 0, zFormat, ap);
1248
+ sqlite3GlobalConfig.xLog(sqlite3GlobalConfig.pLogArg, iErrCode,
1249
+ sqlite3StrAccumFinish(acc));
1250
+ }
1251
+
1252
+ /*
1253
+ ** Format and write a message to the log if logging is enabled.
1254
+ */
1255
+ static void sqlite3_log(int iErrCode, string zFormat, params va_list[] ap )
1256
+ {
1257
+ //va_list ap; /* Vararg list */
1258
+ if( sqlite3GlobalConfig.xLog != null){
1259
+ va_start(ap, zFormat);
1260
+ renderLogMsg(iErrCode, zFormat, ap);
1261
+ va_end(ap);
1262
+ }
1263
+ }
1264
+
1265
+ #if SQLITE_DEBUG || DEBUG || TRACE
1266
+ /*
1267
+ ** A version of printf() that understands %lld. Used for debugging.
1268
+ ** The printf() built into some versions of windows does not understand %lld
1269
+ ** and segfaults if you give it a long long int.
1270
+ */
1271
+ static void sqlite3DebugPrintf( string zFormat, params va_list[] ap )
1272
+ {
1273
+ //va_list ap;
1274
+ //StrAccum acc = new StrAccum();
1275
+ StringBuilder zBuf = new StringBuilder( SQLITE_PRINT_BUF_SIZE );
1276
+ sqlite3StrAccumInit( acc, zBuf, zBuf.Capacity, 0 );
1277
+ acc.useMalloc = 0;
1278
+ va_start( ap, zFormat );
1279
+ sqlite3VXPrintf( acc, 0, zFormat, ap );
1280
+ va_end( ap );
1281
+ sqlite3StrAccumFinish( acc );
1282
+ Console.Write( zBuf.ToString() );
1283
+ //fflush(stdout);
1284
+ }
1285
+ #endif
1286
+ #if !SQLITE_OMIT_TRACE
1287
+ /*
1288
+ ** variable-argument wrapper around sqlite3VXPrintf().
1289
+ */
1290
+ static void sqlite3XPrintf( StrAccum p, string zFormat, params object[] ap )
1291
+ {
1292
+ //va_list ap;
1293
+ va_start( ap, zFormat );
1294
+ sqlite3VXPrintf( p, 1, zFormat, ap );
1295
+ va_end( ap );
1296
+ }
1297
+ #endif
1298
+
1299
+ }
1300
+ }