libzmq 0.0.1

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 (300) hide show
  1. data/LICENSE +703 -0
  2. data/README.md +31 -0
  3. data/lib/libzmq.rb +17 -0
  4. data/lib/libzmq/ffi-rzmq.rb +3 -0
  5. data/libzmq/Makefile +5 -0
  6. data/libzmq/extconf.rb +24 -0
  7. data/libzmq/zeromq-2.1.7/AUTHORS +92 -0
  8. data/libzmq/zeromq-2.1.7/COPYING +674 -0
  9. data/libzmq/zeromq-2.1.7/COPYING.LESSER +206 -0
  10. data/libzmq/zeromq-2.1.7/ChangeLog +15620 -0
  11. data/libzmq/zeromq-2.1.7/INSTALL +237 -0
  12. data/libzmq/zeromq-2.1.7/MAINTAINERS +56 -0
  13. data/libzmq/zeromq-2.1.7/Makefile.am +42 -0
  14. data/libzmq/zeromq-2.1.7/Makefile.in +779 -0
  15. data/libzmq/zeromq-2.1.7/NEWS +275 -0
  16. data/libzmq/zeromq-2.1.7/README +39 -0
  17. data/libzmq/zeromq-2.1.7/acinclude.m4 +582 -0
  18. data/libzmq/zeromq-2.1.7/aclocal.m4 +1206 -0
  19. data/libzmq/zeromq-2.1.7/autogen.sh +45 -0
  20. data/libzmq/zeromq-2.1.7/builds/msvc/Makefile.am +8 -0
  21. data/libzmq/zeromq-2.1.7/builds/msvc/Makefile.in +390 -0
  22. data/libzmq/zeromq-2.1.7/builds/msvc/c_local_lat/c_local_lat.vcproj +176 -0
  23. data/libzmq/zeromq-2.1.7/builds/msvc/c_local_thr/c_local_thr.vcproj +176 -0
  24. data/libzmq/zeromq-2.1.7/builds/msvc/c_remote_lat/c_remote_lat.vcproj +176 -0
  25. data/libzmq/zeromq-2.1.7/builds/msvc/c_remote_thr/c_remote_thr.vcproj +176 -0
  26. data/libzmq/zeromq-2.1.7/builds/msvc/libzmq/libzmq.vcproj +783 -0
  27. data/libzmq/zeromq-2.1.7/builds/msvc/msvc.sln +89 -0
  28. data/libzmq/zeromq-2.1.7/builds/msvc/platform.hpp +32 -0
  29. data/libzmq/zeromq-2.1.7/builds/redhat/zeromq.spec.in +139 -0
  30. data/libzmq/zeromq-2.1.7/config/compile +143 -0
  31. data/libzmq/zeromq-2.1.7/config/config.guess +1502 -0
  32. data/libzmq/zeromq-2.1.7/config/config.sub +1714 -0
  33. data/libzmq/zeromq-2.1.7/config/depcomp +630 -0
  34. data/libzmq/zeromq-2.1.7/config/install-sh +520 -0
  35. data/libzmq/zeromq-2.1.7/config/libtool.m4 +7377 -0
  36. data/libzmq/zeromq-2.1.7/config/ltmain.sh +8413 -0
  37. data/libzmq/zeromq-2.1.7/config/ltoptions.m4 +368 -0
  38. data/libzmq/zeromq-2.1.7/config/ltsugar.m4 +123 -0
  39. data/libzmq/zeromq-2.1.7/config/ltversion.m4 +23 -0
  40. data/libzmq/zeromq-2.1.7/config/lt~obsolete.m4 +92 -0
  41. data/libzmq/zeromq-2.1.7/config/missing +376 -0
  42. data/libzmq/zeromq-2.1.7/configure +21645 -0
  43. data/libzmq/zeromq-2.1.7/configure.in +380 -0
  44. data/libzmq/zeromq-2.1.7/doc/Makefile.am +46 -0
  45. data/libzmq/zeromq-2.1.7/doc/Makefile.in +546 -0
  46. data/libzmq/zeromq-2.1.7/doc/asciidoc.conf +56 -0
  47. data/libzmq/zeromq-2.1.7/doc/zmq.7 +242 -0
  48. data/libzmq/zeromq-2.1.7/doc/zmq.html +846 -0
  49. data/libzmq/zeromq-2.1.7/doc/zmq.txt +218 -0
  50. data/libzmq/zeromq-2.1.7/doc/zmq_bind.3 +166 -0
  51. data/libzmq/zeromq-2.1.7/doc/zmq_bind.html +746 -0
  52. data/libzmq/zeromq-2.1.7/doc/zmq_bind.txt +91 -0
  53. data/libzmq/zeromq-2.1.7/doc/zmq_close.3 +81 -0
  54. data/libzmq/zeromq-2.1.7/doc/zmq_close.html +645 -0
  55. data/libzmq/zeromq-2.1.7/doc/zmq_close.txt +52 -0
  56. data/libzmq/zeromq-2.1.7/doc/zmq_connect.3 +161 -0
  57. data/libzmq/zeromq-2.1.7/doc/zmq_connect.html +732 -0
  58. data/libzmq/zeromq-2.1.7/doc/zmq_connect.txt +89 -0
  59. data/libzmq/zeromq-2.1.7/doc/zmq_cpp.7 +410 -0
  60. data/libzmq/zeromq-2.1.7/doc/zmq_cpp.html +765 -0
  61. data/libzmq/zeromq-2.1.7/doc/zmq_cpp.txt +212 -0
  62. data/libzmq/zeromq-2.1.7/doc/zmq_device.3 +140 -0
  63. data/libzmq/zeromq-2.1.7/doc/zmq_device.html +736 -0
  64. data/libzmq/zeromq-2.1.7/doc/zmq_device.txt +138 -0
  65. data/libzmq/zeromq-2.1.7/doc/zmq_epgm.7 +209 -0
  66. data/libzmq/zeromq-2.1.7/doc/zmq_epgm.html +749 -0
  67. data/libzmq/zeromq-2.1.7/doc/zmq_epgm.txt +162 -0
  68. data/libzmq/zeromq-2.1.7/doc/zmq_errno.3 +78 -0
  69. data/libzmq/zeromq-2.1.7/doc/zmq_errno.html +634 -0
  70. data/libzmq/zeromq-2.1.7/doc/zmq_errno.txt +50 -0
  71. data/libzmq/zeromq-2.1.7/doc/zmq_getsockopt.3 +944 -0
  72. data/libzmq/zeromq-2.1.7/doc/zmq_getsockopt.html +1713 -0
  73. data/libzmq/zeromq-2.1.7/doc/zmq_getsockopt.txt +407 -0
  74. data/libzmq/zeromq-2.1.7/doc/zmq_init.3 +71 -0
  75. data/libzmq/zeromq-2.1.7/doc/zmq_init.html +635 -0
  76. data/libzmq/zeromq-2.1.7/doc/zmq_init.txt +51 -0
  77. data/libzmq/zeromq-2.1.7/doc/zmq_inproc.7 +115 -0
  78. data/libzmq/zeromq-2.1.7/doc/zmq_inproc.html +669 -0
  79. data/libzmq/zeromq-2.1.7/doc/zmq_inproc.txt +89 -0
  80. data/libzmq/zeromq-2.1.7/doc/zmq_ipc.7 +109 -0
  81. data/libzmq/zeromq-2.1.7/doc/zmq_ipc.html +662 -0
  82. data/libzmq/zeromq-2.1.7/doc/zmq_ipc.txt +80 -0
  83. data/libzmq/zeromq-2.1.7/doc/zmq_msg_close.3 +81 -0
  84. data/libzmq/zeromq-2.1.7/doc/zmq_msg_close.html +647 -0
  85. data/libzmq/zeromq-2.1.7/doc/zmq_msg_close.txt +55 -0
  86. data/libzmq/zeromq-2.1.7/doc/zmq_msg_copy.3 +95 -0
  87. data/libzmq/zeromq-2.1.7/doc/zmq_msg_copy.html +656 -0
  88. data/libzmq/zeromq-2.1.7/doc/zmq_msg_copy.txt +57 -0
  89. data/libzmq/zeromq-2.1.7/doc/zmq_msg_data.3 +76 -0
  90. data/libzmq/zeromq-2.1.7/doc/zmq_msg_data.html +633 -0
  91. data/libzmq/zeromq-2.1.7/doc/zmq_msg_data.txt +48 -0
  92. data/libzmq/zeromq-2.1.7/doc/zmq_msg_init.3 +110 -0
  93. data/libzmq/zeromq-2.1.7/doc/zmq_msg_init.html +656 -0
  94. data/libzmq/zeromq-2.1.7/doc/zmq_msg_init.txt +65 -0
  95. data/libzmq/zeromq-2.1.7/doc/zmq_msg_init_data.3 +138 -0
  96. data/libzmq/zeromq-2.1.7/doc/zmq_msg_init_data.html +678 -0
  97. data/libzmq/zeromq-2.1.7/doc/zmq_msg_init_data.txt +83 -0
  98. data/libzmq/zeromq-2.1.7/doc/zmq_msg_init_size.3 +97 -0
  99. data/libzmq/zeromq-2.1.7/doc/zmq_msg_init_size.html +656 -0
  100. data/libzmq/zeromq-2.1.7/doc/zmq_msg_init_size.txt +58 -0
  101. data/libzmq/zeromq-2.1.7/doc/zmq_msg_move.3 +79 -0
  102. data/libzmq/zeromq-2.1.7/doc/zmq_msg_move.html +645 -0
  103. data/libzmq/zeromq-2.1.7/doc/zmq_msg_move.txt +52 -0
  104. data/libzmq/zeromq-2.1.7/doc/zmq_msg_size.3 +76 -0
  105. data/libzmq/zeromq-2.1.7/doc/zmq_msg_size.html +633 -0
  106. data/libzmq/zeromq-2.1.7/doc/zmq_msg_size.txt +48 -0
  107. data/libzmq/zeromq-2.1.7/doc/zmq_pgm.7 +209 -0
  108. data/libzmq/zeromq-2.1.7/doc/zmq_pgm.html +749 -0
  109. data/libzmq/zeromq-2.1.7/doc/zmq_pgm.txt +162 -0
  110. data/libzmq/zeromq-2.1.7/doc/zmq_poll.3 +204 -0
  111. data/libzmq/zeromq-2.1.7/doc/zmq_poll.html +755 -0
  112. data/libzmq/zeromq-2.1.7/doc/zmq_poll.txt +132 -0
  113. data/libzmq/zeromq-2.1.7/doc/zmq_recv.3 +172 -0
  114. data/libzmq/zeromq-2.1.7/doc/zmq_recv.html +746 -0
  115. data/libzmq/zeromq-2.1.7/doc/zmq_recv.txt +121 -0
  116. data/libzmq/zeromq-2.1.7/doc/zmq_send.3 +185 -0
  117. data/libzmq/zeromq-2.1.7/doc/zmq_send.html +755 -0
  118. data/libzmq/zeromq-2.1.7/doc/zmq_send.txt +120 -0
  119. data/libzmq/zeromq-2.1.7/doc/zmq_setsockopt.3 +878 -0
  120. data/libzmq/zeromq-2.1.7/doc/zmq_setsockopt.html +1603 -0
  121. data/libzmq/zeromq-2.1.7/doc/zmq_setsockopt.txt +382 -0
  122. data/libzmq/zeromq-2.1.7/doc/zmq_socket.3 +779 -0
  123. data/libzmq/zeromq-2.1.7/doc/zmq_socket.html +1424 -0
  124. data/libzmq/zeromq-2.1.7/doc/zmq_socket.txt +342 -0
  125. data/libzmq/zeromq-2.1.7/doc/zmq_strerror.3 +78 -0
  126. data/libzmq/zeromq-2.1.7/doc/zmq_strerror.html +634 -0
  127. data/libzmq/zeromq-2.1.7/doc/zmq_strerror.txt +55 -0
  128. data/libzmq/zeromq-2.1.7/doc/zmq_tcp.7 +244 -0
  129. data/libzmq/zeromq-2.1.7/doc/zmq_tcp.html +755 -0
  130. data/libzmq/zeromq-2.1.7/doc/zmq_tcp.txt +162 -0
  131. data/libzmq/zeromq-2.1.7/doc/zmq_term.3 +135 -0
  132. data/libzmq/zeromq-2.1.7/doc/zmq_term.html +672 -0
  133. data/libzmq/zeromq-2.1.7/doc/zmq_term.txt +65 -0
  134. data/libzmq/zeromq-2.1.7/doc/zmq_version.3 +78 -0
  135. data/libzmq/zeromq-2.1.7/doc/zmq_version.html +632 -0
  136. data/libzmq/zeromq-2.1.7/doc/zmq_version.txt +53 -0
  137. data/libzmq/zeromq-2.1.7/foreign/openpgm/Makefile.am +8 -0
  138. data/libzmq/zeromq-2.1.7/foreign/openpgm/Makefile.in +588 -0
  139. data/libzmq/zeromq-2.1.7/foreign/openpgm/libpgm-5.1.115~dfsg.tar.gz +0 -0
  140. data/libzmq/zeromq-2.1.7/foreign/xmlParser/xmlParser.cpp +2923 -0
  141. data/libzmq/zeromq-2.1.7/foreign/xmlParser/xmlParser.hpp +762 -0
  142. data/libzmq/zeromq-2.1.7/include/zmq.h +269 -0
  143. data/libzmq/zeromq-2.1.7/include/zmq.hpp +301 -0
  144. data/libzmq/zeromq-2.1.7/include/zmq_utils.h +64 -0
  145. data/libzmq/zeromq-2.1.7/perf/Makefile.am +21 -0
  146. data/libzmq/zeromq-2.1.7/perf/Makefile.in +566 -0
  147. data/libzmq/zeromq-2.1.7/perf/inproc_lat.cpp +232 -0
  148. data/libzmq/zeromq-2.1.7/perf/inproc_thr.cpp +246 -0
  149. data/libzmq/zeromq-2.1.7/perf/local_lat.cpp +108 -0
  150. data/libzmq/zeromq-2.1.7/perf/local_thr.cpp +138 -0
  151. data/libzmq/zeromq-2.1.7/perf/remote_lat.cpp +121 -0
  152. data/libzmq/zeromq-2.1.7/perf/remote_thr.cpp +104 -0
  153. data/libzmq/zeromq-2.1.7/src/Makefile.am +155 -0
  154. data/libzmq/zeromq-2.1.7/src/Makefile.in +1320 -0
  155. data/libzmq/zeromq-2.1.7/src/array.hpp +147 -0
  156. data/libzmq/zeromq-2.1.7/src/atomic_counter.hpp +164 -0
  157. data/libzmq/zeromq-2.1.7/src/atomic_ptr.hpp +159 -0
  158. data/libzmq/zeromq-2.1.7/src/blob.hpp +34 -0
  159. data/libzmq/zeromq-2.1.7/src/clock.cpp +118 -0
  160. data/libzmq/zeromq-2.1.7/src/clock.hpp +60 -0
  161. data/libzmq/zeromq-2.1.7/src/command.cpp +39 -0
  162. data/libzmq/zeromq-2.1.7/src/command.hpp +147 -0
  163. data/libzmq/zeromq-2.1.7/src/config.hpp +88 -0
  164. data/libzmq/zeromq-2.1.7/src/connect_session.cpp +119 -0
  165. data/libzmq/zeromq-2.1.7/src/connect_session.hpp +65 -0
  166. data/libzmq/zeromq-2.1.7/src/ctx.cpp +322 -0
  167. data/libzmq/zeromq-2.1.7/src/ctx.hpp +159 -0
  168. data/libzmq/zeromq-2.1.7/src/decoder.cpp +129 -0
  169. data/libzmq/zeromq-2.1.7/src/decoder.hpp +207 -0
  170. data/libzmq/zeromq-2.1.7/src/device.cpp +120 -0
  171. data/libzmq/zeromq-2.1.7/src/device.hpp +32 -0
  172. data/libzmq/zeromq-2.1.7/src/devpoll.cpp +190 -0
  173. data/libzmq/zeromq-2.1.7/src/devpoll.hpp +100 -0
  174. data/libzmq/zeromq-2.1.7/src/dist.cpp +200 -0
  175. data/libzmq/zeromq-2.1.7/src/dist.hpp +90 -0
  176. data/libzmq/zeromq-2.1.7/src/encoder.cpp +90 -0
  177. data/libzmq/zeromq-2.1.7/src/encoder.hpp +184 -0
  178. data/libzmq/zeromq-2.1.7/src/epoll.cpp +177 -0
  179. data/libzmq/zeromq-2.1.7/src/epoll.hpp +96 -0
  180. data/libzmq/zeromq-2.1.7/src/err.cpp +238 -0
  181. data/libzmq/zeromq-2.1.7/src/err.hpp +145 -0
  182. data/libzmq/zeromq-2.1.7/src/fd.hpp +45 -0
  183. data/libzmq/zeromq-2.1.7/src/fq.cpp +164 -0
  184. data/libzmq/zeromq-2.1.7/src/fq.hpp +80 -0
  185. data/libzmq/zeromq-2.1.7/src/i_engine.hpp +53 -0
  186. data/libzmq/zeromq-2.1.7/src/i_inout.hpp +50 -0
  187. data/libzmq/zeromq-2.1.7/src/i_poll_events.hpp +46 -0
  188. data/libzmq/zeromq-2.1.7/src/io_object.cpp +107 -0
  189. data/libzmq/zeromq-2.1.7/src/io_object.hpp +78 -0
  190. data/libzmq/zeromq-2.1.7/src/io_thread.cpp +109 -0
  191. data/libzmq/zeromq-2.1.7/src/io_thread.hpp +88 -0
  192. data/libzmq/zeromq-2.1.7/src/ip.cpp +339 -0
  193. data/libzmq/zeromq-2.1.7/src/ip.hpp +68 -0
  194. data/libzmq/zeromq-2.1.7/src/kqueue.cpp +194 -0
  195. data/libzmq/zeromq-2.1.7/src/kqueue.hpp +103 -0
  196. data/libzmq/zeromq-2.1.7/src/lb.cpp +174 -0
  197. data/libzmq/zeromq-2.1.7/src/lb.hpp +79 -0
  198. data/libzmq/zeromq-2.1.7/src/libzmq.pc.in +10 -0
  199. data/libzmq/zeromq-2.1.7/src/likely.hpp +33 -0
  200. data/libzmq/zeromq-2.1.7/src/mailbox.cpp +382 -0
  201. data/libzmq/zeromq-2.1.7/src/mailbox.hpp +62 -0
  202. data/libzmq/zeromq-2.1.7/src/msg_content.hpp +52 -0
  203. data/libzmq/zeromq-2.1.7/src/mutex.hpp +121 -0
  204. data/libzmq/zeromq-2.1.7/src/named_session.cpp +85 -0
  205. data/libzmq/zeromq-2.1.7/src/named_session.hpp +57 -0
  206. data/libzmq/zeromq-2.1.7/src/object.cpp +467 -0
  207. data/libzmq/zeromq-2.1.7/src/object.hpp +127 -0
  208. data/libzmq/zeromq-2.1.7/src/options.cpp +336 -0
  209. data/libzmq/zeromq-2.1.7/src/options.hpp +87 -0
  210. data/libzmq/zeromq-2.1.7/src/own.cpp +214 -0
  211. data/libzmq/zeromq-2.1.7/src/own.hpp +140 -0
  212. data/libzmq/zeromq-2.1.7/src/pair.cpp +180 -0
  213. data/libzmq/zeromq-2.1.7/src/pair.hpp +76 -0
  214. data/libzmq/zeromq-2.1.7/src/pgm_receiver.cpp +259 -0
  215. data/libzmq/zeromq-2.1.7/src/pgm_receiver.hpp +129 -0
  216. data/libzmq/zeromq-2.1.7/src/pgm_sender.cpp +215 -0
  217. data/libzmq/zeromq-2.1.7/src/pgm_sender.hpp +105 -0
  218. data/libzmq/zeromq-2.1.7/src/pgm_socket.cpp +705 -0
  219. data/libzmq/zeromq-2.1.7/src/pgm_socket.hpp +118 -0
  220. data/libzmq/zeromq-2.1.7/src/pipe.cpp +409 -0
  221. data/libzmq/zeromq-2.1.7/src/pipe.hpp +214 -0
  222. data/libzmq/zeromq-2.1.7/src/platform.hpp.in +228 -0
  223. data/libzmq/zeromq-2.1.7/src/poll.cpp +180 -0
  224. data/libzmq/zeromq-2.1.7/src/poll.hpp +104 -0
  225. data/libzmq/zeromq-2.1.7/src/poller.hpp +73 -0
  226. data/libzmq/zeromq-2.1.7/src/poller_base.cpp +99 -0
  227. data/libzmq/zeromq-2.1.7/src/poller_base.hpp +84 -0
  228. data/libzmq/zeromq-2.1.7/src/pub.cpp +31 -0
  229. data/libzmq/zeromq-2.1.7/src/pub.hpp +44 -0
  230. data/libzmq/zeromq-2.1.7/src/pull.cpp +61 -0
  231. data/libzmq/zeromq-2.1.7/src/pull.hpp +60 -0
  232. data/libzmq/zeromq-2.1.7/src/push.cpp +62 -0
  233. data/libzmq/zeromq-2.1.7/src/push.hpp +59 -0
  234. data/libzmq/zeromq-2.1.7/src/reaper.cpp +121 -0
  235. data/libzmq/zeromq-2.1.7/src/reaper.hpp +77 -0
  236. data/libzmq/zeromq-2.1.7/src/rep.cpp +131 -0
  237. data/libzmq/zeromq-2.1.7/src/rep.hpp +59 -0
  238. data/libzmq/zeromq-2.1.7/src/req.cpp +121 -0
  239. data/libzmq/zeromq-2.1.7/src/req.hpp +58 -0
  240. data/libzmq/zeromq-2.1.7/src/select.cpp +211 -0
  241. data/libzmq/zeromq-2.1.7/src/select.hpp +116 -0
  242. data/libzmq/zeromq-2.1.7/src/semaphore.hpp +189 -0
  243. data/libzmq/zeromq-2.1.7/src/session.cpp +347 -0
  244. data/libzmq/zeromq-2.1.7/src/session.hpp +150 -0
  245. data/libzmq/zeromq-2.1.7/src/socket_base.cpp +811 -0
  246. data/libzmq/zeromq-2.1.7/src/socket_base.hpp +207 -0
  247. data/libzmq/zeromq-2.1.7/src/stdint.hpp +63 -0
  248. data/libzmq/zeromq-2.1.7/src/sub.cpp +75 -0
  249. data/libzmq/zeromq-2.1.7/src/sub.hpp +50 -0
  250. data/libzmq/zeromq-2.1.7/src/swap.cpp +325 -0
  251. data/libzmq/zeromq-2.1.7/src/swap.hpp +123 -0
  252. data/libzmq/zeromq-2.1.7/src/tcp_connecter.cpp +310 -0
  253. data/libzmq/zeromq-2.1.7/src/tcp_connecter.hpp +81 -0
  254. data/libzmq/zeromq-2.1.7/src/tcp_listener.cpp +371 -0
  255. data/libzmq/zeromq-2.1.7/src/tcp_listener.hpp +73 -0
  256. data/libzmq/zeromq-2.1.7/src/tcp_socket.cpp +228 -0
  257. data/libzmq/zeromq-2.1.7/src/tcp_socket.hpp +72 -0
  258. data/libzmq/zeromq-2.1.7/src/thread.cpp +97 -0
  259. data/libzmq/zeromq-2.1.7/src/thread.hpp +78 -0
  260. data/libzmq/zeromq-2.1.7/src/transient_session.cpp +41 -0
  261. data/libzmq/zeromq-2.1.7/src/transient_session.hpp +52 -0
  262. data/libzmq/zeromq-2.1.7/src/trie.cpp +181 -0
  263. data/libzmq/zeromq-2.1.7/src/trie.hpp +59 -0
  264. data/libzmq/zeromq-2.1.7/src/uuid.cpp +233 -0
  265. data/libzmq/zeromq-2.1.7/src/uuid.hpp +111 -0
  266. data/libzmq/zeromq-2.1.7/src/windows.hpp +79 -0
  267. data/libzmq/zeromq-2.1.7/src/wire.hpp +99 -0
  268. data/libzmq/zeromq-2.1.7/src/xpub.cpp +76 -0
  269. data/libzmq/zeromq-2.1.7/src/xpub.hpp +61 -0
  270. data/libzmq/zeromq-2.1.7/src/xrep.cpp +337 -0
  271. data/libzmq/zeromq-2.1.7/src/xrep.hpp +116 -0
  272. data/libzmq/zeromq-2.1.7/src/xreq.cpp +74 -0
  273. data/libzmq/zeromq-2.1.7/src/xreq.hpp +65 -0
  274. data/libzmq/zeromq-2.1.7/src/xsub.cpp +172 -0
  275. data/libzmq/zeromq-2.1.7/src/xsub.hpp +80 -0
  276. data/libzmq/zeromq-2.1.7/src/ypipe.hpp +209 -0
  277. data/libzmq/zeromq-2.1.7/src/yqueue.hpp +198 -0
  278. data/libzmq/zeromq-2.1.7/src/zmq.cpp +798 -0
  279. data/libzmq/zeromq-2.1.7/src/zmq_connecter.cpp +166 -0
  280. data/libzmq/zeromq-2.1.7/src/zmq_connecter.hpp +92 -0
  281. data/libzmq/zeromq-2.1.7/src/zmq_engine.cpp +220 -0
  282. data/libzmq/zeromq-2.1.7/src/zmq_engine.hpp +87 -0
  283. data/libzmq/zeromq-2.1.7/src/zmq_init.cpp +216 -0
  284. data/libzmq/zeromq-2.1.7/src/zmq_init.hpp +93 -0
  285. data/libzmq/zeromq-2.1.7/src/zmq_listener.cpp +78 -0
  286. data/libzmq/zeromq-2.1.7/src/zmq_listener.hpp +67 -0
  287. data/libzmq/zeromq-2.1.7/tests/Makefile.am +30 -0
  288. data/libzmq/zeromq-2.1.7/tests/Makefile.in +713 -0
  289. data/libzmq/zeromq-2.1.7/tests/test_hwm.cpp +68 -0
  290. data/libzmq/zeromq-2.1.7/tests/test_pair_inproc.cpp +31 -0
  291. data/libzmq/zeromq-2.1.7/tests/test_pair_ipc.cpp +31 -0
  292. data/libzmq/zeromq-2.1.7/tests/test_pair_tcp.cpp +31 -0
  293. data/libzmq/zeromq-2.1.7/tests/test_reqrep_inproc.cpp +31 -0
  294. data/libzmq/zeromq-2.1.7/tests/test_reqrep_ipc.cpp +31 -0
  295. data/libzmq/zeromq-2.1.7/tests/test_reqrep_tcp.cpp +31 -0
  296. data/libzmq/zeromq-2.1.7/tests/test_shutdown_stress.cpp +87 -0
  297. data/libzmq/zeromq-2.1.7/tests/testutil.hpp +130 -0
  298. data/libzmq/zeromq-2.1.7/version.sh +21 -0
  299. data/libzmq/zeromq-2.1.7/zeromq.spec +139 -0
  300. metadata +348 -0
