transactd 1.2.0 → 2.0.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (306) hide show
  1. checksums.yaml +4 -4
  2. data/BUILD_UNIX-JA +46 -67
  3. data/BUILD_WIN-JA +106 -63
  4. data/CMakeLists.txt +40 -15
  5. data/README +219 -75
  6. data/README-JA +207 -76
  7. data/README_ORMSRCGEN +118 -0
  8. data/README_ORMSRCGEN-JA +115 -0
  9. data/bin/common/tdclc_32_2_0.dll +0 -0
  10. data/bin/common/tdclc_64_2_0.dll +0 -0
  11. data/build/common/check_for_link_iconv.cmake +18 -14
  12. data/build/common/create_symlink.cmake.in +25 -0
  13. data/build/common/get_boost_libs.cmake +23 -23
  14. data/build/common/options.cmake +0 -66
  15. data/build/common/smart_install.cmake +3 -3
  16. data/build/common/transactd.rc.in +15 -5
  17. data/build/common/transactd_cl_common.cmake +37 -18
  18. data/build/common/transactd_cl_output.cmake +55 -13
  19. data/build/common/transactd_common.cmake +108 -31
  20. data/build/swig/php/generate.cmake.in +15 -17
  21. data/build/swig/php/generate.cmd.in +15 -9
  22. data/build/swig/php/php.swg +124 -82
  23. data/build/swig/php/transactd.no_yield.php +4494 -0
  24. data/build/swig/php/transactd.no_yield.php.git.patch +685 -0
  25. data/build/swig/php/transactd.no_yield.php.patch +685 -0
  26. data/build/swig/php/transactd.yield.php +4461 -0
  27. data/build/swig/php/transactd.yield.php.git.patch +652 -0
  28. data/build/swig/php/transactd.yield.php.patch +652 -0
  29. data/build/swig/referencecounter.h +79 -0
  30. data/build/swig/ruby/ruby.swg +226 -76
  31. data/build/swig/ruby/threadBlockRegionWrapper.h +71 -0
  32. data/build/swig/ruby/without_gvl.swg +87 -0
  33. data/build/swig/tdcl.i +659 -170
  34. data/build/swig/validatablepointer.h +91 -0
  35. data/build/tdclc/CMakeLists.txt +49 -34
  36. data/build/tdclc/{tdclc_64.cbproj → tdclc.cbproj} +65 -20
  37. data/build/tdclc/tdclc.rc +0 -0
  38. data/build/tdclcpp/CMakeLists.txt +84 -20
  39. data/build/tdclcpp/tdclcpp.rc +0 -0
  40. data/build/tdclcpp/{tdclcpp_bcb_64.cbproj → tdclcpp_bc.cbproj} +168 -44
  41. data/build/tdclrb/CMakeLists.txt +84 -66
  42. data/build/tdclrb/bldgem/extconf.rb +28 -3
  43. data/build/tdclrb/gem/helper.rb +11 -1
  44. data/build/tdclrb/gem_output.cmake +20 -16
  45. data/index_ja.html +15 -0
  46. data/source/bzs/db/IBlobBuffer.h +15 -17
  47. data/source/bzs/db/blobBuffer.h +186 -140
  48. data/source/bzs/db/blobStructs.h +37 -37
  49. data/source/bzs/db/engine/mysql/IReadRecords.h +34 -34
  50. data/source/bzs/db/engine/mysql/bookmark.h +150 -147
  51. data/source/bzs/db/engine/mysql/database.cpp +1721 -1526
  52. data/source/bzs/db/engine/mysql/database.h +608 -370
  53. data/source/bzs/db/engine/mysql/dbManager.cpp +213 -201
  54. data/source/bzs/db/engine/mysql/dbManager.h +115 -104
  55. data/source/bzs/db/engine/mysql/errorMessage.cpp +49 -50
  56. data/source/bzs/db/engine/mysql/errorMessage.h +25 -26
  57. data/source/bzs/db/engine/mysql/fieldAccess.h +55 -61
  58. data/source/bzs/db/engine/mysql/mydebuglog.cpp +326 -292
  59. data/source/bzs/db/engine/mysql/mydebuglog.h +63 -55
  60. data/source/bzs/db/engine/mysql/mysqlInternal.h +182 -125
  61. data/source/bzs/db/engine/mysql/mysqlThd.cpp +121 -121
  62. data/source/bzs/db/engine/mysql/mysqlThd.h +20 -20
  63. data/source/bzs/db/engine/mysql/percentageKey.h +241 -228
  64. data/source/bzs/db/protocol/ICommandExecuter.h +18 -17
  65. data/source/bzs/db/protocol/hs/hsCommandExecuter.cpp +543 -514
  66. data/source/bzs/db/protocol/hs/hsCommandExecuter.h +155 -158
  67. data/source/bzs/db/protocol/tdap/btrDate.cpp +213 -180
  68. data/source/bzs/db/protocol/tdap/btrDate.h +39 -37
  69. data/source/bzs/db/protocol/tdap/client/activeTable.cpp +173 -0
  70. data/source/bzs/db/protocol/tdap/client/activeTable.h +165 -0
  71. data/source/bzs/db/protocol/tdap/client/activeTableImple.h +370 -0
  72. data/source/bzs/db/protocol/tdap/client/bulkInsert.h +13 -23
  73. data/source/bzs/db/protocol/tdap/client/client.cpp +81 -68
  74. data/source/bzs/db/protocol/tdap/client/client.h +361 -320
  75. data/source/bzs/db/protocol/tdap/client/connMgr.cpp +17 -22
  76. data/source/bzs/db/protocol/tdap/client/connMgr.h +17 -19
  77. data/source/bzs/db/protocol/tdap/client/connectionPool.cpp +243 -0
  78. data/source/bzs/db/protocol/tdap/client/connectionPool.h +109 -0
  79. data/source/bzs/db/protocol/tdap/client/database.cpp +327 -219
  80. data/source/bzs/db/protocol/tdap/client/database.h +141 -118
  81. data/source/bzs/db/protocol/tdap/client/databaseFactory.cpp +60 -62
  82. data/source/bzs/db/protocol/tdap/client/databaseManager.h +255 -0
  83. data/source/bzs/db/protocol/tdap/client/dbDef.cpp +315 -202
  84. data/source/bzs/db/protocol/tdap/client/dbDef.h +40 -32
  85. data/source/bzs/db/protocol/tdap/client/dllmain.cpp +390 -371
  86. data/source/bzs/db/protocol/tdap/client/errorMessage.cpp +148 -56
  87. data/source/bzs/db/protocol/tdap/client/errorMessage_ja.cpp +149 -57
  88. data/source/bzs/db/protocol/tdap/client/export.h +35 -0
  89. data/source/bzs/db/protocol/tdap/client/field.cpp +1985 -0
  90. data/source/bzs/db/protocol/tdap/client/field.h +393 -0
  91. data/source/bzs/db/protocol/tdap/client/fieldDDF.cpp +14 -14
  92. data/source/bzs/db/protocol/tdap/client/fieldDDF.h +11 -14
  93. data/source/bzs/db/protocol/tdap/client/fieldNameAlias.cpp +123 -0
  94. data/source/bzs/db/protocol/tdap/client/fieldNameAlias.h +58 -0
  95. data/source/bzs/db/protocol/tdap/client/fields.h +178 -0
  96. data/source/bzs/db/protocol/tdap/client/fileDDF.cpp +13 -16
  97. data/source/bzs/db/protocol/tdap/client/fileDDF.h +11 -17
  98. data/source/bzs/db/protocol/tdap/client/filter.h +423 -259
  99. data/source/bzs/db/protocol/tdap/client/groupComp.h +117 -0
  100. data/source/bzs/db/protocol/tdap/client/groupQuery.cpp +818 -0
  101. data/source/bzs/db/protocol/tdap/client/groupQuery.h +281 -0
  102. data/source/bzs/db/protocol/tdap/client/indexDDF.cpp +14 -17
  103. data/source/bzs/db/protocol/tdap/client/indexDDF.h +11 -14
  104. data/source/bzs/db/protocol/tdap/client/memRecord.cpp +231 -0
  105. data/source/bzs/db/protocol/tdap/client/memRecord.h +145 -0
  106. data/source/bzs/db/protocol/tdap/client/memRecordset.cpp +448 -0
  107. data/source/bzs/db/protocol/tdap/client/memRecordset.h +159 -0
  108. data/source/bzs/db/protocol/tdap/client/nsDatabase.cpp +300 -173
  109. data/source/bzs/db/protocol/tdap/client/nsDatabase.h +53 -36
  110. data/source/bzs/db/protocol/tdap/client/nsTable.cpp +171 -128
  111. data/source/bzs/db/protocol/tdap/client/nsTable.h +121 -87
  112. data/source/bzs/db/protocol/tdap/client/pooledDatabaseManager.h +173 -0
  113. data/source/bzs/db/protocol/tdap/client/recordset.cpp +209 -0
  114. data/source/bzs/db/protocol/tdap/client/recordset.h +86 -0
  115. data/source/bzs/db/protocol/tdap/client/recordsetImple.h +596 -0
  116. data/source/bzs/db/protocol/tdap/client/request.h +227 -170
  117. data/source/bzs/db/protocol/tdap/client/serializer.cpp +1288 -0
  118. data/source/bzs/db/protocol/tdap/client/serializer.h +295 -0
  119. data/source/bzs/db/protocol/tdap/client/sharedData.cpp +9 -12
  120. data/source/bzs/db/protocol/tdap/client/sharedData.h +18 -16
  121. data/source/bzs/db/protocol/tdap/client/sqlBuilder.cpp +494 -473
  122. data/source/bzs/db/protocol/tdap/client/sqlBuilder.h +51 -53
  123. data/source/bzs/db/protocol/tdap/client/stringConverter.h +214 -148
  124. data/source/bzs/db/protocol/tdap/client/table.cpp +929 -1665
  125. data/source/bzs/db/protocol/tdap/client/table.h +413 -87
  126. data/source/bzs/db/protocol/tdap/client/trdboostapi.h +642 -534
  127. data/source/bzs/db/protocol/tdap/client/trdboostapiInternal.h +25 -40
  128. data/source/bzs/db/protocol/tdap/client/trdclcppautolink.h +11 -15
  129. data/source/bzs/db/protocol/tdap/client/trdormapi.h +378 -437
  130. data/source/bzs/db/protocol/tdap/client/trnsctcl.def +1 -1
  131. data/source/bzs/db/protocol/tdap/fieldComp.h +127 -0
  132. data/source/bzs/db/protocol/tdap/myDateTime.cpp +352 -345
  133. data/source/bzs/db/protocol/tdap/mysql/characterset.cpp +75 -78
  134. data/source/bzs/db/protocol/tdap/mysql/characterset.h +18 -19
  135. data/source/bzs/db/protocol/tdap/mysql/databaseSchema.cpp +216 -199
  136. data/source/bzs/db/protocol/tdap/mysql/databaseSchema.h +23 -14
  137. data/source/bzs/db/protocol/tdap/mysql/debuglog.cpp +354 -314
  138. data/source/bzs/db/protocol/tdap/mysql/debuglog.h +57 -47
  139. data/source/bzs/db/protocol/tdap/mysql/recordsetReader.h +905 -739
  140. data/source/bzs/db/protocol/tdap/mysql/request.h +152 -159
  141. data/source/bzs/db/protocol/tdap/mysql/tdapCommandExecuter.cpp +1044 -879
  142. data/source/bzs/db/protocol/tdap/mysql/tdapCommandExecuter.h +87 -81
  143. data/source/bzs/db/protocol/tdap/tdapRequest.h +162 -130
  144. data/source/bzs/db/protocol/tdap/tdapSchema.cpp +368 -166
  145. data/source/bzs/db/protocol/tdap/tdapSchema.h +702 -566
  146. data/source/bzs/db/protocol/tdap/tdapcapi.h +387 -353
  147. data/source/bzs/db/transactd/appBuilderImple.h +21 -20
  148. data/source/bzs/db/transactd/appModule.cpp +350 -98
  149. data/source/bzs/db/transactd/appModule.h +31 -37
  150. data/source/bzs/db/transactd/connManager.cpp +138 -135
  151. data/source/bzs/db/transactd/connManager.h +28 -21
  152. data/source/bzs/db/transactd/connectionRecord.h +39 -39
  153. data/source/bzs/db/transactd/transactd.cpp +217 -203
  154. data/source/bzs/env/boost_bcb_link.h +131 -0
  155. data/source/bzs/env/compiler.h +136 -79
  156. data/source/bzs/env/crosscompile.cpp +57 -57
  157. data/source/bzs/env/crosscompile.h +130 -115
  158. data/source/bzs/env/fileopen.h +7 -8
  159. data/source/bzs/env/mbcswchrLinux.cpp +4 -9
  160. data/source/bzs/env/mbcswchrLinux.h +37 -34
  161. data/source/bzs/env/tcharMinGW.h +59 -0
  162. data/source/bzs/env/tstring.h +90 -95
  163. data/source/bzs/example/changeSchema.cpp +22 -23
  164. data/source/bzs/example/changeSchema_c.cpp +22 -24
  165. data/source/bzs/example/connection_pool_c.cpp +49 -104
  166. data/source/bzs/example/createDatabase.cpp +40 -47
  167. data/source/bzs/example/createDatabase_c.cpp +38 -43
  168. data/source/bzs/example/deleteRecords.cpp +10 -15
  169. data/source/bzs/example/deleteRecords_c.cpp +10 -14
  170. data/source/bzs/example/dropDatabase.cpp +3 -9
  171. data/source/bzs/example/dropDatabase_c.cpp +5 -6
  172. data/source/bzs/example/insertRecords.cpp +37 -29
  173. data/source/bzs/example/insertRecords_c.cpp +19 -25
  174. data/source/bzs/example/ormap_c.cpp +621 -0
  175. data/source/bzs/example/queryData.cpp +371 -0
  176. data/source/bzs/example/queryData.h +16 -0
  177. data/source/bzs/example/query_c.cpp +109 -0
  178. data/source/bzs/example/readRecords.cpp +27 -27
  179. data/source/bzs/example/readRecords_c.cpp +25 -23
  180. data/source/bzs/example/updateRecords.cpp +16 -21
  181. data/source/bzs/example/updateRecords_c.cpp +8 -12
  182. data/source/bzs/example/update_with_transaction.cpp +21 -24
  183. data/source/bzs/example/update_with_transaction_c.cpp +12 -15
  184. data/source/bzs/example/useORMRecord.cpp +177 -0
  185. data/source/bzs/netsvc/client/tcpClient.cpp +167 -156
  186. data/source/bzs/netsvc/client/tcpClient.h +541 -489
  187. data/source/bzs/netsvc/server/IAppModule.h +119 -32
  188. data/source/bzs/netsvc/server/iserver.h +21 -23
  189. data/source/bzs/netsvc/server/serverCpt.cpp +421 -391
  190. data/source/bzs/netsvc/server/serverCpt.h +41 -43
  191. data/source/bzs/netsvc/server/serverPipe.cpp +580 -565
  192. data/source/bzs/netsvc/server/serverPipe.h +44 -45
  193. data/source/bzs/netsvc/server/serverTpool.cpp +333 -303
  194. data/source/bzs/netsvc/server/serverTpool.h +38 -43
  195. data/source/bzs/rtl/benchmark.cpp +91 -31
  196. data/source/bzs/rtl/benchmark.h +76 -22
  197. data/source/bzs/rtl/datetime.cpp +231 -233
  198. data/source/bzs/rtl/datetime.h +16 -16
  199. data/source/bzs/rtl/debuglog.cpp +48 -51
  200. data/source/bzs/rtl/debuglog.h +55 -44
  201. data/source/bzs/rtl/exception.h +55 -48
  202. data/source/bzs/rtl/stl_uty.cpp +27 -28
  203. data/source/bzs/rtl/stl_uty.h +28 -29
  204. data/source/bzs/rtl/stringBuffers.cpp +8 -6
  205. data/source/bzs/rtl/stringBuffers.h +16 -9
  206. data/source/bzs/rtl/strtrim.cpp +90 -91
  207. data/source/bzs/rtl/strtrim.h +14 -16
  208. data/source/bzs/test/tdclatl/bench_query_atl.js +647 -0
  209. data/source/bzs/test/tdclatl/bench_tdclatl.js +303 -303
  210. data/source/bzs/test/tdclatl/test_query_atl.js +669 -0
  211. data/source/bzs/test/tdclphp/bench.php +357 -0
  212. data/source/bzs/test/tdclphp/transactd_Test.php +907 -303
  213. data/source/bzs/test/tdclphp/transactd_blob_Test.php +21 -49
  214. data/source/bzs/test/tdclphp/transactd_datetime_Test.php +41 -75
  215. data/source/bzs/test/tdclphp/transactd_kanjischema_Test.php +23 -37
  216. data/source/bzs/test/tdclphp/transactd_pool_Test.php +120 -0
  217. data/source/bzs/test/tdclrb/bench_tdclcpp.rb +4 -6
  218. data/source/bzs/test/tdclrb/prepare.rb +15 -12
  219. data/source/bzs/test/tdclrb/transactd_blob_spec.rb +29 -32
  220. data/source/bzs/test/tdclrb/transactd_datetime_spec.rb +0 -29
  221. data/source/bzs/test/tdclrb/transactd_kanjischema_spec.rb +18 -19
  222. data/source/bzs/test/tdclrb/transactd_pool_spec.rb +107 -0
  223. data/source/bzs/test/tdclrb/transactd_spec.rb +734 -142
  224. data/source/bzs/test/transactdBench/query_bench.cpp +156 -0
  225. data/source/bzs/test/transactdBench/scaling_bench.cpp +265 -0
  226. data/source/bzs/test/transactdBench/transactdBench.cpp +107 -83
  227. data/source/bzs/test/transactdBench/transactdBench2.cpp +122 -83
  228. data/source/bzs/test/transactdBench/workerBase.cpp +5 -0
  229. data/source/bzs/test/transactdBench/workerBase.h +88 -0
  230. data/source/bzs/test/transactdBench/workerMySQLImple.h +333 -0
  231. data/source/bzs/test/transactdBench/workerTransactdImple.h +201 -0
  232. data/source/bzs/test/trdclengn/test_blob.cpp +121 -73
  233. data/source/bzs/test/trdclengn/test_trdclengn.cpp +1244 -426
  234. data/source/global/ormsrcgen/confParam.h +80 -0
  235. data/source/global/ormsrcgen/fieldName.cpp +77 -0
  236. data/source/global/ormsrcgen/fieldName.h +43 -0
  237. data/source/global/ormsrcgen/main.cpp +196 -0
  238. data/source/global/ormsrcgen/srcgen.cpp +763 -0
  239. data/source/global/ormsrcgen/srcgen.h +72 -0
  240. data/source/global/ormsrcgen/template/fieldNameList_sample.txt +2 -0
  241. data/source/global/ormsrcgen/template/ormDataClass_template.cpp +48 -0
  242. data/source/global/ormsrcgen/template/ormDataClass_template.h +34 -0
  243. data/source/global/ormsrcgen/template/ormMapClass_template.cpp +51 -0
  244. data/source/global/ormsrcgen/template/ormMapClass_template.h +62 -0
  245. data/source/global/ormsrcgen/template/template.cnf +38 -0
  246. data/source/global/querystmts/querystmts.cpp +237 -0
  247. data/source/global/tdclatl/ConnectParams.cpp +77 -0
  248. data/source/global/tdclatl/ConnectParams.h +70 -0
  249. data/source/global/tdclatl/Database.cpp +132 -128
  250. data/source/global/tdclatl/Database.h +60 -49
  251. data/source/global/tdclatl/DbDef.cpp +68 -64
  252. data/source/global/tdclatl/DbDef.h +36 -36
  253. data/source/global/tdclatl/Field.cpp +12 -17
  254. data/source/global/tdclatl/Field.h +15 -12
  255. data/source/global/tdclatl/FieldDef.cpp +75 -36
  256. data/source/global/tdclatl/FieldDef.h +38 -19
  257. data/source/global/tdclatl/FieldDefs.cpp +74 -0
  258. data/source/global/tdclatl/FieldDefs.h +56 -0
  259. data/source/global/tdclatl/FieldNames.cpp +99 -0
  260. data/source/global/tdclatl/FieldNames.h +66 -0
  261. data/source/global/tdclatl/Flags.cpp +75 -37
  262. data/source/global/tdclatl/Flags.h +13 -12
  263. data/source/global/tdclatl/GroupQuery.cpp +119 -0
  264. data/source/global/tdclatl/GroupQuery.h +65 -0
  265. data/source/global/tdclatl/KeyDef.cpp +15 -14
  266. data/source/global/tdclatl/KeyDef.h +20 -17
  267. data/source/global/tdclatl/KeySegment.cpp +13 -12
  268. data/source/global/tdclatl/PooledDbManager.cpp +223 -0
  269. data/source/global/tdclatl/PooledDbManager.h +76 -0
  270. data/source/global/tdclatl/QueryBase.cpp +206 -127
  271. data/source/global/tdclatl/QueryBase.h +55 -59
  272. data/source/global/tdclatl/Record.cpp +214 -0
  273. data/source/global/tdclatl/Record.h +96 -0
  274. data/source/global/tdclatl/Recordset.cpp +278 -0
  275. data/source/global/tdclatl/Recordset.h +83 -0
  276. data/source/global/tdclatl/RecordsetQuery.cpp +118 -0
  277. data/source/global/tdclatl/RecordsetQuery.h +126 -0
  278. data/source/global/tdclatl/Table.cpp +57 -60
  279. data/source/global/tdclatl/Table.h +32 -29
  280. data/source/global/tdclatl/TableDef.cpp +63 -62
  281. data/source/global/tdclatl/TableDef.h +20 -22
  282. data/source/global/tdclatl/TdVersion.cpp +3 -3
  283. data/source/global/tdclatl/TdVersion.h +15 -11
  284. data/source/global/tdclatl/_IDatabaseEvents_CP.h +99 -92
  285. data/source/global/tdclatl/activeTable.cpp +355 -0
  286. data/source/global/tdclatl/activeTable.h +79 -0
  287. data/source/global/tdclatl/dllmain.cpp +4 -3
  288. data/source/global/tdclatl/dllmain.h +7 -6
  289. data/source/global/tdclatl/keySegment.h +22 -18
  290. data/source/global/tdclatl/resource.h +0 -0
  291. data/source/global/tdclatl/stdafx.h +6 -4
  292. data/source/global/tdclatl/targetver.h +0 -1
  293. data/source/global/tdclatl/tdclatl.cpp +10 -5
  294. data/source/global/tdclatl/tdclatl.idl +530 -14
  295. data/source/linux/charsetConvert.h +78 -79
  296. data/source/linux/linuxTypes.h +9 -12
  297. data/source/linux/tchar.h +168 -166
  298. data/transactd.gemspec +24 -16
  299. metadata +98 -12
  300. data/bin/common/tdclc_32_1_2.dll +0 -0
  301. data/bin/common/tdclc_64_1_2.dll +0 -0
  302. data/build/tdclc/tdclc_32.cbproj +0 -173
  303. data/build/tdclcpp/tdclcpp_bcb_32.cbproj +0 -232
  304. data/build/tdclrb/GEM_VERSION +0 -3
  305. data/source/bzs/db/protocol/tdap/client/filter.cpp +0 -43
  306. data/source/bzs/example/useORM.cpp +0 -585
@@ -12,8 +12,8 @@
12
12
  GNU General Public License for more details.
13
13
 
14
14
  You should have received a copy of the GNU General Public License
15
- along with this program; if not, write to the Free Software
16
- Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
15
+ along with this program; if not, write to the Free Software
16
+ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
17
17
  02111-1307, USA.
18
18
  =================================================================*/
19
19
 
@@ -27,80 +27,77 @@ namespace bzs
27
27
  namespace rtl
28
28
  {
29
29
 
30
- #ifdef DEBUG_PROFILE
30
+ #ifdef DEBUG_PROFILE
31
31
  boost::timer::cpu_timer g_t;
32
32
  #endif
33
33
 
34
34
  static char datebuf[30];
35
35
 
36
- debuglog* debuglog::m_ptr=NULL;
36
+ debuglog* debuglog::m_ptr = NULL;
37
37
  boost::mutex debuglog::m_mutex;
38
38
  char debuglog::logfilename[MAX_PATH];
39
39
 
40
40
  const char* dateTimeStr(char* buf, unsigned int bufsize)
41
41
  {
42
- struct tm* date;
43
- time_t now;
44
- time(&now);
45
- struct tm tmp;
46
- date = &tmp;
47
- localtime_x(date, &now);
48
- sprintf_s(buf, bufsize, "%04d/%02d/%02d %02d:%02d:%02d"
49
- ,date->tm_year + 1900, date->tm_mon + 1,date->tm_mday
50
- ,date->tm_hour, date->tm_min, date->tm_sec);
51
- return buf;
42
+ struct tm* date;
43
+ time_t now;
44
+ time(&now);
45
+ struct tm tmp;
46
+ date = &tmp;
47
+ localtime_x(date, &now);
48
+ sprintf_s(buf, bufsize, "%04d/%02d/%02d %02d:%02d:%02d",
49
+ date->tm_year + 1900, date->tm_mon + 1, date->tm_mday,
50
+ date->tm_hour, date->tm_min, date->tm_sec);
51
+ return buf;
52
52
  }
53
53
 
54
54
  const char* debuglog::dateTime()
55
55
  {
56
- return dateTimeStr(datebuf, 30);
56
+ return dateTimeStr(datebuf, 30);
57
57
  }
58
58
 
59
59
  void debuglog::write(const char* msg)
60
60
  {
61
- boost::mutex::scoped_lock lck(m_mutex);
62
- FILE* fp = fileOpen(logfilename, "a+");
63
- if (fp)
64
- {
65
- fputs(dateTime(), fp);
66
- fputs(" ", fp);
67
- fputs(msg, fp);
68
- fclose(fp);
69
- }
70
-
61
+ boost::mutex::scoped_lock lck(m_mutex);
62
+ FILE* fp = fileOpen(logfilename, "a+");
63
+ if (fp)
64
+ {
65
+ fputs(dateTime(), fp);
66
+ fputs(" ", fp);
67
+ fputs(msg, fp);
68
+ fclose(fp);
69
+ }
71
70
  }
72
71
 
73
72
  void debuglog::dump(FILE* fp, const char* p, int size, int limit)
74
73
  {
75
- size = std::min<int>(size, limit);
76
- for (int i=0;i<size;i+=16)
77
- {
78
-
79
- for (int j=0;j<16;j++)
80
- fprintf(fp, "%02X ", *((unsigned char*)(p+i+j)));
81
- fprintf(fp, " ");
82
- for (int j=0;j<16;j++)
83
- fprintf(fp, "%c", *((unsigned char*)(p+i+j)));
84
- fprintf(fp, "\n");
85
-
86
- }
87
- fprintf(fp, "\n");
74
+ size = std::min<int>(size, limit);
75
+ for (int i = 0; i < size; i += 16)
76
+ {
77
+
78
+ for (int j = 0; j < 16; j++)
79
+ fprintf(fp, "%02X ", *((unsigned char*)(p + i + j)));
80
+ fprintf(fp, " ");
81
+ for (int j = 0; j < 16; j++)
82
+ fprintf(fp, "%c", *((unsigned char*)(p + i + j)));
83
+ fprintf(fp, "\n");
84
+ }
85
+ fprintf(fp, "\n");
88
86
  }
89
87
 
90
88
  void debuglog::writeDump(const char* msg, const char* ptr, int size)
91
89
  {
92
- boost::mutex::scoped_lock lck(m_mutex);
93
- FILE* fp = fileOpen(logfilename, "a+");
94
- if (fp)
95
- {
96
- fputs(msg, fp);
97
- fputs("\n", fp);
98
- dump(fp, ptr, size, INT_MAX);
99
-
100
- fclose(fp);
101
- }
90
+ boost::mutex::scoped_lock lck(m_mutex);
91
+ FILE* fp = fileOpen(logfilename, "a+");
92
+ if (fp)
93
+ {
94
+ fputs(msg, fp);
95
+ fputs("\n", fp);
96
+ dump(fp, ptr, size, INT_MAX);
97
+
98
+ fclose(fp);
99
+ }
102
100
  }
103
101
 
104
- }//namespace rtl
105
- }//namespace bzs
106
-
102
+ } // namespace rtl
103
+ } // namespace bzs
@@ -14,8 +14,8 @@
14
14
  GNU General Public License for more details.