@@ -0,0 +1,762 @@
1
+ /****************************************************************************/
2
+ /*! \mainpage XMLParser library
3
+ * \section intro_sec Introduction
4
+ *
5
+ * This is a basic XML parser written in ANSI C++ for portability.
6
+ * It works by using recursion and a node tree for breaking
7
+ * down the elements of an XML document.
8
+
9
+ * Copyright (c) 2002, Frank Vanden Berghen
10
+ * All rights reserved.
11
+ *
12
+ * The following license terms apply to projects that are in some way related to
13
+ * the "ZeroMQ project", including applications
14
+ * using "ZeroMQ project" and tools developed
15
+ * for enhancing "ZeroMQ project". All other projects
16
+ * (not related to "ZeroMQ project") have to use this
17
+ * code under the Aladdin Free Public License (AFPL)
18
+ * See the file "AFPL-license.txt" for more informations about the AFPL license.
19
+ * (see http://www.artifex.com/downloads/doc/Public.htm for detailed AFPL terms)
20
+ *
21
+ * Redistribution and use in source and binary forms, with or without
22
+ * modification, are permitted provided that the following conditions are met:
23
+ * * Redistributions of source code must retain the above copyright
24
+ * notice, this list of conditions and the following disclaimer.
25
+ * * Redistributions in binary form must reproduce the above copyright
26
+ * notice, this list of conditions and the following disclaimer in the
27
+ * documentation and/or other materials provided with the distribution.
28
+ * * Neither the name of Frank Vanden Berghen nor the
29
+ * names of its contributors may be used to endorse or promote products
30
+ * derived from this software without specific prior written permission.
31
+ *
32
+ * THIS SOFTWARE IS PROVIDED BY Frank Vanden Berghen ``AS IS'' AND ANY
33
+ * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
34
+ * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
35
+ * DISCLAIMED. IN NO EVENT SHALL <copyright holder> BE LIABLE FOR ANY
36
+ * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
37
+ * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
38
+ * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
39
+ * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
40
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
41
+ * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
42
+ *
43
+ * @version V2.39
44
+ * @author Frank Vanden Berghen
45
+ *
46
+ * \section tutorial First Tutorial
47
+ * You can follow a simple <a href="../../xmlParser.html">Tutorial</a> to know the basics...
48
+ *
49
+ * \section usage General usage: How to include the XMLParser library inside your project.
50
+ *
51
+ * The library is composed of two files: <a href="../../xmlParser.cpp">xmlParser.cpp</a> and
52
+ * <a href="../../xmlParser.h">xmlParser.h</a>. These are the ONLY 2 files that you need when
53
+ * using the library inside your own projects.
54
+ *
55
+ * All the functions of the library are documented inside the comments of the file
56
+ * <a href="../../xmlParser.h">xmlParser.h</a>. These comments can be transformed in
57
+ * full-fledged HTML documentation using the DOXYGEN software: simply type: "doxygen doxy.cfg"
58
+ *
59
+ * By default, the XMLParser library uses (char*) for string representation.To use the (wchar_t*)
60
+ * version of the library, you need to define the "_UNICODE" preprocessor definition variable
61
+ * (this is usually done inside your project definition file) (This is done automatically for you
62
+ * when using Visual Studio).
63
+ *
64
+ * \section example Advanced Tutorial and Many Examples of usage.
65
+ *
66
+ * Some very small introductory examples are described inside the Tutorial file
67
+ * <a href="../../xmlParser.html">xmlParser.html</a>
68
+ *
69
+ * Some additional small examples are also inside the file <a href="../../xmlTest.cpp">xmlTest.cpp</a>
70
+ * (for the "char*" version of the library) and inside the file
71
+ * <a href="../../xmlTestUnicode.cpp">xmlTestUnicode.cpp</a> (for the "wchar_t*"
72
+ * version of the library). If you have a question, please review these additionnal examples
73
+ * before sending an e-mail to the author.
74
+ *
75
+ * To build the examples:
76
+ * - linux/unix: type "make"
77
+ * - solaris: type "make -f makefile.solaris"
78
+ * - windows: Visual Studio: double-click on xmlParser.dsw
79
+ * (under Visual Studio .NET, the .dsp and .dsw files will be automatically converted to .vcproj and .sln files)
80
+ *
81
+ * In order to build the examples you need some additional files:
82
+ * - linux/unix: makefile
83
+ * - solaris: makefile.solaris
84
+ * - windows: Visual Studio: *.dsp, xmlParser.dsw and also xmlParser.lib and xmlParser.dll
85
+ *
86
+ * \section debugging Debugging with the XMLParser library
87
+ *
88
+ * \subsection debugwin Debugging under WINDOWS
89
+ *
90
+ * Inside Visual C++, the "debug versions" of the memory allocation functions are
91
+ * very slow: Do not forget to compile in "release mode" to get maximum speed.
92
+ * When I have to debug a software that is using the XMLParser Library, it was usually
93
+ * a nightmare because the library was sooOOOoooo slow in debug mode (because of the
94
+ * slow memory allocations in Debug mode). To solve this
95
+ * problem, during all the debugging session, I use a very fast DLL version of the
96
+ * XMLParser Library (the DLL is compiled in release mode). Using the DLL version of
97
+ * the XMLParser Library allows me to have lightening XML parsing speed even in debug!
98
+ * Other than that, the DLL version is useless: In the release version of my tool,
99
+ * I always use the normal, ".cpp"-based, XMLParser Library (I simply include the
100
+ * <a href="../../xmlParser.cpp">xmlParser.cpp</a> and
101
+ * <a href="../../xmlParser.h">xmlParser.h</a> files into the project).
102
+ *
103
+ * The file <a href="../../XMLNodeAutoexp.txt">XMLNodeAutoexp.txt</a> contains some
104
+ * "tweaks" that improve substancially the display of the content of the XMLNode objects
105
+ * inside the Visual Studio Debugger. Believe me, once you have seen inside the debugger
106
+ * the "smooth" display of the XMLNode objects, you cannot live without it anymore!
107
+ *
108
+ * \subsection debuglinux Debugging under LINUX/UNIX
109
+ *
110
+ * The speed of the debug version of the XMLParser library is tolerable so no extra
111
+ * work.has been done.
112
+ *
113
+ ****************************************************************************/
114
+
115
+ #ifndef __INCLUDE_XML_NODE__
116
+ #define __INCLUDE_XML_NODE__
117
+
118
+ #include <stdlib.h>
119
+
120
+ #ifdef _UNICODE
121
+ // If you comment the next "define" line then the library will never "switch to" _UNICODE (wchar_t*) mode (16/32 bits per characters).
122
+ // This is useful when you get error messages like:
123
+ // 'XMLNode::openFileHelper' : cannot convert parameter 2 from 'const char [5]' to 'const wchar_t *'
124
+ // The _XMLWIDECHAR preprocessor variable force the XMLParser library into either utf16/32-mode (the proprocessor variable
125
+ // must be defined) or utf8-mode(the pre-processor variable must be undefined).
126
+ #define _XMLWIDECHAR
127
+ #endif
128
+
129
+ #if defined(WIN32) || defined(UNDER_CE) || defined(_WIN32) || defined(WIN64) || defined(__BORLANDC__)
130
+ // comment the next line if you are under windows and the compiler is not Microsoft Visual Studio (6.0 or .NET) or Borland
131
+ #define _XMLWINDOWS
132
+ #endif
133
+
134
+ #ifdef XMLDLLENTRY
135
+ #undef XMLDLLENTRY
136
+ #endif
137
+ #ifdef _USE_XMLPARSER_DLL
138
+ #ifdef _DLL_EXPORTS_
139
+ #define XMLDLLENTRY __declspec(dllexport)
140
+ #else
141
+ #define XMLDLLENTRY __declspec(dllimport)
142
+ #endif
143
+ #else
144
+ #define XMLDLLENTRY
145
+ #endif
146
+
147
+ // uncomment the next line if you want no support for wchar_t* (no need for the <wchar.h> or <tchar.h> libraries anymore to compile)
148
+ //#define XML_NO_WIDE_CHAR
149
+
150
+ #ifdef XML_NO_WIDE_CHAR
151
+ #undef _XMLWINDOWS
152
+ #undef _XMLWIDECHAR
153
+ #endif
154
+
155
+ #ifdef _XMLWINDOWS
156
+ #include <tchar.h>
157
+ #else
158
+ #define XMLDLLENTRY
159
+ #ifndef XML_NO_WIDE_CHAR
160
+ #include <wchar.h> // to have 'wcsrtombs' for ANSI version
161
+ // to have 'mbsrtowcs' for WIDECHAR version
162
+ #endif
163
+ #endif
164
+
165
+ // Some common types for char set portable code
166
+ #ifdef _XMLWIDECHAR
167
+ #define _CXML(c) L ## c
168
+ #define XMLCSTR const wchar_t *
169
+ #define XMLSTR wchar_t *
170
+ #define XMLCHAR wchar_t
171
+ #else
172
+ #define _CXML(c) c
173
+ #define XMLCSTR const char *
174
+ #define XMLSTR char *
175
+ #define XMLCHAR char
176
+ #endif
177
+ #ifndef FALSE
178
+ #define FALSE 0
179
+ #endif /* FALSE */
180
+ #ifndef TRUE
181
+ #define TRUE 1
182
+ #endif /* TRUE */
183
+
184
+
185
+ /// Enumeration for XML parse errors.
186
+ typedef enum XMLError
187
+ {
188
+ eXMLErrorNone = 0,
189
+ eXMLErrorMissingEndTag,
190
+ eXMLErrorNoXMLTagFound,
191
+ eXMLErrorEmpty,
192
+ eXMLErrorMissingTagName,
193
+ eXMLErrorMissingEndTagName,
194
+ eXMLErrorUnmatchedEndTag,
195
+ eXMLErrorUnmatchedEndClearTag,
196
+ eXMLErrorUnexpectedToken,
197
+ eXMLErrorNoElements,
198
+ eXMLErrorFileNotFound,
199
+ eXMLErrorFirstTagNotFound,
200
+ eXMLErrorUnknownCharacterEntity,
201
+ eXMLErrorCharacterCodeAbove255,
202
+ eXMLErrorCharConversionError,
203
+ eXMLErrorCannotOpenWriteFile,
204
+ eXMLErrorCannotWriteFile,
205
+
206
+ eXMLErrorBase64DataSizeIsNotMultipleOf4,
207
+ eXMLErrorBase64DecodeIllegalCharacter,
208
+ eXMLErrorBase64DecodeTruncatedData,
209
+ eXMLErrorBase64DecodeBufferTooSmall
210
+ } XMLError;
211
+
212
+
213
+ /// Enumeration used to manage type of data. Use in conjunction with structure XMLNodeContents
214
+ typedef enum XMLElementType
215
+ {
216
+ eNodeChild=0,
217
+ eNodeAttribute=1,
218
+ eNodeText=2,
219
+ eNodeClear=3,
220
+ eNodeNULL=4
221
+ } XMLElementType;
222
+
223
+ /// Structure used to obtain error details if the parse fails.
224
+ typedef struct XMLResults
225
+ {
226
+ enum XMLError error;
227
+ int nLine,nColumn;
228
+ } XMLResults;
229
+
230
+ /// Structure for XML clear (unformatted) node (usually comments)
231
+ typedef struct XMLClear {
232
+ XMLCSTR lpszValue; XMLCSTR lpszOpenTag; XMLCSTR lpszCloseTag;
233
+ } XMLClear;
234
+
235
+ /// Structure for XML attribute.
236
+ typedef struct XMLAttribute {
237
+ XMLCSTR lpszName; XMLCSTR lpszValue;
238
+ } XMLAttribute;
239
+
240
+ /// XMLElementPosition are not interchangeable with simple indexes
241
+ typedef int XMLElementPosition;
242
+
243
+ struct XMLNodeContents;
244
+
245
+ /** @defgroup XMLParserGeneral The XML parser */
246
+
247
+ /// Main Class representing a XML node
248
+ /**
249
+ * All operations are performed using this class.
250
+ * \note The constructors of the XMLNode class are protected, so use instead one of these four methods to get your first instance of XMLNode:
251
+ * <ul>
252
+ * <li> XMLNode::parseString </li>
253
+ * <li> XMLNode::parseFile </li>
254
+ * <li> XMLNode::openFileHelper </li>
255
+ * <li> XMLNode::createXMLTopNode (or XMLNode::createXMLTopNode_WOSD)</li>
256
+ * </ul> */
257
+ typedef struct XMLDLLENTRY XMLNode
258
+ {
259
+ private:
260
+
261
+ struct XMLNodeDataTag;
262
+
263
+ /// Constructors are protected, so use instead one of: XMLNode::parseString, XMLNode::parseFile, XMLNode::openFileHelper, XMLNode::createXMLTopNode
264
+ XMLNode(struct XMLNodeDataTag *pParent, XMLSTR lpszName, char isDeclaration);
265
+ /// Constructors are protected, so use instead one of: XMLNode::parseString, XMLNode::parseFile, XMLNode::openFileHelper, XMLNode::createXMLTopNode
266
+ XMLNode(struct XMLNodeDataTag *p);
267
+
268
+ public:
269
+ static XMLCSTR getVersion();///< Return the XMLParser library version number
270
+
271
+ /** @defgroup conversions Parsing XML files/strings to an XMLNode structure and Rendering XMLNode's to files/string.
272
+ * @ingroup XMLParserGeneral
273
+ * @{ */
274
+
275
+ /// Parse an XML string and return the root of a XMLNode tree representing the string.
276
+ static XMLNode parseString (XMLCSTR lpXMLString, XMLCSTR tag=NULL, XMLResults *pResults=NULL);
277
+ /**< The "parseString" function parse an XML string and return the root of a XMLNode tree. The "opposite" of this function is
278
+ * the function "createXMLString" that re-creates an XML string from an XMLNode tree. If the XML document is corrupted, the
279
+ * "parseString" method will initialize the "pResults" variable with some information that can be used to trace the error.
280
+ * If you still want to parse the file, you can use the APPROXIMATE_PARSING option as explained inside the note at the
281
+ * beginning of the "xmlParser.cpp" file.
282
+ *
283
+ * @param lpXMLString the XML string to parse
284
+ * @param tag the name of the first tag inside the XML file. If the tag parameter is omitted, this function returns a node that represents the head of the xml document including the declaration term (<? ... ?>).
285
+ * @param pResults a pointer to a XMLResults variable that will contain some information that can be used to trace the XML parsing error. You can have a user-friendly explanation of the parsing error with the "getError" function.
286
+ */
287
+
288
+ /// Parse an XML file and return the root of a XMLNode tree representing the file.
289
+ static XMLNode parseFile (XMLCSTR filename, XMLCSTR tag=NULL, XMLResults *pResults=NULL);
290
+ /**< The "parseFile" function parse an XML file and return the root of a XMLNode tree. The "opposite" of this function is
291
+ * the function "writeToFile" that re-creates an XML file from an XMLNode tree. If the XML document is corrupted, the
292
+ * "parseFile" method will initialize the "pResults" variable with some information that can be used to trace the error.
293
+ * If you still want to parse the file, you can use the APPROXIMATE_PARSING option as explained inside the note at the
294
+ * beginning of the "xmlParser.cpp" file.
295
+ *
296
+ * @param filename the path to the XML file to parse
297
+ * @param tag the name of the first tag inside the XML file. If the tag parameter is omitted, this function returns a node that represents the head of the xml document including the declaration term (<? ... ?>).
298
+ * @param pResults a pointer to a XMLResults variable that will contain some information that can be used to trace the XML parsing error. You can have a user-friendly explanation of the parsing error with the "getError" function.
299
+ */
300
+
301
+ /// Parse an XML file and return the root of a XMLNode tree representing the file. A very crude error checking is made. An attempt to guess the Char Encoding used in the file is made.
302
+ static XMLNode openFileHelper(XMLCSTR filename, XMLCSTR tag=NULL);
303
+ /**< The "openFileHelper" function reports to the screen all the warnings and errors that occurred during parsing of the XML file.
304
+ * This function also tries to guess char Encoding (UTF-8, ASCII or SHIT-JIS) based on the first 200 bytes of the file. Since each
305
+ * application has its own way to report and deal with errors, you should rather use the "parseFile" function to parse XML files
306
+ * and program yourself thereafter an "error reporting" tailored for your needs (instead of using the very crude "error reporting"
307
+ * mechanism included inside the "openFileHelper" function).
308
+ *
309
+ * If the XML document is corrupted, the "openFileHelper" method will:
310
+ * - display an error message on the console (or inside a messageBox for windows).
311
+ * - stop execution (exit).
312
+ *
313
+ * I strongly suggest that you write your own "openFileHelper" method tailored to your needs. If you still want to parse
314
+ * the file, you can use the APPROXIMATE_PARSING option as explained inside the note at the beginning of the "xmlParser.cpp" file.
315
+ *
316
+ * @param filename the path of the XML file to parse.
317
+ * @param tag the name of the first tag inside the XML file. If the tag parameter is omitted, this function returns a node that represents the head of the xml document including the declaration term (<? ... ?>).
318
+ */
319
+
320
+ static XMLCSTR getError(XMLError error); ///< this gives you a user-friendly explanation of the parsing error
321
+
322
+ /// Create an XML string starting from the current XMLNode.
323
+ XMLSTR createXMLString(int nFormat=1, int *pnSize=NULL) const;
324
+ /**< The returned string should be free'd using the "freeXMLString" function.
325
+ *
326
+ * If nFormat==0, no formatting is required otherwise this returns an user friendly XML string from a given element
327
+ * with appropriate white spaces and carriage returns. if pnSize is given it returns the size in character of the string. */
328
+
329
+ /// Save the content of an xmlNode inside a file
330
+ XMLError writeToFile(XMLCSTR filename,
331
+ const char *encoding=NULL,
332
+ char nFormat=1) const;
333
+ /**< If nFormat==0, no formatting is required otherwise this returns an user friendly XML string from a given element with appropriate white spaces and carriage returns.
334
+ * If the global parameter "characterEncoding==encoding_UTF8", then the "encoding" parameter is ignored and always set to "utf-8".
335
+ * If the global parameter "characterEncoding==encoding_ShiftJIS", then the "encoding" parameter is ignored and always set to "SHIFT-JIS".
336
+ * If "_XMLWIDECHAR=1", then the "encoding" parameter is ignored and always set to "utf-16".
337
+ * If no "encoding" parameter is given the "ISO-8859-1" encoding is used. */
338
+ /** @} */
339
+
340
+ /** @defgroup navigate Navigate the XMLNode structure
341
+ * @ingroup XMLParserGeneral
342
+ * @{ */
343
+ XMLCSTR getName() const; ///< name of the node
344
+ XMLCSTR getText(int i=0) const; ///< return ith text field
345
+ int nText() const; ///< nbr of text field
346
+ XMLNode getParentNode() const; ///< return the parent node
347
+ XMLNode getChildNode(int i=0) const; ///< return ith child node
348
+ XMLNode getChildNode(XMLCSTR name, int i) const; ///< return ith child node with specific name (return an empty node if failing). If i==-1, this returns the last XMLNode with the given name.
349
+ XMLNode getChildNode(XMLCSTR name, int *i=NULL) const; ///< return next child node with specific name (return an empty node if failing)
350
+ XMLNode getChildNodeWithAttribute(XMLCSTR tagName,
351
+ XMLCSTR attributeName,
352
+ XMLCSTR attributeValue=NULL,
353
+ int *i=NULL) const; ///< return child node with specific name/attribute (return an empty node if failing)
354
+ XMLNode getChildNodeByPath(XMLCSTR path, char createNodeIfMissing=0, XMLCHAR sep='/');
355
+ ///< return the first child node with specific path
356
+ XMLNode getChildNodeByPathNonConst(XMLSTR path, char createNodeIfMissing=0, XMLCHAR sep='/');
357
+ ///< return the first child node with specific path.
358
+
359
+ int nChildNode(XMLCSTR name) const; ///< return the number of child node with specific name
360
+ int nChildNode() const; ///< nbr of child node
361
+ XMLAttribute getAttribute(int i=0) const; ///< return ith attribute
362
+ XMLCSTR getAttributeName(int i=0) const; ///< return ith attribute name
363
+ XMLCSTR getAttributeValue(int i=0) const; ///< return ith attribute value
364
+ char isAttributeSet(XMLCSTR name) const; ///< test if an attribute with a specific name is given
365
+ XMLCSTR getAttribute(XMLCSTR name, int i) const; ///< return ith attribute content with specific name (return a NULL if failing)
366
+ XMLCSTR getAttribute(XMLCSTR name, int *i=NULL) const; ///< return next attribute content with specific name (return a NULL if failing)
367
+ int nAttribute() const; ///< nbr of attribute
368
+ XMLClear getClear(int i=0) const; ///< return ith clear field (comments)
369
+ int nClear() const; ///< nbr of clear field
370
+ XMLNodeContents enumContents(XMLElementPosition i) const; ///< enumerate all the different contents (attribute,child,text, clear) of the current XMLNode. The order is reflecting the order of the original file/string. NOTE: 0 <= i < nElement();
371
+ int nElement() const; ///< nbr of different contents for current node
372
+ char isEmpty() const; ///< is this node Empty?
373
+ char isDeclaration() const; ///< is this node a declaration <? .... ?>
374
+ XMLNode deepCopy() const; ///< deep copy (duplicate/clone) a XMLNode
375
+ static XMLNode emptyNode(); ///< return XMLNode::emptyXMLNode;
376
+ /** @} */
377
+
378
+ ~XMLNode();
379
+ XMLNode(const XMLNode &A); ///< to allow shallow/fast copy:
380
+ XMLNode& operator=( const XMLNode& A ); ///< to allow shallow/fast copy:
381
+
382
+ XMLNode(): d(NULL){}
383
+ static XMLNode emptyXMLNode;
384
+ static XMLClear emptyXMLClear;
385
+ static XMLAttribute emptyXMLAttribute;
386
+
387
+ /** @defgroup xmlModify Create or Update the XMLNode structure
388
+ * @ingroup XMLParserGeneral
389
+ * The functions in this group allows you to create from scratch (or update) a XMLNode structure. Start by creating your top
390
+ * node with the "createXMLTopNode" function and then add new nodes with the "addChild" function. The parameter 'pos' gives
391
+ * the position where the childNode, the text or the XMLClearTag will be inserted. The default value (pos=-1) inserts at the
392
+ * end. The value (pos=0) insert at the beginning (Insertion at the beginning is slower than at the end). <br>
393
+ *
394
+ * REMARK: 0 <= pos < nChild()+nText()+nClear() <br>
395
+ */
396
+
397
+ /** @defgroup creation Creating from scratch a XMLNode structure
398
+ * @ingroup xmlModify
399
+ * @{ */
400
+ static XMLNode createXMLTopNode(XMLCSTR lpszName, char isDeclaration=FALSE); ///< Create the top node of an XMLNode structure
401
+ XMLNode addChild(XMLCSTR lpszName, char isDeclaration=FALSE, XMLElementPosition pos=-1); ///< Add a new child node
402
+ XMLNode addChild(XMLNode nodeToAdd, XMLElementPosition pos=-1); ///< If the "nodeToAdd" has some parents, it will be detached from it's parents before being attached to the current XMLNode
403
+ XMLAttribute *addAttribute(XMLCSTR lpszName, XMLCSTR lpszValuev); ///< Add a new attribute
404
+ XMLCSTR addText(XMLCSTR lpszValue, XMLElementPosition pos=-1); ///< Add a new text content
405
+ XMLClear *addClear(XMLCSTR lpszValue, XMLCSTR lpszOpen=NULL, XMLCSTR lpszClose=NULL, XMLElementPosition pos=-1);
406
+ /**< Add a new clear tag
407
+ * @param lpszOpen default value "<![CDATA["
408
+ * @param lpszClose default value "]]>"
409
+ */
410
+ /** @} */
411
+
412
+ /** @defgroup xmlUpdate Updating Nodes
413
+ * @ingroup xmlModify
414
+ * Some update functions:
415
+ * @{
416
+ */
417
+ XMLCSTR updateName(XMLCSTR lpszName); ///< change node's name
418
+ XMLAttribute *updateAttribute(XMLAttribute *newAttribute, XMLAttribute *oldAttribute); ///< if the attribute to update is missing, a new one will be added
419
+ XMLAttribute *updateAttribute(XMLCSTR lpszNewValue, XMLCSTR lpszNewName=NULL,int i=0); ///< if the attribute to update is missing, a new one will be added
420
+ XMLAttribute *updateAttribute(XMLCSTR lpszNewValue, XMLCSTR lpszNewName,XMLCSTR lpszOldName);///< set lpszNewName=NULL if you don't want to change the name of the attribute if the attribute to update is missing, a new one will be added
421
+ XMLCSTR updateText(XMLCSTR lpszNewValue, int i=0); ///< if the text to update is missing, a new one will be added
422
+ XMLCSTR updateText(XMLCSTR lpszNewValue, XMLCSTR lpszOldValue); ///< if the text to update is missing, a new one will be added
423
+ XMLClear *updateClear(XMLCSTR lpszNewContent, int i=0); ///< if the clearTag to update is missing, a new one will be added
424
+ XMLClear *updateClear(XMLClear *newP,XMLClear *oldP); ///< if the clearTag to update is missing, a new one will be added
425
+ XMLClear *updateClear(XMLCSTR lpszNewValue, XMLCSTR lpszOldValue); ///< if the clearTag to update is missing, a new one will be added
426
+ /** @} */
427
+
428
+ /** @defgroup xmlDelete Deleting Nodes or Attributes
429
+ * @ingroup xmlModify
430
+ * Some deletion functions:
431
+ * @{
432
+ */
433
+ /// The "deleteNodeContent" function forces the deletion of the content of this XMLNode and the subtree.
434
+ void deleteNodeContent();
435
+ /**< \note The XMLNode instances that are referring to the part of the subtree that has been deleted CANNOT be used anymore!!. Unexpected results will occur if you continue using them. */
436
+ void deleteAttribute(int i=0); ///< Delete the ith attribute of the current XMLNode
437
+ void deleteAttribute(XMLCSTR lpszName); ///< Delete the attribute with the given name (the "strcmp" function is used to find the right attribute)
438
+ void deleteAttribute(XMLAttribute *anAttribute); ///< Delete the attribute with the name "anAttribute->lpszName" (the "strcmp" function is used to find the right attribute)
439
+ void deleteText(int i=0); ///< Delete the Ith text content of the current XMLNode
440
+ void deleteText(XMLCSTR lpszValue); ///< Delete the text content "lpszValue" inside the current XMLNode (direct "pointer-to-pointer" comparison is used to find the right text)
441
+ void deleteClear(int i=0); ///< Delete the Ith clear tag inside the current XMLNode
442
+ void deleteClear(XMLCSTR lpszValue); ///< Delete the clear tag "lpszValue" inside the current XMLNode (direct "pointer-to-pointer" comparison is used to find the clear tag)
443
+ void deleteClear(XMLClear *p); ///< Delete the clear tag "p" inside the current XMLNode (direct "pointer-to-pointer" comparison on the lpszName of the clear tag is used to find the clear tag)
444
+ /** @} */
445
+
446
+ /** @defgroup xmlWOSD ???_WOSD functions.
447
+ * @ingroup xmlModify
448
+ * The strings given as parameters for the "add" and "update" methods that have a name with
449
+ * the postfix "_WOSD" (that means "WithOut String Duplication")(for example "addText_WOSD")
450
+ * will be free'd by the XMLNode class. For example, it means that this is incorrect:
451
+ * \code
452
+ * xNode.addText_WOSD("foo");
453
+ * xNode.updateAttribute_WOSD("#newcolor" ,NULL,"color");
454
+ * \endcode
455
+ * In opposition, this is correct:
456
+ * \code
457
+ * xNode.addText("foo");
458
+ * xNode.addText_WOSD(stringDup("foo"));
459
+ * xNode.updateAttribute("#newcolor" ,NULL,"color");
460
+ * xNode.updateAttribute_WOSD(stringDup("#newcolor"),NULL,"color");
461
+ * \endcode
462
+ * Typically, you will never do:
463
+ * \code
464
+ * char *b=(char*)malloc(...);
465
+ * xNode.addText(b);
466
+ * free(b);
467
+ * \endcode
468
+ * ... but rather:
469
+ * \code
470
+ * char *b=(char*)malloc(...);
471
+ * xNode.addText_WOSD(b);
472
+ * \endcode
473
+ * ('free(b)' is performed by the XMLNode class)
474
+ * @{ */
475
+ static XMLNode createXMLTopNode_WOSD(XMLSTR lpszName, char isDeclaration=FALSE); ///< Create the top node of an XMLNode structure
476
+ XMLNode addChild_WOSD(XMLSTR lpszName, char isDeclaration=FALSE, XMLElementPosition pos=-1); ///< Add a new child node
477
+ XMLAttribute *addAttribute_WOSD(XMLSTR lpszName, XMLSTR lpszValue); ///< Add a new attribute
478
+ XMLCSTR addText_WOSD(XMLSTR lpszValue, XMLElementPosition pos=-1); ///< Add a new text content
479
+ XMLClear *addClear_WOSD(XMLSTR lpszValue, XMLCSTR lpszOpen=NULL, XMLCSTR lpszClose=NULL, XMLElementPosition pos=-1); ///< Add a new clear Tag
480
+
481
+ XMLCSTR updateName_WOSD(XMLSTR lpszName); ///< change node's name
482
+ XMLAttribute *updateAttribute_WOSD(XMLAttribute *newAttribute, XMLAttribute *oldAttribute); ///< if the attribute to update is missing, a new one will be added
483
+ XMLAttribute *updateAttribute_WOSD(XMLSTR lpszNewValue, XMLSTR lpszNewName=NULL,int i=0); ///< if the attribute to update is missing, a new one will be added
484
+ XMLAttribute *updateAttribute_WOSD(XMLSTR lpszNewValue, XMLSTR lpszNewName,XMLCSTR lpszOldName); ///< set lpszNewName=NULL if you don't want to change the name of the attribute if the attribute to update is missing, a new one will be added
485
+ XMLCSTR updateText_WOSD(XMLSTR lpszNewValue, int i=0); ///< if the text to update is missing, a new one will be added
486
+ XMLCSTR updateText_WOSD(XMLSTR lpszNewValue, XMLCSTR lpszOldValue); ///< if the text to update is missing, a new one will be added
487
+ XMLClear *updateClear_WOSD(XMLSTR lpszNewContent, int i=0); ///< if the clearTag to update is missing, a new one will be added
488
+ XMLClear *updateClear_WOSD(XMLClear *newP,XMLClear *oldP); ///< if the clearTag to update is missing, a new one will be added
489
+ XMLClear *updateClear_WOSD(XMLSTR lpszNewValue, XMLCSTR lpszOldValue); ///< if the clearTag to update is missing, a new one will be added
490
+ /** @} */
491
+
492
+ /** @defgroup xmlPosition Position helper functions (use in conjunction with the update&add functions
493
+ * @ingroup xmlModify
494
+ * These are some useful functions when you want to insert a childNode, a text or a XMLClearTag in the
495
+ * middle (at a specified position) of a XMLNode tree already constructed. The value returned by these
496
+ * methods is to be used as last parameter (parameter 'pos') of addChild, addText or addClear.
497
+ * @{ */
498
+ XMLElementPosition positionOfText(int i=0) const;
499
+ XMLElementPosition positionOfText(XMLCSTR lpszValue) const;
500
+ XMLElementPosition positionOfClear(int i=0) const;
501
+ XMLElementPosition positionOfClear(XMLCSTR lpszValue) const;
502
+ XMLElementPosition positionOfClear(XMLClear *a) const;
503
+ XMLElementPosition positionOfChildNode(int i=0) const;
504
+ XMLElementPosition positionOfChildNode(XMLNode x) const;
505
+ XMLElementPosition positionOfChildNode(XMLCSTR name, int i=0) const; ///< return the position of the ith childNode with the specified name if (name==NULL) return the position of the ith childNode
506
+ /** @} */
507
+
508
+ /// Enumeration for XML character encoding.
509
+ typedef enum XMLCharEncoding
510
+ {
511
+ char_encoding_error=0,
512
+ char_encoding_UTF8=1,
513
+ char_encoding_legacy=2,
514
+ char_encoding_ShiftJIS=3,
515
+ char_encoding_GB2312=4,
516
+ char_encoding_Big5=5,
517
+ char_encoding_GBK=6 // this is actually the same as Big5
518
+ } XMLCharEncoding;
519
+
520
+ /** \addtogroup conversions
521
+ * @{ */
522
+
523
+ /// Sets the global options for the conversions
524
+ static char setGlobalOptions(XMLCharEncoding characterEncoding=XMLNode::char_encoding_UTF8, char guessWideCharChars=1,
525
+ char dropWhiteSpace=1, char removeCommentsInMiddleOfText=1);
526
+ /**< The "setGlobalOptions" function allows you to change four global parameters that affect string & file
527
+ * parsing. First of all, you most-probably will never have to change these 3 global parameters.
528
+ *
529
+ * @param guessWideCharChars If "guessWideCharChars"=1 and if this library is compiled in WideChar mode, then the
530
+ * XMLNode::parseFile and XMLNode::openFileHelper functions will test if the file contains ASCII
531
+ * characters. If this is the case, then the file will be loaded and converted in memory to
532
+ * WideChar before being parsed. If 0, no conversion will be performed.
533
+ *
534
+ * @param guessWideCharChars If "guessWideCharChars"=1 and if this library is compiled in ASCII/UTF8/char* mode, then the
535
+ * XMLNode::parseFile and XMLNode::openFileHelper functions will test if the file contains WideChar
536
+ * characters. If this is the case, then the file will be loaded and converted in memory to
537
+ * ASCII/UTF8/char* before being parsed. If 0, no conversion will be performed.
538
+ *
539
+ * @param characterEncoding This parameter is only meaningful when compiling in char* mode (multibyte character mode).
540
+ * In wchar_t* (wide char mode), this parameter is ignored. This parameter should be one of the
541
+ * three currently recognized encodings: XMLNode::encoding_UTF8, XMLNode::encoding_ascii,
542
+ * XMLNode::encoding_ShiftJIS.
543
+ *
544
+ * @param dropWhiteSpace In most situations, text fields containing only white spaces (and carriage returns)
545
+ * are useless. Even more, these "empty" text fields are annoying because they increase the
546
+ * complexity of the user's code for parsing. So, 99% of the time, it's better to drop
547
+ * the "empty" text fields. However The XML specification indicates that no white spaces
548
+ * should be lost when parsing the file. So to be perfectly XML-compliant, you should set
549
+ * dropWhiteSpace=0. A note of caution: if you set "dropWhiteSpace=0", the parser will be
550
+ * slower and your code will be more complex.
551
+ *
552
+ * @param removeCommentsInMiddleOfText To explain this parameter, let's consider this code:
553
+ * \code
554
+ * XMLNode x=XMLNode::parseString("<a>foo<!-- hello -->bar<!DOCTYPE world >chu</a>","a");
555
+ * \endcode
556
+ * If removeCommentsInMiddleOfText=0, then we will have:
557
+ * \code
558
+ * x.getText(0) -> "foo"
559
+ * x.getText(1) -> "bar"
560
+ * x.getText(2) -> "chu"
561
+ * x.getClear(0) --> "<!-- hello -->"
562
+ * x.getClear(1) --> "<!DOCTYPE world >"
563
+ * \endcode
564
+ * If removeCommentsInMiddleOfText=1, then we will have:
565
+ * \code
566
+ * x.getText(0) -> "foobar"
567
+ * x.getText(1) -> "chu"
568
+ * x.getClear(0) --> "<!DOCTYPE world >"
569
+ * \endcode
570
+ *
571
+ * \return "0" when there are no errors. If you try to set an unrecognized encoding then the return value will be "1" to signal an error.
572
+ *
573
+ * \note Sometime, it's useful to set "guessWideCharChars=0" to disable any conversion
574
+ * because the test to detect the file-type (ASCII/UTF8/char* or WideChar) may fail (rarely). */
575
+
576
+ /// Guess the character encoding of the string (ascii, utf8 or shift-JIS)
577
+ static XMLCharEncoding guessCharEncoding(void *buffer, int bufLen, char useXMLEncodingAttribute=1);
578
+ /**< The "guessCharEncoding" function try to guess the character encoding. You most-probably will never
579
+ * have to use this function. It then returns the appropriate value of the global parameter
580
+ * "characterEncoding" described in the XMLNode::setGlobalOptions. The guess is based on the content of a buffer of length
581
+ * "bufLen" bytes that contains the first bytes (minimum 25 bytes; 200 bytes is a good value) of the
582
+ * file to be parsed. The XMLNode::openFileHelper function is using this function to automatically compute
583
+ * the value of the "characterEncoding" global parameter. There are several heuristics used to do the
584
+ * guess. One of the heuristic is based on the "encoding" attribute. The original XML specifications
585
+ * forbids to use this attribute to do the guess but you can still use it if you set
586
+ * "useXMLEncodingAttribute" to 1 (this is the default behavior and the behavior of most parsers).
587
+ * If an inconsistency in the encoding is detected, then the return value is "0". */
588
+ /** @} */
589
+
590
+ private:
591
+ // these are functions and structures used internally by the XMLNode class (don't bother about them):
592
+
593
+ typedef struct XMLNodeDataTag // to allow shallow copy and "intelligent/smart" pointers (automatic delete):
594
+ {
595
+ XMLCSTR lpszName; // Element name (=NULL if root)
596
+ int nChild, // Number of child nodes
597
+ nText, // Number of text fields
598
+ nClear, // Number of Clear fields (comments)
599
+ nAttribute; // Number of attributes
600
+ char isDeclaration; // Whether node is an XML declaration - '<?xml ?>'
601
+ struct XMLNodeDataTag *pParent; // Pointer to parent element (=NULL if root)
602
+ XMLNode *pChild; // Array of child nodes
603
+ XMLCSTR *pText; // Array of text fields
604
+ XMLClear *pClear; // Array of clear fields
605
+ XMLAttribute *pAttribute; // Array of attributes
606
+ int *pOrder; // order of the child_nodes,text_fields,clear_fields
607
+ int ref_count; // for garbage collection (smart pointers)
608
+ } XMLNodeData;
609
+ XMLNodeData *d;
610
+
611
+ char parseClearTag(void *px, void *pa);
612
+ char maybeAddTxT(void *pa, XMLCSTR tokenPStr);
613
+ int ParseXMLElement(void *pXML);
614
+ void *addToOrder(int memInc, int *_pos, int nc, void *p, int size, XMLElementType xtype);
615
+ int indexText(XMLCSTR lpszValue) const;
616
+ int indexClear(XMLCSTR lpszValue) const;
617
+ XMLNode addChild_priv(int,XMLSTR,char,int);
618
+ XMLAttribute *addAttribute_priv(int,XMLSTR,XMLSTR);
619
+ XMLCSTR addText_priv(int,XMLSTR,int);
620
+ XMLClear *addClear_priv(int,XMLSTR,XMLCSTR,XMLCSTR,int);
621
+ void emptyTheNode(char force);
622
+ static inline XMLElementPosition findPosition(XMLNodeData *d, int index, XMLElementType xtype);
623
+ static int CreateXMLStringR(XMLNodeData *pEntry, XMLSTR lpszMarker, int nFormat);
624
+ static int removeOrderElement(XMLNodeData *d, XMLElementType t, int index);
625
+ static void exactMemory(XMLNodeData *d);
626
+ static int detachFromParent(XMLNodeData *d);
627
+ } XMLNode;
628
+
629
+ /// This structure is given by the function XMLNode::enumContents.
630
+ typedef struct XMLNodeContents
631
+ {
632
+ /// This dictates what's the content of the XMLNodeContent
633
+ enum XMLElementType etype;
634
+ /**< should be an union to access the appropriate data. Compiler does not allow union of object with constructor... too bad. */
635
+ XMLNode child;
636
+ XMLAttribute attrib;
637
+ XMLCSTR text;
638
+ XMLClear clear;
639
+
640
+ } XMLNodeContents;
641
+
642
+ /** @defgroup StringAlloc String Allocation/Free functions
643
+ * @ingroup xmlModify
644
+ * @{ */
645
+ /// Duplicate (copy in a new allocated buffer) the source string.
646
+ XMLDLLENTRY XMLSTR stringDup(XMLCSTR source, int cbData=-1);
647
+ /**< This is
648
+ * a very handy function when used with all the "XMLNode::*_WOSD" functions (\link xmlWOSD \endlink).
649
+ * @param cbData If !=0 then cbData is the number of chars to duplicate. New strings allocated with
650
+ * this function should be free'd using the "freeXMLString" function. */
651
+
652
+ /// to free the string allocated inside the "stringDup" function or the "createXMLString" function.
653
+ XMLDLLENTRY void freeXMLString(XMLSTR t); // {free(t);}
654
+ /** @} */
655
+
656
+ /** @defgroup atoX ato? like functions
657
+ * @ingroup XMLParserGeneral
658
+ * The "xmlto?" functions are equivalents to the atoi, atol, atof functions.
659
+ * The only difference is: If the variable "xmlString" is NULL, than the return value
660
+ * is "defautValue". These 6 functions are only here as "convenience" functions for the
661
+ * user (they are not used inside the XMLparser). If you don't need them, you can
662
+ * delete them without any trouble.
663
+ *
664
+ * @{ */
665
+ XMLDLLENTRY char xmltob(XMLCSTR xmlString,char defautValue=0);
666
+ XMLDLLENTRY int xmltoi(XMLCSTR xmlString,int defautValue=0);
667
+ XMLDLLENTRY long xmltol(XMLCSTR xmlString,long defautValue=0);
668
+ XMLDLLENTRY double xmltof(XMLCSTR xmlString,double defautValue=.0);
669
+ XMLDLLENTRY XMLCSTR xmltoa(XMLCSTR xmlString,XMLCSTR defautValue=_CXML(""));
670
+ XMLDLLENTRY XMLCHAR xmltoc(XMLCSTR xmlString,XMLCHAR defautValue=_CXML('\0'));
671
+ /** @} */
672
+
673
+ /** @defgroup ToXMLStringTool Helper class to create XML files using "printf", "fprintf", "cout",... functions.
674
+ * @ingroup XMLParserGeneral
675
+ * @{ */
676
+ /// Helper class to create XML files using "printf", "fprintf", "cout",... functions.
677
+ /** The ToXMLStringTool class helps you creating XML files using "printf", "fprintf", "cout",... functions.
678
+ * The "ToXMLStringTool" class is processing strings so that all the characters
679
+ * &,",',<,> are replaced by their XML equivalent:
680
+ * \verbatim &amp;, &quot;, &apos;, &lt;, &gt; \endverbatim
681
+ * Using the "ToXMLStringTool class" and the "fprintf function" is THE most efficient
682
+ * way to produce VERY large XML documents VERY fast.
683
+ * \note If you are creating from scratch an XML file using the provided XMLNode class
684
+ * you must not use the "ToXMLStringTool" class (because the "XMLNode" class does the
685
+ * processing job for you during rendering).*/
686
+ typedef struct XMLDLLENTRY ToXMLStringTool
687
+ {
688
+ public:
689
+ ToXMLStringTool(): buf(NULL),buflen(0){}
690
+ ~ToXMLStringTool();
691
+ void freeBuffer();///<call this function when you have finished using this object to release memory used by the internal buffer.
692
+
693
+ XMLSTR toXML(XMLCSTR source);///< returns a pointer to an internal buffer that contains a XML-encoded string based on the "source" parameter.
694
+
695
+ /** The "toXMLUnSafe" function is deprecated because there is a possibility of
696
+ * "destination-buffer-overflow". It converts the string
697
+ * "source" to the string "dest". */
698
+ static XMLSTR toXMLUnSafe(XMLSTR dest,XMLCSTR source); ///< deprecated: use "toXML" instead
699
+ static int lengthXMLString(XMLCSTR source); ///< deprecated: use "toXML" instead
700
+
701
+ private:
702
+ XMLSTR buf;
703
+ int buflen;
704
+ } ToXMLStringTool;
705
+ /** @} */
706
+
707
+ /** @defgroup XMLParserBase64Tool Helper class to include binary data inside XML strings using "Base64 encoding".
708
+ * @ingroup XMLParserGeneral
709
+ * @{ */
710
+ /// Helper class to include binary data inside XML strings using "Base64 encoding".
711
+ /** The "XMLParserBase64Tool" class allows you to include any binary data (images, sounds,...)
712
+ * into an XML document using "Base64 encoding". This class is completely
713
+ * separated from the rest of the xmlParser library and can be removed without any problem.
714
+ * To include some binary data into an XML file, you must convert the binary data into
715
+ * standard text (using "encode"). To retrieve the original binary data from the
716
+ * b64-encoded text included inside the XML file, use "decode". Alternatively, these
717
+ * functions can also be used to "encrypt/decrypt" some critical data contained inside
718
+ * the XML (it's not a strong encryption at all, but sometimes it can be useful). */
719
+ typedef struct XMLDLLENTRY XMLParserBase64Tool
720
+ {
721
+ public:
722
+ XMLParserBase64Tool(): buf(NULL),buflen(0){}
723
+ ~XMLParserBase64Tool();
724
+ void freeBuffer();///< Call this function when you have finished using this object to release memory used by the internal buffer.
725
+
726
+ /**
727
+ * @param formatted If "formatted"=true, some space will be reserved for a carriage-return every 72 chars. */
728
+ static int encodeLength(int inBufLen, char formatted=0); ///< return the length of the base64 string that encodes a data buffer of size inBufLen bytes.
729
+
730
+ /**
731
+ * The "base64Encode" function returns a string containing the base64 encoding of "inByteLen" bytes
732
+ * from "inByteBuf". If "formatted" parameter is true, then there will be a carriage-return every 72 chars.
733
+ * The string will be free'd when the XMLParserBase64Tool object is deleted.
734
+ * All returned strings are sharing the same memory space. */
735
+ XMLSTR encode(unsigned char *inByteBuf, unsigned int inByteLen, char formatted=0); ///< returns a pointer to an internal buffer containing the base64 string containing the binary data encoded from "inByteBuf"
736
+
737
+ /// returns the number of bytes which will be decoded from "inString".
738
+ static unsigned int decodeSize(XMLCSTR inString, XMLError *xe=NULL);
739
+
740
+ /**
741
+ * The "decode" function returns a pointer to a buffer containing the binary data decoded from "inString"
742
+ * The output buffer will be free'd when the XMLParserBase64Tool object is deleted.
743
+ * All output buffer are sharing the same memory space.
744
+ * @param inString If "instring" is malformed, NULL will be returned */
745
+ unsigned char* decode(XMLCSTR inString, int *outByteLen=NULL, XMLError *xe=NULL); ///< returns a pointer to an internal buffer containing the binary data decoded from "inString"
746
+
747
+ /**
748
+ * decodes data from "inString" to "outByteBuf". You need to provide the size (in byte) of "outByteBuf"
749
+ * in "inMaxByteOutBuflen". If "outByteBuf" is not large enough or if data is malformed, then "FALSE"
750
+ * will be returned; otherwise "TRUE". */
751
+ static unsigned char decode(XMLCSTR inString, unsigned char *outByteBuf, int inMaxByteOutBuflen, XMLError *xe=NULL); ///< deprecated.
752
+
753
+ private:
754
+ void *buf;
755
+ int buflen;
756
+ void alloc(int newsize);
757
+ }XMLParserBase64Tool;
758
+ /** @} */
759
+
760
+ #undef XMLDLLENTRY
761
+
762
+ #endif