15
15
 
16
16
  You should have received a copy of the GNU General Public License
17
- along with this program; if not, write to the Free Software
18
- Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
17
+ along with this program; if not, write to the Free Software
18
+ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
19
19
  02111-1307, USA.
20
20
  =================================================================*/
21
21
  #include <boost/noncopyable.hpp>
@@ -36,62 +36,73 @@ namespace rtl
36
36
 
37
37
  class debuglog : private boost::noncopyable
38
38
  {
39
- static debuglog* m_ptr;
39
+ static debuglog* m_ptr;
40
+
40
41
  protected:
41
- static boost::mutex m_mutex;
42
- static char logfilename[MAX_PATH];
43
-
44
- public:
45
- virtual ~debuglog(){};
46
- virtual void stop()=0;
47
- void write(const char* msg);
48
- void writeDump(const char* msg, const char* ptr, int size);
49
- static void regist(debuglog* ptr){m_ptr = ptr;};
50
- static debuglog* get(){return m_ptr;}
51
- static void dump(FILE* fp, const char* p, int size, int limit);
52
- static void init();
53
- static const char* dateTime();
42
+ static boost::mutex m_mutex;
43
+ static char logfilename[MAX_PATH];
54
44
 
45
+ public:
46
+ virtual ~debuglog(){};
47
+ virtual void stop() = 0;
48
+ void write(const char* msg);
49
+ void writeDump(const char* msg, const char* ptr, int size);
50
+ static void regist(debuglog* ptr) { m_ptr = ptr; };
51
+ static debuglog* get() { return m_ptr; }
52
+ static void dump(FILE* fp, const char* p, int size, int limit);
53
+ static void init();
54
+ static const char* dateTime();
55
55
  };
56
56
 
57
57
  #ifdef DEBUG_LOG
58
- #define DEBUG_WRITELOG(MSG) debuglog::get()->write(MSG);
58
+ #define DEBUG_WRITELOG(MSG) debuglog::get()->write(MSG);
59
59
 
60
- #else //DEBUG_LOG
61
- #define DEBUG_WRITELOG(MSG)
62
- #endif //DEBUG_LOG
60
+ #else // DEBUG_LOG
61
+ #define DEBUG_WRITELOG(MSG)
62
+ #endif // DEBUG_LOG
63
63
 
64
64
  #if defined(DEBUG_PROFILE) || defined(DEBUG_LOG)
65
- #define DEBUG_PROFILE_INIT() bzs::rtl::debuglog::get()->init();
66
- #define DEBUG_PROFILE_DEINIT() bzs::rtl::debuglog::get()->stop();
65
+ #define DEBUG_PROFILE_INIT() bzs::rtl::debuglog::get()->init();
66
+ #define DEBUG_PROFILE_DEINIT() bzs::rtl::debuglog::get()->stop();
67
67
  #else
68
- #define DEBUG_PROFILE_INIT()
69
- #define DEBUG_PROFILE_DEINIT()
68
+ #define DEBUG_PROFILE_INIT()
69
+ #define DEBUG_PROFILE_DEINIT()
70
70
  #endif
71
71
 
72
- #ifdef DEBUG_PROFILE
72
+ #ifdef DEBUG_PROFILE
73
73
  extern boost::timer::cpu_timer g_t;
74
74
 
75
- #define DEBUG_PROFILE_START(V) if (V) bzs::rtl::g_t.start();
76
-
77
- #define DEBUG_PROFILE_END(V, NAME) if (V) {bzs::rtl::g_t.stop(); \
78
- char buf[256]; \
79
- sprintf(buf, "%-20s %s\r\n",NAME, bzs::rtl::g_t.format().c_str()); \
80
- bzs::rtl::debuglog::get()->write(buf);};
81
-
82
- #define DEBUG_PROFILE_END_OP(V, IV) if (V){bzs::rtl::g_t.stop(); \
83
- char buf[256]; \
84
- sprintf(buf, "op = %-15ld %s\r\n", IV, bzs::rtl::g_t.format().c_str()); \
85
- bzs::rtl::debuglog::get()->write(buf);};
86
-
87
- #else //DEBUG_PROFILE
88
-
89
- #define DEBUG_PROFILE_START(V)
75
+ #define DEBUG_PROFILE_START(V) \
76
+ if (V) \
77
+ bzs::rtl::g_t.start();
78
+
79
+ #define DEBUG_PROFILE_END(V, NAME) \
80
+ if (V) \
81
+ { \
82
+ bzs::rtl::g_t.stop(); \
83
+ char buf[256]; \
84
+ sprintf(buf, "%-20s %s\r\n", NAME, bzs::rtl::g_t.format().c_str()); \
85
+ bzs::rtl::debuglog::get()->write(buf); \
86
+ };
87
+
88
+ #define DEBUG_PROFILE_END_OP(V, IV) \
89
+ if (V) \
90
+ { \
91
+ bzs::rtl::g_t.stop(); \
92
+ char buf[256]; \
93
+ sprintf(buf, "op = %-15ld %s\r\n", IV, \
94
+ bzs::rtl::g_t.format().c_str()); \
95
+ bzs::rtl::debuglog::get()->write(buf); \
96
+ };
97
+
98
+ #else // DEBUG_PROFILE
99
+
100
+ #define DEBUG_PROFILE_START(V)
90
101
  #define DEBUG_PROFILE_END(V, NAME)
91
102
  #define DEBUG_PROFILE_END_OP(V, IV)
92
103
 
93
- #endif //DEBUG_PROFILE
104
+ #endif // DEBUG_PROFILE
94
105
 
95
- }//namespace rtl
96
- }//namespace bzs
97
- #endif //BZS_RL_DEBUGLOG_H
106
+ } // namespace rtl
107
+ } // namespace bzs
108
+ #endif // BZS_RL_DEBUGLOG_H
@@ -14,14 +14,15 @@
14
14
  GNU General Public License for more details.
15
15
 
16
16
  You should have received a copy of the GNU General Public License
17
- along with this program; if not, write to the Free Software
18
- Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
17
+ along with this program; if not, write to the Free Software
18
+ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
19
19
  02111-1307, USA.
20
20
  =================================================================*/
21
21
 
22
22
  #include <exception>
23
23
  #include <string>
24
- #if (defined(__x86_32__) && defined(__BORLANDC__))
24
+ #include <bzs/env/compiler.h>
25
+ #if ((defined(__x86_32__) || defined(__APPLE__)) && defined(__BORLANDC__))
25
26
  #include <bzs/env/tstring.h>
26
27
  #else
27
28
  #include <boost/exception/info.hpp>
@@ -35,88 +36,94 @@ namespace rtl
35
36
  {
36
37
 
37
38
  /** C++Builder XE 32bit can not use boost exception*/
38
- #if (defined(__x86_32__) && defined(__BORLANDC__))
39
+ #if ((defined(__x86_32__) || defined(__APPLE__)) && defined(__BORLANDC__))
39
40
 
40
41
  class exception : public std::exception
41
42
  {
42
43
  int m_error;
43
44
  std::_tstring m_message;
44
45
 
45
-
46
46
  public:
47
- exception(): std::exception(),m_error(0){};
48
- exception(int error, const std::_tstring& message): std::exception()
49
- ,m_error(error),m_message(message){};
50
- explicit exception(int error):std::exception(),m_error(error){};
51
- explicit exception(const std::_tstring& message): std::exception(),m_message(message){};
52
- const std::_tstring& getMessage(){return m_message;}
53
- const int& getErrorCode(){return m_error;}
54
- exception& operator<<(int error){m_error = error;return *this;}
55
- exception& operator<<(const _TCHAR* msg){m_message += msg;return *this;}
56
-
57
-
47
+ exception() : std::exception(), m_error(0){};
48
+ exception(int error, const std::_tstring& message)
49
+ : std::exception(), m_error(error), m_message(message){};
50
+ explicit exception(int error) : std::exception(), m_error(error){};
51
+ explicit exception(const std::_tstring& message)
52
+ : std::exception(), m_message(message){};
53
+ const std::_tstring& getMessage() { return m_message; }
54
+ const int& getErrorCode() { return m_error; }
55
+ exception& operator<<(int error)
56
+ {
57
+ m_error = error;
58
+ return *this;
59
+ }
60
+ exception& operator<<(const _TCHAR* msg)
61
+ {
62
+ m_message += msg;
63
+ return *this;
64
+ }
58
65
  };
59
66
 
60
-
61
67
  #define THROW_BZS_ERROR_WITH_CODE(code) throw bzs::rtl::exception(code)
62
68
  #define THROW_BZS_ERROR_WITH_MSG(msg) throw bzs::rtl::exception(msg)
63
- #define THROW_BZS_ERROR_WITH_CODEMSG(code, msg) throw bzs::rtl::exception(code, msg)
69
+ #define THROW_BZS_ERROR_WITH_CODEMSG(code, msg) \
70
+ throw bzs::rtl::exception(code, msg)
64
71
 
65
- inline const std::_tstring* getMsg(bzs::rtl::exception &e)
72
+ inline const std::_tstring* getMsg(bzs::rtl::exception& e)
66
73
  {
67
- return &(e.getMessage());
74
+ return &(e.getMessage());
68
75
  }
69
- inline const int* getCode(bzs::rtl::exception &e)
76
+ inline const int* getCode(bzs::rtl::exception& e)
70
77
  {
71
- return &e.getErrorCode();
78
+ return &e.getErrorCode();
72
79
  }
73
80
 
74
- inline int errnoCode(int code){return code;}
75
- inline const _TCHAR* errMessage(const _TCHAR* msg){return msg;}
76
-
77
-
81
+ inline int errnoCode(int code)
82
+ {
83
+ return code;
84
+ }
85
+ inline const _TCHAR* errMessage(const _TCHAR* msg)
86
+ {
87
+ return msg;
88
+ }
78
89
 
79
90
  #else // not c++builder 32bit
80
91
 
81
- struct exception_base: virtual std::exception, virtual boost::exception
92
+ struct exception_base : virtual std::exception, virtual boost::exception
82
93
  {
83
94
  };
84
- struct exception: virtual bzs::rtl::exception_base
95
+ struct exception : virtual bzs::rtl::exception_base
85
96
  {
86
-
87
97
  };
88
98
 
89
99
  #ifdef _UNICODE
90
- typedef std::wstring message_type;
100
+ typedef std::wstring message_type;
91
101
  #else
92
- typedef std::string message_type;
102
+ typedef std::string message_type;
93
103
  #endif
94
104
 
95
105
  typedef boost::error_info<struct tagCode, int> errnoCode;
96
106
  typedef boost::error_info<struct tagMsg, message_type> errMessage;
97
107
 
108
+ #define THROW_BZS_ERROR_WITH_CODE(code) \
109
+ throw bzs::rtl::exception() << bzs::rtl::errnoCode(code)
110
+ #define THROW_BZS_ERROR_WITH_MSG(msg) \
111
+ throw bzs::rtl::exception() << bzs::rtl::errMessage(msg)
112
+ #define THROW_BZS_ERROR_WITH_CODEMSG(code, msg) \
113
+ throw bzs::rtl::exception() << bzs::rtl::errnoCode(code) \
114
+ << bzs::rtl::errMessage(msg)
98
115
 
99
-
100
- #define THROW_BZS_ERROR_WITH_CODE(code) throw bzs::rtl::exception() << bzs::rtl::errnoCode(code)
101
- #define THROW_BZS_ERROR_WITH_MSG(msg) throw bzs::rtl::exception() << bzs::rtl::errMessage(msg)
102
- #define THROW_BZS_ERROR_WITH_CODEMSG(code, msg) throw bzs::rtl::exception() \
103
- << bzs::rtl::errnoCode(code) << bzs::rtl::errMessage(msg)
104
-
105
-
106
-
107
- inline const message_type* getMsg(bzs::rtl::exception &e)
116
+ inline const message_type* getMsg(bzs::rtl::exception& e)
108
117
  {
109
- return boost::get_error_info<bzs::rtl::errMessage>(e);
118
+ return boost::get_error_info<bzs::rtl::errMessage>(e);
110
119
  }
111
- inline const int* getCode(bzs::rtl::exception &e)
120
+ inline const int* getCode(bzs::rtl::exception& e)
112
121
  {
113
- return boost::get_error_info<bzs::rtl::errnoCode>(e);
122
+ return boost::get_error_info<bzs::rtl::errnoCode>(e);
114
123
  }
115
124
  #endif
116
125
 
126
+ } // namespace rtl
127
+ } // namespace bzs
117
128
 
118
- }//namespace rtl
119
- }//namespace bzs
120
-
121
- #endif //BZS_RTL_EXCEPTION_H
122
-
129
+ #endif // BZS_RTL_EXCEPTION_H
@@ -1,35 +1,34 @@
1
- /*=================================================================
2
- Copyright (C) 2000 2012 2013 BizStation Corp All rights reserved.
1
+ /* =================================================================
2
+ Copyright (C) 2000 2012 2013 BizStation Corp All rights reserved.
3
3
 
4
- This program is free software; you can redistribute it and/or
5
- modify it under the terms of the GNU General Public License
6
- as published by the Free Software Foundation; either version 2
7
- of the License, or (at your option) any later version.
4
+ This program is free software; you can redistribute it and/or
5
+ modify it under the terms of the GNU General Public License
6
+ as published by the Free Software Foundation; either version 2
7
+ of the License, or (at your option) any later version.
8
8
 
9
- This program is distributed in the hope that it will be useful,
10
- but WITHOUT ANY WARRANTY; without even the implied warranty of
11
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12
- GNU General Public License for more details.
13
-
14
- You should have received a copy of the GNU General Public License
15
- along with this program; if not, write to the Free Software
16
- Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
17
- 02111-1307, USA.
18
- =================================================================*/
9
+ This program is distributed in the hope that it will be useful,
10
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
11
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12
+ GNU General Public License for more details.
19
13
 
14
+ You should have received a copy of the GNU General Public License
15
+ along with this program; if not, write to the Free Software
16
+ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
17
+ 02111-1307, USA.
18
+ ================================================================= */
20
19
  #include "stl_uty.h"
21
20
 
22
- void split(std::vector<std::string>& result, const std::string& input, const std::string& delim)
21
+ void split(std::vector<std::string>& result, const std::string& input,
22
+ const std::string& delim)
23
23
  {
24
- int cutAt;
25
- size_t start = 0;
26
- while( (cutAt = (int)input.find(delim, start)) != (int)std::string::npos )
27
- {
28
- if(cutAt > 0)
29
- result.push_back(input.substr(start, cutAt-start));
30
- start = cutAt + delim.size();
31
- }
32
- if(input.length() > start)
33
- result.push_back(input.substr(start));
24
+ int cutAt;
25
+ size_t start = 0;
26
+ while ((cutAt = (int)input.find(delim, start)) != (int)std::string::npos)
27
+ {
28
+ if (cutAt > 0)
29
+ result.push_back(input.substr(start, cutAt - start));
30
+ start = cutAt + delim.size();
31
+ }
32
+ if (input.length() > start)
33
+ result.push_back(input.substr(start));
34
34
  }
35
-
@@ -1,29 +1,28 @@
1
- /*=================================================================
2
- Copyright (C) 2000 2012 2013 BizStation Corp All rights reserved.
3
-
4
- This program is free software; you can redistribute it and/or
5
- modify it under the terms of the GNU General Public License
6
- as published by the Free Software Foundation; either version 2
7
- of the License, or (at your option) any later version.
8
-
9
- This program is distributed in the hope that it will be useful,
10
- but WITHOUT ANY WARRANTY; without even the implied warranty of
11
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12
- GNU General Public License for more details.
13
-
14
- You should have received a copy of the GNU General Public License
15
- along with this program; if not, write to the Free Software
16
- Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
17
- 02111-1307, USA.
18
- =================================================================*/
19
- #ifndef BZS_RTL_STL_UTY_H
20
- #define BZS_RTL_STL_UTY_H
21
-
22
-
23
- #include <vector>
24
- #include <string>
25
- #include <stdio.h>
26
-
27
- void split(std::vector<std::string>& result, const std::string& input, const std::string& delim);
28
-
29
- #endif //BZS_RTL_STL_UTY_H
1
+ #ifndef BZS_RTL_STL_UTY_H
2
+ #define BZS_RTL_STL_UTY_H
3
+ /* =================================================================
4
+ Copyright (C) 2000 2012 2013 BizStation Corp All rights reserved.
5
+
6
+ This program is free software; you can redistribute it and/or
7
+ modify it under the terms of the GNU General Public License
8
+ as published by the Free Software Foundation; either version 2
9
+ of the License, or (at your option) any later version.
10
+
11
+ This program is distributed in the hope that it will be useful,
12
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
13
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14
+ GNU General Public License for more details.
15
+
16
+ You should have received a copy of the GNU General Public License
17
+ along with this program; if not, write to the Free Software
18
+ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
19
+ 02111-1307, USA.
20
+ ================================================================= */
21
+ #include <vector>
22
+ #include <string>
23
+ #include <stdio.h>
24
+
25
+ void split(std::vector<std::string>& result, const std::string& input,
26
+ const std::string& delim);
27
+
28
+ #endif // BZS_RTL_STL_UTY_H
@@ -12,8 +12,8 @@
12
12
  GNU General Public License for more details.
13
13
 
14
14
  You should have received a copy of the GNU General Public License
15
- along with this program; if not, write to the Free Software
16
- Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
15
+ along with this program; if not, write to the Free Software
16
+ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
17
17
  02111-1307, USA.
18
18
  =================================================================*/
19
19
  #include <stdlib.h>
@@ -31,7 +31,7 @@ namespace rtl
31
31
 
32
32
  static const int MEMORY_UNIT = 8192;
33
33
 
34
- stringBuffer::stringBuffer(size_t size):m_ptr(NULL),m_len(0),m_pos(0)
34
+ stringBuffer::stringBuffer(size_t size) : m_ptr(NULL), m_len(0), m_pos(0)
35
35
  {
36
36
  alloc(size);
37
37
  }
@@ -40,6 +40,7 @@ stringBuffer::~stringBuffer()
40
40
  {
41
41
  if (m_ptr)
42
42
  free(m_ptr);
43
+ m_ptr = NULL;
43
44
  }
44
45
 
45
46
  void stringBuffer::clear()
@@ -58,7 +59,8 @@ size_t stringBuffer::alloc(size_t size)
58
59
 
59
60
  size_t stringBuffer::realloc(size_t size)
60
61
  {
61
- size = ((size / MEMORY_UNIT) + ((size % MEMORY_UNIT) ? 1:0))*MEMORY_UNIT;
62
+ size =
63
+ ((size / MEMORY_UNIT) + ((size % MEMORY_UNIT) ? 1 : 0)) * MEMORY_UNIT;
62
64
  m_ptr = (char*)::realloc(m_ptr, size);
63
65
  if (m_ptr)
64
66
  m_len = size;
@@ -97,5 +99,5 @@ WCHAR* stringBuffer::getPtrW(size_t size /* charnum */)
97
99
  return p;
98
100
  }
99
101
 
100
- }//namespace rtl
101
- }//namespace bzs
102
+ } // namespace rtl
103
+ } // namespace bzs
@@ -14,8 +14,8 @@
14
14
  GNU General Public License for more details.
15
15
 
16
16
  You should have received a copy of the GNU General Public License
17
- along with this program; if not, write to the Free Software
18
- Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
17
+ along with this program; if not, write to the Free Software
18
+ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
19
19
  02111-1307, USA.
20
20
  =================================================================*/
21
21
  #include <bzs/env/compiler.h>
@@ -37,6 +37,7 @@ class stringBuffer
37
37
  size_t m_len;
38
38
  size_t m_pos;
39
39
  size_t m_curSize;
40
+
40
41
  public:
41
42
  stringBuffer(size_t size);
42
43
  ~stringBuffer();
@@ -45,14 +46,20 @@ public:
45
46
  size_t realloc(size_t size);
46
47
  char* getPtrA(size_t size);
47
48
  WCHAR* getPtrW(size_t size /* charnum */);
48
- size_t size()const{return m_curSize;}
49
- template <class T> T* getPtr(size_t size){};
49
+ size_t size() const { return m_curSize; }
50
+ template <class T> T* getPtr(size_t size){};
50
51
  };
51
52
 
52
- template <> inline WCHAR* stringBuffer::getPtr<WCHAR>(size_t size){return getPtrW(size);};
53
- template <> inline char* stringBuffer::getPtr<char>(size_t size){return getPtrA(size);};
53
+ template <> inline WCHAR* stringBuffer::getPtr<WCHAR>(size_t size)
54
+ {
55
+ return getPtrW(size);
56
+ };
57
+ template <> inline char* stringBuffer::getPtr<char>(size_t size)
58
+ {
59
+ return getPtrA(size);
60
+ };
54
61
 
55
- }//namespace rtl
56
- }//namespace bzs
62
+ } // namespace rtl
63
+ } // namespace bzs
57
64
 
58
- #endif //BZS_RTL_STRINGBUFFERS_H
65
+ #endif // BZS_RTL_STRINGBUFFERS_H