redsnow 0.3.1 → 0.3.2

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 (583) hide show
  1. checksums.yaml +4 -4
  2. data/Gemfile.lock +67 -0
  3. data/Rakefile +1 -1
  4. data/doc/RedSnow.html +321 -0
  5. data/doc/RedSnow/Action.html +702 -0
  6. data/doc/RedSnow/Binding.html +135 -0
  7. data/doc/RedSnow/Blueprint.html +657 -0
  8. data/doc/RedSnow/BlueprintNode.html +139 -0
  9. data/doc/RedSnow/ErrorCodes.html +165 -0
  10. data/doc/RedSnow/Headers.html +456 -0
  11. data/doc/RedSnow/KeyValueCollection.html +343 -0
  12. data/doc/RedSnow/Location.html +391 -0
  13. data/doc/RedSnow/Metadata.html +343 -0
  14. data/doc/RedSnow/NamedBlueprintNode.html +444 -0
  15. data/doc/RedSnow/Object.html +295 -0
  16. data/doc/RedSnow/Parameter.html +881 -0
  17. data/doc/RedSnow/Parameters.html +349 -0
  18. data/doc/RedSnow/ParseResult.html +570 -0
  19. data/doc/RedSnow/Payload.html +775 -0
  20. data/doc/RedSnow/Resource.html +790 -0
  21. data/doc/RedSnow/ResourceGroup.html +521 -0
  22. data/doc/RedSnow/TransactionExample.html +700 -0
  23. data/doc/RedSnow/WarningCodes.html +210 -0
  24. data/doc/_index.html +342 -0
  25. data/doc/class_list.html +54 -0
  26. data/doc/css/common.css +1 -0
  27. data/doc/css/full_list.css +57 -0
  28. data/doc/css/style.css +339 -0
  29. data/doc/file.README.html +136 -0
  30. data/doc/file_list.html +56 -0
  31. data/doc/frames.html +26 -0
  32. data/doc/index.html +136 -0
  33. data/doc/js/app.js +219 -0
  34. data/doc/js/full_list.js +178 -0
  35. data/doc/js/jquery.js +4 -0
  36. data/doc/method_list.html +347 -0
  37. data/doc/top-level-namespace.html +112 -0
  38. data/ext/snowcrash/Gemfile +8 -0
  39. data/ext/snowcrash/Gemfile.lock +40 -0
  40. data/ext/snowcrash/LICENSE +22 -0
  41. data/ext/snowcrash/README.md +118 -0
  42. data/ext/snowcrash/bin/snowcrash +0 -0
  43. data/ext/snowcrash/bin/test-libsnowcrash +0 -0
  44. data/ext/snowcrash/build/Makefile +375 -0
  45. data/ext/snowcrash/build/gyp-mac-tool +511 -0
  46. data/ext/snowcrash/build/libmarkdownparser.target.mk +137 -0
  47. data/ext/snowcrash/build/libsnowcrash.target.mk +165 -0
  48. data/ext/snowcrash/build/libsundown.target.mk +143 -0
  49. data/ext/snowcrash/build/out/Release/libmarkdownparser.a +0 -0
  50. data/ext/snowcrash/build/out/Release/libsnowcrash.dylib +0 -0
  51. data/ext/snowcrash/build/out/Release/libsundown.a +0 -0
  52. data/ext/snowcrash/build/out/Release/linker.lock +0 -0
  53. data/ext/snowcrash/build/out/Release/obj.target/libmarkdownparser/ext/markdown-parser/src/ByteBuffer.o +0 -0
  54. data/ext/snowcrash/build/out/Release/obj.target/libmarkdownparser/ext/markdown-parser/src/MarkdownNode.o +0 -0
  55. data/ext/snowcrash/build/out/Release/obj.target/libmarkdownparser/ext/markdown-parser/src/MarkdownParser.o +0 -0
  56. data/ext/snowcrash/build/out/Release/obj.target/libsnowcrash/src/CBlueprint.o +0 -0
  57. data/ext/snowcrash/build/out/Release/obj.target/libsnowcrash/src/CBlueprintSourcemap.o +0 -0
  58. data/ext/snowcrash/build/out/Release/obj.target/libsnowcrash/src/CSourceAnnotation.o +0 -0
  59. data/ext/snowcrash/build/out/Release/obj.target/libsnowcrash/src/HTTP.o +0 -0
  60. data/ext/snowcrash/build/out/Release/obj.target/libsnowcrash/src/MarkdownBlock.o +0 -0
  61. data/ext/snowcrash/build/out/Release/obj.target/libsnowcrash/src/MarkdownParser.o +0 -0
  62. data/ext/snowcrash/build/out/Release/obj.target/libsnowcrash/src/Parser.o +0 -0
  63. data/ext/snowcrash/build/out/Release/obj.target/libsnowcrash/src/ParserCore.o +0 -0
  64. data/ext/snowcrash/build/out/Release/obj.target/libsnowcrash/src/Section.o +0 -0
  65. data/ext/snowcrash/build/out/Release/obj.target/libsnowcrash/src/Serialize.o +0 -0
  66. data/ext/snowcrash/build/out/Release/obj.target/libsnowcrash/src/SerializeJSON.o +0 -0
  67. data/ext/snowcrash/build/out/Release/obj.target/libsnowcrash/src/SerializeYAML.o +0 -0
  68. data/ext/snowcrash/build/out/Release/obj.target/libsnowcrash/src/Signature.o +0 -0
  69. data/ext/snowcrash/build/out/Release/obj.target/libsnowcrash/src/UriTemplateParser.o +0 -0
  70. data/ext/snowcrash/build/out/Release/obj.target/libsnowcrash/src/csnowcrash.o +0 -0
  71. data/ext/snowcrash/build/out/Release/obj.target/libsnowcrash/src/posix/RegexMatch.o +0 -0
  72. data/ext/snowcrash/build/out/Release/obj.target/libsnowcrash/src/snowcrash.o +0 -0
  73. data/ext/snowcrash/build/out/Release/obj.target/libsundown/ext/markdown-parser/ext/sundown/html/houdini_href_e.o +0 -0
  74. data/ext/snowcrash/build/out/Release/obj.target/libsundown/ext/markdown-parser/ext/sundown/html/houdini_html_e.o +0 -0
  75. data/ext/snowcrash/build/out/Release/obj.target/libsundown/ext/markdown-parser/ext/sundown/html/html.o +0 -0
  76. data/ext/snowcrash/build/out/Release/obj.target/libsundown/ext/markdown-parser/ext/sundown/html/html_smartypants.o +0 -0
  77. data/ext/snowcrash/build/out/Release/obj.target/libsundown/ext/markdown-parser/ext/sundown/src/autolink.o +0 -0
  78. data/ext/snowcrash/build/out/Release/obj.target/libsundown/ext/markdown-parser/ext/sundown/src/buffer.o +0 -0
  79. data/ext/snowcrash/build/out/Release/obj.target/libsundown/ext/markdown-parser/ext/sundown/src/markdown.o +0 -0
  80. data/ext/snowcrash/build/out/Release/obj.target/libsundown/ext/markdown-parser/ext/sundown/src/src_map.o +0 -0
  81. data/ext/snowcrash/build/out/Release/obj.target/libsundown/ext/markdown-parser/ext/sundown/src/stack.o +0 -0
  82. data/ext/snowcrash/build/out/Release/obj.target/snowcrash/src/snowcrash/snowcrash.o +0 -0
  83. data/ext/snowcrash/build/out/Release/obj.target/sundown/sundown/html/houdini_href_e.o +0 -0
  84. data/ext/snowcrash/build/out/Release/obj.target/sundown/sundown/html/houdini_html_e.o +0 -0
  85. data/ext/snowcrash/build/out/Release/obj.target/sundown/sundown/html/html.o +0 -0
  86. data/ext/snowcrash/build/out/Release/obj.target/sundown/sundown/html/html_smartypants.o +0 -0
  87. data/ext/snowcrash/build/out/Release/obj.target/sundown/sundown/src/autolink.o +0 -0
  88. data/ext/snowcrash/build/out/Release/obj.target/sundown/sundown/src/buffer.o +0 -0
  89. data/ext/snowcrash/build/out/Release/obj.target/sundown/sundown/src/markdown.o +0 -0
  90. data/ext/snowcrash/build/out/Release/obj.target/sundown/sundown/src/src_map.o +0 -0
  91. data/ext/snowcrash/build/out/Release/obj.target/sundown/sundown/src/stack.o +0 -0
  92. data/ext/snowcrash/build/out/Release/obj.target/test-libsnowcrash/test/test-ActionParser.o +0 -0
  93. data/ext/snowcrash/build/out/Release/obj.target/test-libsnowcrash/test/test-AssetParser.o +0 -0
  94. data/ext/snowcrash/build/out/Release/obj.target/test-libsnowcrash/test/test-Blueprint.o +0 -0
  95. data/ext/snowcrash/build/out/Release/obj.target/test-libsnowcrash/test/test-BlueprintParser.o +0 -0
  96. data/ext/snowcrash/build/out/Release/obj.target/test-libsnowcrash/test/test-HeaderParser.o +0 -0
  97. data/ext/snowcrash/build/out/Release/obj.target/test-libsnowcrash/test/test-HeadersParser.o +0 -0
  98. data/ext/snowcrash/build/out/Release/obj.target/test-libsnowcrash/test/test-Indentation.o +0 -0
  99. data/ext/snowcrash/build/out/Release/obj.target/test-libsnowcrash/test/test-ListUtility.o +0 -0
  100. data/ext/snowcrash/build/out/Release/obj.target/test-libsnowcrash/test/test-MarkdownBlock.o +0 -0
  101. data/ext/snowcrash/build/out/Release/obj.target/test-libsnowcrash/test/test-MarkdownParser.o +0 -0
  102. data/ext/snowcrash/build/out/Release/obj.target/test-libsnowcrash/test/test-ParameterDefinitonParser.o +0 -0
  103. data/ext/snowcrash/build/out/Release/obj.target/test-libsnowcrash/test/test-ParameterParser.o +0 -0
  104. data/ext/snowcrash/build/out/Release/obj.target/test-libsnowcrash/test/test-ParametersParser.o +0 -0
  105. data/ext/snowcrash/build/out/Release/obj.target/test-libsnowcrash/test/test-Parser.o +0 -0
  106. data/ext/snowcrash/build/out/Release/obj.target/test-libsnowcrash/test/test-PayloadParser.o +0 -0
  107. data/ext/snowcrash/build/out/Release/obj.target/test-libsnowcrash/test/test-RegexMatch.o +0 -0
  108. data/ext/snowcrash/build/out/Release/obj.target/test-libsnowcrash/test/test-ResouceGroupParser.o +0 -0
  109. data/ext/snowcrash/build/out/Release/obj.target/test-libsnowcrash/test/test-ResourceGroupParser.o +0 -0
  110. data/ext/snowcrash/build/out/Release/obj.target/test-libsnowcrash/test/test-ResourceParser.o +0 -0
  111. data/ext/snowcrash/build/out/Release/obj.target/test-libsnowcrash/test/test-SectionParser.o +0 -0
  112. data/ext/snowcrash/build/out/Release/obj.target/test-libsnowcrash/test/test-SymbolIdentifier.o +0 -0
  113. data/ext/snowcrash/build/out/Release/obj.target/test-libsnowcrash/test/test-SymbolTable.o +0 -0
  114. data/ext/snowcrash/build/out/Release/obj.target/test-libsnowcrash/test/test-UriTemplateParser.o +0 -0
  115. data/ext/snowcrash/build/out/Release/obj.target/test-libsnowcrash/test/test-ValuesParser.o +0 -0
  116. data/ext/snowcrash/build/out/Release/obj.target/test-libsnowcrash/test/test-Warnings.o +0 -0
  117. data/ext/snowcrash/build/out/Release/obj.target/test-libsnowcrash/test/test-csnowcrash.o +0 -0
  118. data/ext/snowcrash/build/out/Release/obj.target/test-libsnowcrash/test/test-snowcrash.o +0 -0
  119. data/ext/snowcrash/build/out/Release/snowcrash +0 -0
  120. data/ext/snowcrash/build/out/Release/test-libsnowcrash +0 -0
  121. data/ext/snowcrash/build/perf-libsnowcrash.target.mk +151 -0
  122. data/ext/snowcrash/build/snowcrash.Makefile +6 -0
  123. data/ext/snowcrash/build/snowcrash.target.mk +149 -0
  124. data/ext/snowcrash/build/sundown.target.mk +143 -0
  125. data/ext/snowcrash/build/test-libsnowcrash.target.mk +170 -0
  126. data/ext/snowcrash/ext/cmdline/LICENSE +30 -0
  127. data/ext/snowcrash/ext/cmdline/README.rst +191 -0
  128. data/ext/snowcrash/ext/cmdline/cmdline.h +817 -0
  129. data/ext/snowcrash/ext/cmdline/test.cpp +50 -0
  130. data/ext/snowcrash/ext/cmdline/test2.cpp +61 -0
  131. data/ext/snowcrash/ext/markdown-parser/LICENSE +22 -0
  132. data/ext/snowcrash/ext/markdown-parser/README.md +11 -0
  133. data/ext/snowcrash/ext/markdown-parser/ext/sundown/README.markdown +141 -0
  134. data/ext/snowcrash/ext/markdown-parser/markdownparser.xcodeproj/project.pbxproj +448 -0
  135. data/ext/snowcrash/ext/markdown-parser/msvc/test-markdown/test-markdown.vcproj +195 -0
  136. data/ext/snowcrash/ext/markdown-parser/test/ext/Catch/LICENSE_1_0.txt +23 -0
  137. data/ext/snowcrash/ext/markdown-parser/test/ext/Catch/README.md +24 -0
  138. data/ext/snowcrash/ext/markdown-parser/test/ext/Catch/catch-logo-small.png +0 -0
  139. data/ext/snowcrash/ext/markdown-parser/test/ext/Catch/docs/assertions.md +64 -0
  140. data/ext/snowcrash/ext/markdown-parser/test/ext/Catch/docs/build-systems.md +36 -0
  141. data/ext/snowcrash/ext/markdown-parser/test/ext/Catch/docs/command-line.md +155 -0
  142. data/ext/snowcrash/ext/markdown-parser/test/ext/Catch/docs/contributing.md +19 -0
  143. data/ext/snowcrash/ext/markdown-parser/test/ext/Catch/docs/logging.md +52 -0
  144. data/ext/snowcrash/ext/markdown-parser/test/ext/Catch/docs/own-main.md +68 -0
  145. data/ext/snowcrash/ext/markdown-parser/test/ext/Catch/docs/reference-index.md +14 -0
  146. data/ext/snowcrash/ext/markdown-parser/test/ext/Catch/docs/test-cases-and-sections.md +60 -0
  147. data/ext/snowcrash/ext/markdown-parser/test/ext/Catch/docs/test-fixtures.md +32 -0
  148. data/ext/snowcrash/ext/markdown-parser/test/ext/Catch/docs/tutorial.md +228 -0
  149. data/ext/snowcrash/ext/markdown-parser/test/ext/Catch/docs/whats-changed.md +24 -0
  150. data/ext/snowcrash/ext/markdown-parser/test/ext/Catch/docs/why-catch.md +42 -0
  151. data/ext/snowcrash/ext/markdown-parser/test/ext/Catch/include/catch.hpp +202 -0
  152. data/ext/snowcrash/ext/markdown-parser/test/ext/Catch/include/catch_runner.hpp +224 -0
  153. data/ext/snowcrash/ext/markdown-parser/test/ext/Catch/include/catch_with_main.hpp +15 -0
  154. data/ext/snowcrash/ext/markdown-parser/test/ext/Catch/include/external/clara.h +868 -0
  155. data/ext/snowcrash/ext/markdown-parser/test/ext/Catch/include/external/tbc_text_format.h +153 -0
  156. data/ext/snowcrash/ext/markdown-parser/test/ext/Catch/include/internal/catch_approx.hpp +91 -0
  157. data/ext/snowcrash/ext/markdown-parser/test/ext/Catch/include/internal/catch_assertionresult.h +71 -0
  158. data/ext/snowcrash/ext/markdown-parser/test/ext/Catch/include/internal/catch_assertionresult.hpp +91 -0
  159. data/ext/snowcrash/ext/markdown-parser/test/ext/Catch/include/internal/catch_capture.hpp +179 -0
  160. data/ext/snowcrash/ext/markdown-parser/test/ext/Catch/include/internal/catch_clara.h +32 -0
  161. data/ext/snowcrash/ext/markdown-parser/test/ext/Catch/include/internal/catch_commandline.hpp +145 -0
  162. data/ext/snowcrash/ext/markdown-parser/test/ext/Catch/include/internal/catch_common.h +119 -0
  163. data/ext/snowcrash/ext/markdown-parser/test/ext/Catch/include/internal/catch_common.hpp +86 -0
  164. data/ext/snowcrash/ext/markdown-parser/test/ext/Catch/include/internal/catch_compiler_capabilities.h +123 -0
  165. data/ext/snowcrash/ext/markdown-parser/test/ext/Catch/include/internal/catch_config.hpp +178 -0
  166. data/ext/snowcrash/ext/markdown-parser/test/ext/Catch/include/internal/catch_console_colour.hpp +66 -0
  167. data/ext/snowcrash/ext/markdown-parser/test/ext/Catch/include/internal/catch_console_colour_impl.hpp +166 -0
  168. data/ext/snowcrash/ext/markdown-parser/test/ext/Catch/include/internal/catch_context.h +53 -0
  169. data/ext/snowcrash/ext/markdown-parser/test/ext/Catch/include/internal/catch_context_impl.hpp +112 -0
  170. data/ext/snowcrash/ext/markdown-parser/test/ext/Catch/include/internal/catch_debugger.h +49 -0
  171. data/ext/snowcrash/ext/markdown-parser/test/ext/Catch/include/internal/catch_debugger.hpp +100 -0
  172. data/ext/snowcrash/ext/markdown-parser/test/ext/Catch/include/internal/catch_default_main.hpp +38 -0
  173. data/ext/snowcrash/ext/markdown-parser/test/ext/Catch/include/internal/catch_evaluate.hpp +178 -0
  174. data/ext/snowcrash/ext/markdown-parser/test/ext/Catch/include/internal/catch_exception_translator_registry.hpp +75 -0
  175. data/ext/snowcrash/ext/markdown-parser/test/ext/Catch/include/internal/catch_expression_decomposer.hpp +31 -0
  176. data/ext/snowcrash/ext/markdown-parser/test/ext/Catch/include/internal/catch_expression_lhs.hpp +105 -0
  177. data/ext/snowcrash/ext/markdown-parser/test/ext/Catch/include/internal/catch_expressionresult_builder.h +63 -0
  178. data/ext/snowcrash/ext/markdown-parser/test/ext/Catch/include/internal/catch_expressionresult_builder.hpp +98 -0
  179. data/ext/snowcrash/ext/markdown-parser/test/ext/Catch/include/internal/catch_generators.hpp +190 -0
  180. data/ext/snowcrash/ext/markdown-parser/test/ext/Catch/include/internal/catch_generators_impl.hpp +86 -0
  181. data/ext/snowcrash/ext/markdown-parser/test/ext/Catch/include/internal/catch_impl.hpp +92 -0
  182. data/ext/snowcrash/ext/markdown-parser/test/ext/Catch/include/internal/catch_interfaces_capture.h +46 -0
  183. data/ext/snowcrash/ext/markdown-parser/test/ext/Catch/include/internal/catch_interfaces_config.h +54 -0
  184. data/ext/snowcrash/ext/markdown-parser/test/ext/Catch/include/internal/catch_interfaces_exception.h +66 -0
  185. data/ext/snowcrash/ext/markdown-parser/test/ext/Catch/include/internal/catch_interfaces_generators.h +32 -0
  186. data/ext/snowcrash/ext/markdown-parser/test/ext/Catch/include/internal/catch_interfaces_registry_hub.h +44 -0
  187. data/ext/snowcrash/ext/markdown-parser/test/ext/Catch/include/internal/catch_interfaces_reporter.h +265 -0
  188. data/ext/snowcrash/ext/markdown-parser/test/ext/Catch/include/internal/catch_interfaces_runner.h +19 -0
  189. data/ext/snowcrash/ext/markdown-parser/test/ext/Catch/include/internal/catch_interfaces_testcase.h +37 -0
  190. data/ext/snowcrash/ext/markdown-parser/test/ext/Catch/include/internal/catch_legacy_reporter_adapter.h +59 -0
  191. data/ext/snowcrash/ext/markdown-parser/test/ext/Catch/include/internal/catch_legacy_reporter_adapter.hpp +82 -0
  192. data/ext/snowcrash/ext/markdown-parser/test/ext/Catch/include/internal/catch_list.hpp +150 -0
  193. data/ext/snowcrash/ext/markdown-parser/test/ext/Catch/include/internal/catch_matchers.hpp +233 -0
  194. data/ext/snowcrash/ext/markdown-parser/test/ext/Catch/include/internal/catch_message.h +65 -0
  195. data/ext/snowcrash/ext/markdown-parser/test/ext/Catch/include/internal/catch_message.hpp +43 -0
  196. data/ext/snowcrash/ext/markdown-parser/test/ext/Catch/include/internal/catch_notimplemented_exception.h +35 -0
  197. data/ext/snowcrash/ext/markdown-parser/test/ext/Catch/include/internal/catch_notimplemented_exception.hpp +30 -0
  198. data/ext/snowcrash/ext/markdown-parser/test/ext/Catch/include/internal/catch_objc.hpp +203 -0
  199. data/ext/snowcrash/ext/markdown-parser/test/ext/Catch/include/internal/catch_objc_arc.hpp +51 -0
  200. data/ext/snowcrash/ext/markdown-parser/test/ext/Catch/include/internal/catch_option.hpp +75 -0
  201. data/ext/snowcrash/ext/markdown-parser/test/ext/Catch/include/internal/catch_platform.h +20 -0
  202. data/ext/snowcrash/ext/markdown-parser/test/ext/Catch/include/internal/catch_ptr.hpp +94 -0
  203. data/ext/snowcrash/ext/markdown-parser/test/ext/Catch/include/internal/catch_registry_hub.hpp +83 -0
  204. data/ext/snowcrash/ext/markdown-parser/test/ext/Catch/include/internal/catch_reporter_registrars.hpp +74 -0
  205. data/ext/snowcrash/ext/markdown-parser/test/ext/Catch/include/internal/catch_reporter_registry.hpp +45 -0
  206. data/ext/snowcrash/ext/markdown-parser/test/ext/Catch/include/internal/catch_result_type.h +66 -0
  207. data/ext/snowcrash/ext/markdown-parser/test/ext/Catch/include/internal/catch_runner_impl.hpp +319 -0
  208. data/ext/snowcrash/ext/markdown-parser/test/ext/Catch/include/internal/catch_section.h +55 -0
  209. data/ext/snowcrash/ext/markdown-parser/test/ext/Catch/include/internal/catch_section.hpp +40 -0
  210. data/ext/snowcrash/ext/markdown-parser/test/ext/Catch/include/internal/catch_section_info.h +31 -0
  211. data/ext/snowcrash/ext/markdown-parser/test/ext/Catch/include/internal/catch_section_info.hpp +113 -0
  212. data/ext/snowcrash/ext/markdown-parser/test/ext/Catch/include/internal/catch_sfinae.hpp +44 -0
  213. data/ext/snowcrash/ext/markdown-parser/test/ext/Catch/include/internal/catch_stream.h +33 -0
  214. data/ext/snowcrash/ext/markdown-parser/test/ext/Catch/include/internal/catch_stream.hpp +83 -0
  215. data/ext/snowcrash/ext/markdown-parser/test/ext/Catch/include/internal/catch_streambuf.h +23 -0
  216. data/ext/snowcrash/ext/markdown-parser/test/ext/Catch/include/internal/catch_tags.h +109 -0
  217. data/ext/snowcrash/ext/markdown-parser/test/ext/Catch/include/internal/catch_tags.hpp +137 -0
  218. data/ext/snowcrash/ext/markdown-parser/test/ext/Catch/include/internal/catch_test_case_info.h +84 -0
  219. data/ext/snowcrash/ext/markdown-parser/test/ext/Catch/include/internal/catch_test_case_info.hpp +166 -0
  220. data/ext/snowcrash/ext/markdown-parser/test/ext/Catch/include/internal/catch_test_case_registry_impl.hpp +146 -0
  221. data/ext/snowcrash/ext/markdown-parser/test/ext/Catch/include/internal/catch_test_case_tracker.hpp +148 -0
  222. data/ext/snowcrash/ext/markdown-parser/test/ext/Catch/include/internal/catch_test_registry.hpp +120 -0
  223. data/ext/snowcrash/ext/markdown-parser/test/ext/Catch/include/internal/catch_test_spec.h +65 -0
  224. data/ext/snowcrash/ext/markdown-parser/test/ext/Catch/include/internal/catch_test_spec.hpp +133 -0
  225. data/ext/snowcrash/ext/markdown-parser/test/ext/Catch/include/internal/catch_text.h +24 -0
  226. data/ext/snowcrash/ext/markdown-parser/test/ext/Catch/include/internal/catch_timer.h +35 -0
  227. data/ext/snowcrash/ext/markdown-parser/test/ext/Catch/include/internal/catch_timer.hpp +63 -0
  228. data/ext/snowcrash/ext/markdown-parser/test/ext/Catch/include/internal/catch_tostring.hpp +276 -0
  229. data/ext/snowcrash/ext/markdown-parser/test/ext/Catch/include/internal/catch_totals.hpp +67 -0
  230. data/ext/snowcrash/ext/markdown-parser/test/ext/Catch/include/internal/catch_version.h +37 -0
  231. data/ext/snowcrash/ext/markdown-parser/test/ext/Catch/include/internal/catch_version.hpp +19 -0
  232. data/ext/snowcrash/ext/markdown-parser/test/ext/Catch/include/internal/catch_xmlwriter.hpp +218 -0
  233. data/ext/snowcrash/ext/markdown-parser/test/ext/Catch/include/reporters/catch_reporter_bases.hpp +203 -0
  234. data/ext/snowcrash/ext/markdown-parser/test/ext/Catch/include/reporters/catch_reporter_console.hpp +411 -0
  235. data/ext/snowcrash/ext/markdown-parser/test/ext/Catch/include/reporters/catch_reporter_junit.hpp +226 -0
  236. data/ext/snowcrash/ext/markdown-parser/test/ext/Catch/include/reporters/catch_reporter_xml.hpp +151 -0
  237. data/ext/snowcrash/ext/markdown-parser/test/ext/Catch/projects/CMake/CMakeLists.txt +38 -0
  238. data/ext/snowcrash/ext/markdown-parser/test/ext/Catch/projects/SelfTest/ApproxTests.cpp +112 -0
  239. data/ext/snowcrash/ext/markdown-parser/test/ext/Catch/projects/SelfTest/BDDTests.cpp +68 -0
  240. data/ext/snowcrash/ext/markdown-parser/test/ext/Catch/projects/SelfTest/Baselines/console.std.approved.txt +778 -0
  241. data/ext/snowcrash/ext/markdown-parser/test/ext/Catch/projects/SelfTest/Baselines/console.sw.approved.txt +6995 -0
  242. data/ext/snowcrash/ext/markdown-parser/test/ext/Catch/projects/SelfTest/Baselines/console.swa4.approved.txt +322 -0
  243. data/ext/snowcrash/ext/markdown-parser/test/ext/Catch/projects/SelfTest/Baselines/junit.sw.approved.txt +562 -0
  244. data/ext/snowcrash/ext/markdown-parser/test/ext/Catch/projects/SelfTest/Baselines/xml.sw.approved.txt +7251 -0
  245. data/ext/snowcrash/ext/markdown-parser/test/ext/Catch/projects/SelfTest/ClassTests.cpp +57 -0
  246. data/ext/snowcrash/ext/markdown-parser/test/ext/Catch/projects/SelfTest/ConditionTests.cpp +334 -0
  247. data/ext/snowcrash/ext/markdown-parser/test/ext/Catch/projects/SelfTest/ExceptionTests.cpp +153 -0
  248. data/ext/snowcrash/ext/markdown-parser/test/ext/Catch/projects/SelfTest/GeneratorTests.cpp +42 -0
  249. data/ext/snowcrash/ext/markdown-parser/test/ext/Catch/projects/SelfTest/MessageTests.cpp +121 -0
  250. data/ext/snowcrash/ext/markdown-parser/test/ext/Catch/projects/SelfTest/MiscTests.cpp +341 -0
  251. data/ext/snowcrash/ext/markdown-parser/test/ext/Catch/projects/SelfTest/SectionTrackerTests.cpp +164 -0
  252. data/ext/snowcrash/ext/markdown-parser/test/ext/Catch/projects/SelfTest/SurrogateCpps/catch_common.cpp +2 -0
  253. data/ext/snowcrash/ext/markdown-parser/test/ext/Catch/projects/SelfTest/SurrogateCpps/catch_console_colour.cpp +2 -0
  254. data/ext/snowcrash/ext/markdown-parser/test/ext/Catch/projects/SelfTest/SurrogateCpps/catch_debugger.cpp +2 -0
  255. data/ext/snowcrash/ext/markdown-parser/test/ext/Catch/projects/SelfTest/SurrogateCpps/catch_interfaces_capture.cpp +2 -0
  256. data/ext/snowcrash/ext/markdown-parser/test/ext/Catch/projects/SelfTest/SurrogateCpps/catch_interfaces_config.cpp +1 -0
  257. data/ext/snowcrash/ext/markdown-parser/test/ext/Catch/projects/SelfTest/SurrogateCpps/catch_interfaces_exception.cpp +1 -0
  258. data/ext/snowcrash/ext/markdown-parser/test/ext/Catch/projects/SelfTest/SurrogateCpps/catch_interfaces_generators.cpp +1 -0
  259. data/ext/snowcrash/ext/markdown-parser/test/ext/Catch/projects/SelfTest/SurrogateCpps/catch_interfaces_registry_hub.cpp +2 -0
  260. data/ext/snowcrash/ext/markdown-parser/test/ext/Catch/projects/SelfTest/SurrogateCpps/catch_interfaces_reporter.cpp +1 -0
  261. data/ext/snowcrash/ext/markdown-parser/test/ext/Catch/projects/SelfTest/SurrogateCpps/catch_interfaces_runner.cpp +1 -0
  262. data/ext/snowcrash/ext/markdown-parser/test/ext/Catch/projects/SelfTest/SurrogateCpps/catch_interfaces_testcase.cpp +1 -0
  263. data/ext/snowcrash/ext/markdown-parser/test/ext/Catch/projects/SelfTest/SurrogateCpps/catch_message.cpp +2 -0
  264. data/ext/snowcrash/ext/markdown-parser/test/ext/Catch/projects/SelfTest/SurrogateCpps/catch_option.cpp +2 -0
  265. data/ext/snowcrash/ext/markdown-parser/test/ext/Catch/projects/SelfTest/SurrogateCpps/catch_ptr.cpp +2 -0
  266. data/ext/snowcrash/ext/markdown-parser/test/ext/Catch/projects/SelfTest/SurrogateCpps/catch_stream.cpp +2 -0
  267. data/ext/snowcrash/ext/markdown-parser/test/ext/Catch/projects/SelfTest/SurrogateCpps/catch_streambuf.cpp +2 -0
  268. data/ext/snowcrash/ext/markdown-parser/test/ext/Catch/projects/SelfTest/SurrogateCpps/catch_tags.cpp +2 -0
  269. data/ext/snowcrash/ext/markdown-parser/test/ext/Catch/projects/SelfTest/SurrogateCpps/catch_xmlwriter.cpp +2 -0
  270. data/ext/snowcrash/ext/markdown-parser/test/ext/Catch/projects/SelfTest/TestMain.cpp +541 -0
  271. data/ext/snowcrash/ext/markdown-parser/test/ext/Catch/projects/SelfTest/TrickyTests.cpp +396 -0
  272. data/ext/snowcrash/ext/markdown-parser/test/ext/Catch/projects/SelfTest/VariadicMacrosTests.cpp +31 -0
  273. data/ext/snowcrash/ext/markdown-parser/test/ext/Catch/projects/SelfTest/makefile +21 -0
  274. data/ext/snowcrash/ext/markdown-parser/test/ext/Catch/projects/VS2008/TestCatch/TestCatch.sln +20 -0
  275. data/ext/snowcrash/ext/markdown-parser/test/ext/Catch/projects/VS2008/TestCatch/TestCatch/TestCatch.cpp +8 -0
  276. data/ext/snowcrash/ext/markdown-parser/test/ext/Catch/projects/VS2008/TestCatch/TestCatch/TestCatch.vcproj +394 -0
  277. data/ext/snowcrash/ext/markdown-parser/test/ext/Catch/projects/VS2010/TestCatch/TestCatch.sln +20 -0
  278. data/ext/snowcrash/ext/markdown-parser/test/ext/Catch/projects/VS2010/TestCatch/TestCatch/TestCatch.vcxproj +148 -0
  279. data/ext/snowcrash/ext/markdown-parser/test/ext/Catch/projects/XCode/CatchSelfTest/CatchSelfTest.xcodeproj/project.pbxproj +685 -0
  280. data/ext/snowcrash/ext/markdown-parser/test/ext/Catch/projects/XCode/CatchSelfTest/CatchSelfTest.xcodeproj/project.xcworkspace/contents.xcworkspacedata +7 -0
  281. data/ext/snowcrash/ext/markdown-parser/test/ext/Catch/projects/XCode/CatchSelfTest/CatchSelfTest.xcodeproj/project.xcworkspace/xcshareddata/CatchSelfTest.xccheckout +41 -0
  282. data/ext/snowcrash/ext/markdown-parser/test/ext/Catch/projects/XCode/CatchSelfTest/CatchSelfTest/CatchSelfTest.1 +79 -0
  283. data/ext/snowcrash/ext/markdown-parser/test/ext/Catch/projects/XCode/CatchSelfTest/CatchSelfTest/catch_text.cpp +2 -0
  284. data/ext/snowcrash/ext/markdown-parser/test/ext/Catch/projects/XCode/CatchSelfTest/CatchSelfTestSingle.xcodeproj/project.pbxproj +258 -0
  285. data/ext/snowcrash/ext/markdown-parser/test/ext/Catch/projects/XCode/CatchSelfTest/CatchSelfTestSingle.xcodeproj/project.xcworkspace/contents.xcworkspacedata +7 -0
  286. data/ext/snowcrash/ext/markdown-parser/test/ext/Catch/projects/XCode/CatchSelfTest/CatchSelfTestSingle.xcodeproj/project.xcworkspace/xcshareddata/CatchSelfTestSingle.xccheckout +41 -0
  287. data/ext/snowcrash/ext/markdown-parser/test/ext/Catch/projects/XCode/CatchSelfTest/CatchSelfTestSingle/dummy.txt +0 -0
  288. data/ext/snowcrash/ext/markdown-parser/test/ext/Catch/projects/XCode/OCTest/OCTest.xcodeproj/project.pbxproj +265 -0
  289. data/ext/snowcrash/ext/markdown-parser/test/ext/Catch/projects/XCode/OCTest/OCTest.xcodeproj/project.xcworkspace/contents.xcworkspacedata +7 -0
  290. data/ext/snowcrash/ext/markdown-parser/test/ext/Catch/projects/XCode/OCTest/OCTest.xcodeproj/project.xcworkspace/xcshareddata/OCTest.xccheckout +41 -0
  291. data/ext/snowcrash/ext/markdown-parser/test/ext/Catch/projects/XCode/OCTest/OCTest/CatchOCTestCase.h +25 -0
  292. data/ext/snowcrash/ext/markdown-parser/test/ext/Catch/projects/XCode/OCTest/OCTest/CatchOCTestCase.mm +83 -0
  293. data/ext/snowcrash/ext/markdown-parser/test/ext/Catch/projects/XCode/OCTest/OCTest/Main.mm +2 -0
  294. data/ext/snowcrash/ext/markdown-parser/test/ext/Catch/projects/XCode/OCTest/OCTest/OCTest.1 +79 -0
  295. data/ext/snowcrash/ext/markdown-parser/test/ext/Catch/projects/XCode/OCTest/OCTest/OCTest.mm +28 -0
  296. data/ext/snowcrash/ext/markdown-parser/test/ext/Catch/projects/XCode/OCTest/OCTest/TestObj.h +28 -0
  297. data/ext/snowcrash/ext/markdown-parser/test/ext/Catch/projects/XCode/OCTest/OCTest/TestObj.m +25 -0
  298. data/ext/snowcrash/ext/markdown-parser/test/ext/Catch/projects/XCode/iOSTest/iOSTest.xcodeproj/project.pbxproj +299 -0
  299. data/ext/snowcrash/ext/markdown-parser/test/ext/Catch/projects/XCode/iOSTest/iOSTest.xcodeproj/project.xcworkspace/contents.xcworkspacedata +7 -0
  300. data/ext/snowcrash/ext/markdown-parser/test/ext/Catch/projects/XCode/iOSTest/iOSTest/OCTest.mm +27 -0
  301. data/ext/snowcrash/ext/markdown-parser/test/ext/Catch/projects/XCode/iOSTest/iOSTest/TestObj.h +25 -0
  302. data/ext/snowcrash/ext/markdown-parser/test/ext/Catch/projects/XCode/iOSTest/iOSTest/TestObj.m +18 -0
  303. data/ext/snowcrash/ext/markdown-parser/test/ext/Catch/projects/XCode/iOSTest/iOSTest/en.lproj/InfoPlist.strings +2 -0
  304. data/ext/snowcrash/ext/markdown-parser/test/ext/Catch/projects/XCode/iOSTest/iOSTest/iOSTest-Info.plist +47 -0
  305. data/ext/snowcrash/ext/markdown-parser/test/ext/Catch/projects/XCode/iOSTest/iOSTest/iOSTest-Prefix.pch +14 -0
  306. data/ext/snowcrash/ext/markdown-parser/test/ext/Catch/projects/runners/iTchRunner/internal/iTchRunnerAppDelegate.h +114 -0
  307. data/ext/snowcrash/ext/markdown-parser/test/ext/Catch/projects/runners/iTchRunner/internal/iTchRunnerMainView.h +189 -0
  308. data/ext/snowcrash/ext/markdown-parser/test/ext/Catch/projects/runners/iTchRunner/internal/iTchRunnerReporter.h +115 -0
  309. data/ext/snowcrash/ext/markdown-parser/test/ext/Catch/projects/runners/iTchRunner/itChRunnerMain.mm +27 -0
  310. data/ext/snowcrash/ext/markdown-parser/test/ext/Catch/projects/runners/iTchRunner/readme +6 -0
  311. data/ext/snowcrash/ext/markdown-parser/test/ext/Catch/scripts/approvalTests.py +99 -0
  312. data/ext/snowcrash/ext/markdown-parser/test/ext/Catch/scripts/approve.py +29 -0
  313. data/ext/snowcrash/ext/markdown-parser/test/ext/Catch/scripts/generateSingleHeader.py +152 -0
  314. data/ext/snowcrash/ext/markdown-parser/test/ext/Catch/scripts/scriptCommon.py +4 -0
  315. data/ext/snowcrash/ext/markdown-parser/test/ext/Catch/single_include/catch.hpp +8544 -0
  316. data/ext/snowcrash/ext/markdown-parser/test/test-ByteBuffer.cc +83 -0
  317. data/ext/snowcrash/ext/markdown-parser/test/test-MarkdownParser.cc +628 -0
  318. data/ext/snowcrash/ext/markdown-parser/test/test-libmarkdownparser.cc +10 -0
  319. data/ext/snowcrash/features/fixtures/ast.json +154 -0
  320. data/ext/snowcrash/features/fixtures/ast.yaml +87 -0
  321. data/ext/snowcrash/features/fixtures/blueprint.apib +84 -0
  322. data/ext/snowcrash/features/fixtures/invalid_blueprint.apib +4 -0
  323. data/ext/snowcrash/features/parse.feature +23 -0
  324. data/ext/snowcrash/features/step_definitions/file_content_step.rb +8 -0
  325. data/ext/snowcrash/features/support/env.rb +7 -0
  326. data/ext/snowcrash/features/support/setup.rb +1 -0
  327. data/ext/snowcrash/features/validate.feature +37 -0
  328. data/ext/snowcrash/features/version.feature +10 -0
  329. data/ext/snowcrash/snowcrash.xcodeproj/project.pbxproj +798 -0
  330. data/ext/snowcrash/test/README.md +7 -0
  331. data/ext/snowcrash/test/performance/fixtures/fixture-1.apib +174 -0
  332. data/ext/snowcrash/test/performance/fixtures/fixture-2.apib +2455 -0
  333. data/ext/snowcrash/test/performance/fixtures/fixture-3.apib +10363 -0
  334. data/ext/snowcrash/test/performance/fixtures/fixture-4.apib +8390 -0
  335. data/ext/snowcrash/test/performance/perf-snowcrash.cc +162 -0
  336. data/ext/snowcrash/test/snowcrashtest.h +88 -0
  337. data/ext/snowcrash/test/test-ActionParser.cc +491 -0
  338. data/ext/snowcrash/test/test-AssetParser.cc +224 -0
  339. data/ext/snowcrash/test/test-Blueprint.cc +32 -0
  340. data/ext/snowcrash/test/test-BlueprintParser.cc +462 -0
  341. data/ext/snowcrash/test/test-HeadersParser.cc +256 -0
  342. data/ext/snowcrash/test/test-Indentation.cc +336 -0
  343. data/ext/snowcrash/test/test-ParameterParser.cc +499 -0
  344. data/ext/snowcrash/test/test-ParametersParser.cc +355 -0
  345. data/ext/snowcrash/test/test-PayloadParser.cc +657 -0
  346. data/ext/snowcrash/test/test-RegexMatch.cc +35 -0
  347. data/ext/snowcrash/test/test-ResourceGroupParser.cc +457 -0
  348. data/ext/snowcrash/test/test-ResourceParser.cc +947 -0
  349. data/ext/snowcrash/test/test-SectionParser.cc +81 -0
  350. data/ext/snowcrash/test/test-StringUtility.cc +65 -0
  351. data/ext/snowcrash/test/test-SymbolIdentifier.cc +53 -0
  352. data/ext/snowcrash/test/test-SymbolTable.cc +31 -0
  353. data/ext/snowcrash/test/test-UriTemplateParser.cc +333 -0
  354. data/ext/snowcrash/test/test-ValuesParser.cc +106 -0
  355. data/ext/snowcrash/test/test-Warnings.cc +94 -0
  356. data/ext/snowcrash/test/test-csnowcrash.cc +404 -0
  357. data/ext/snowcrash/test/test-snowcrash.cc +664 -0
  358. data/ext/snowcrash/test/vendor/Catch/LICENSE_1_0.txt +23 -0
  359. data/ext/snowcrash/test/vendor/Catch/README.md +24 -0
  360. data/ext/snowcrash/test/vendor/Catch/catch-logo-small.png +0 -0
  361. data/ext/snowcrash/test/vendor/Catch/docs/assertions.md +59 -0
  362. data/ext/snowcrash/test/vendor/Catch/docs/command-line.md +137 -0
  363. data/ext/snowcrash/test/vendor/Catch/docs/logging.md +52 -0
  364. data/ext/snowcrash/test/vendor/Catch/docs/own-main.md +68 -0
  365. data/ext/snowcrash/test/vendor/Catch/docs/reference-index.md +13 -0
  366. data/ext/snowcrash/test/vendor/Catch/docs/test-fixtures.md +32 -0
  367. data/ext/snowcrash/test/vendor/Catch/docs/tutorial.md +100 -0
  368. data/ext/snowcrash/test/vendor/Catch/docs/whats-changed.md +24 -0
  369. data/ext/snowcrash/test/vendor/Catch/docs/why-catch.md +42 -0
  370. data/ext/snowcrash/test/vendor/Catch/include/catch.hpp +182 -0
  371. data/ext/snowcrash/test/vendor/Catch/include/catch_runner.hpp +236 -0
  372. data/ext/snowcrash/test/vendor/Catch/include/catch_with_main.hpp +15 -0
  373. data/ext/snowcrash/test/vendor/Catch/include/internal/catch_approx.hpp +91 -0
  374. data/ext/snowcrash/test/vendor/Catch/include/internal/catch_assertionresult.h +65 -0
  375. data/ext/snowcrash/test/vendor/Catch/include/internal/catch_assertionresult.hpp +91 -0
  376. data/ext/snowcrash/test/vendor/Catch/include/internal/catch_capture.hpp +175 -0
  377. data/ext/snowcrash/test/vendor/Catch/include/internal/catch_commandline.hpp +129 -0
  378. data/ext/snowcrash/test/vendor/Catch/include/internal/catch_common.h +148 -0
  379. data/ext/snowcrash/test/vendor/Catch/include/internal/catch_compiler_capabilities.h +85 -0
  380. data/ext/snowcrash/test/vendor/Catch/include/internal/catch_config.hpp +182 -0
  381. data/ext/snowcrash/test/vendor/Catch/include/internal/catch_console_colour.hpp +66 -0
  382. data/ext/snowcrash/test/vendor/Catch/include/internal/catch_console_colour_impl.hpp +153 -0
  383. data/ext/snowcrash/test/vendor/Catch/include/internal/catch_context.h +53 -0
  384. data/ext/snowcrash/test/vendor/Catch/include/internal/catch_context_impl.hpp +112 -0
  385. data/ext/snowcrash/test/vendor/Catch/include/internal/catch_debugger.hpp +116 -0
  386. data/ext/snowcrash/test/vendor/Catch/include/internal/catch_default_main.hpp +38 -0
  387. data/ext/snowcrash/test/vendor/Catch/include/internal/catch_evaluate.hpp +178 -0
  388. data/ext/snowcrash/test/vendor/Catch/include/internal/catch_exception_translator_registry.hpp +74 -0
  389. data/ext/snowcrash/test/vendor/Catch/include/internal/catch_expression_decomposer.hpp +31 -0
  390. data/ext/snowcrash/test/vendor/Catch/include/internal/catch_expression_lhs.hpp +97 -0
  391. data/ext/snowcrash/test/vendor/Catch/include/internal/catch_expressionresult_builder.h +63 -0
  392. data/ext/snowcrash/test/vendor/Catch/include/internal/catch_expressionresult_builder.hpp +98 -0
  393. data/ext/snowcrash/test/vendor/Catch/include/internal/catch_generators.hpp +190 -0
  394. data/ext/snowcrash/test/vendor/Catch/include/internal/catch_generators_impl.hpp +86 -0
  395. data/ext/snowcrash/test/vendor/Catch/include/internal/catch_impl.hpp +97 -0
  396. data/ext/snowcrash/test/vendor/Catch/include/internal/catch_interfaces_capture.h +46 -0
  397. data/ext/snowcrash/test/vendor/Catch/include/internal/catch_interfaces_config.h +32 -0
  398. data/ext/snowcrash/test/vendor/Catch/include/internal/catch_interfaces_exception.h +66 -0
  399. data/ext/snowcrash/test/vendor/Catch/include/internal/catch_interfaces_generators.h +32 -0
  400. data/ext/snowcrash/test/vendor/Catch/include/internal/catch_interfaces_registry_hub.h +45 -0
  401. data/ext/snowcrash/test/vendor/Catch/include/internal/catch_interfaces_reporter.h +339 -0
  402. data/ext/snowcrash/test/vendor/Catch/include/internal/catch_interfaces_runner.h +23 -0
  403. data/ext/snowcrash/test/vendor/Catch/include/internal/catch_interfaces_testcase.h +34 -0
  404. data/ext/snowcrash/test/vendor/Catch/include/internal/catch_legacy_reporter_adapter.h +39 -0
  405. data/ext/snowcrash/test/vendor/Catch/include/internal/catch_legacy_reporter_adapter.hpp +84 -0
  406. data/ext/snowcrash/test/vendor/Catch/include/internal/catch_list.hpp +198 -0
  407. data/ext/snowcrash/test/vendor/Catch/include/internal/catch_matchers.hpp +233 -0
  408. data/ext/snowcrash/test/vendor/Catch/include/internal/catch_message.h +65 -0
  409. data/ext/snowcrash/test/vendor/Catch/include/internal/catch_message.hpp +43 -0
  410. data/ext/snowcrash/test/vendor/Catch/include/internal/catch_notimplemented_exception.h +35 -0
  411. data/ext/snowcrash/test/vendor/Catch/include/internal/catch_notimplemented_exception.hpp +30 -0
  412. data/ext/snowcrash/test/vendor/Catch/include/internal/catch_objc.hpp +202 -0
  413. data/ext/snowcrash/test/vendor/Catch/include/internal/catch_objc_arc.hpp +51 -0
  414. data/ext/snowcrash/test/vendor/Catch/include/internal/catch_option.hpp +67 -0
  415. data/ext/snowcrash/test/vendor/Catch/include/internal/catch_ptr.hpp +94 -0
  416. data/ext/snowcrash/test/vendor/Catch/include/internal/catch_registry_hub.hpp +83 -0
  417. data/ext/snowcrash/test/vendor/Catch/include/internal/catch_reporter_registrars.hpp +75 -0
  418. data/ext/snowcrash/test/vendor/Catch/include/internal/catch_reporter_registry.hpp +45 -0
  419. data/ext/snowcrash/test/vendor/Catch/include/internal/catch_result_type.h +66 -0
  420. data/ext/snowcrash/test/vendor/Catch/include/internal/catch_runner_impl.hpp +326 -0
  421. data/ext/snowcrash/test/vendor/Catch/include/internal/catch_running_test.hpp +117 -0
  422. data/ext/snowcrash/test/vendor/Catch/include/internal/catch_section.hpp +56 -0
  423. data/ext/snowcrash/test/vendor/Catch/include/internal/catch_section_info.hpp +113 -0
  424. data/ext/snowcrash/test/vendor/Catch/include/internal/catch_sfinae.hpp +44 -0
  425. data/ext/snowcrash/test/vendor/Catch/include/internal/catch_stream.hpp +90 -0
  426. data/ext/snowcrash/test/vendor/Catch/include/internal/catch_streambuf.h +21 -0
  427. data/ext/snowcrash/test/vendor/Catch/include/internal/catch_tags.hpp +193 -0
  428. data/ext/snowcrash/test/vendor/Catch/include/internal/catch_test_case_info.h +82 -0
  429. data/ext/snowcrash/test/vendor/Catch/include/internal/catch_test_case_info.hpp +127 -0
  430. data/ext/snowcrash/test/vendor/Catch/include/internal/catch_test_case_registry_impl.hpp +151 -0
  431. data/ext/snowcrash/test/vendor/Catch/include/internal/catch_test_registry.hpp +120 -0
  432. data/ext/snowcrash/test/vendor/Catch/include/internal/catch_test_spec.h +166 -0
  433. data/ext/snowcrash/test/vendor/Catch/include/internal/catch_text.h +61 -0
  434. data/ext/snowcrash/test/vendor/Catch/include/internal/catch_text.hpp +92 -0
  435. data/ext/snowcrash/test/vendor/Catch/include/internal/catch_tostring.hpp +224 -0
  436. data/ext/snowcrash/test/vendor/Catch/include/internal/catch_totals.hpp +67 -0
  437. data/ext/snowcrash/test/vendor/Catch/include/internal/catch_version.h +37 -0
  438. data/ext/snowcrash/test/vendor/Catch/include/internal/catch_version.hpp +19 -0
  439. data/ext/snowcrash/test/vendor/Catch/include/internal/catch_xmlwriter.hpp +211 -0
  440. data/ext/snowcrash/test/vendor/Catch/include/internal/clara.h +553 -0
  441. data/ext/snowcrash/test/vendor/Catch/include/reporters/catch_reporter_basic.hpp +353 -0
  442. data/ext/snowcrash/test/vendor/Catch/include/reporters/catch_reporter_console.hpp +397 -0
  443. data/ext/snowcrash/test/vendor/Catch/include/reporters/catch_reporter_junit.hpp +252 -0
  444. data/ext/snowcrash/test/vendor/Catch/include/reporters/catch_reporter_xml.hpp +145 -0
  445. data/ext/snowcrash/test/vendor/Catch/projects/SelfTest/ApproxTests.cpp +112 -0
  446. data/ext/snowcrash/test/vendor/Catch/projects/SelfTest/BDDTests.cpp +68 -0
  447. data/ext/snowcrash/test/vendor/Catch/projects/SelfTest/Baselines/approvedResults.txt +14686 -0
  448. data/ext/snowcrash/test/vendor/Catch/projects/SelfTest/ClassTests.cpp +57 -0
  449. data/ext/snowcrash/test/vendor/Catch/projects/SelfTest/CmdLineTests.cpp +191 -0
  450. data/ext/snowcrash/test/vendor/Catch/projects/SelfTest/ConditionTests.cpp +348 -0
  451. data/ext/snowcrash/test/vendor/Catch/projects/SelfTest/ExceptionTests.cpp +143 -0
  452. data/ext/snowcrash/test/vendor/Catch/projects/SelfTest/GeneratorTests.cpp +42 -0
  453. data/ext/snowcrash/test/vendor/Catch/projects/SelfTest/MessageTests.cpp +102 -0
  454. data/ext/snowcrash/test/vendor/Catch/projects/SelfTest/MiscTests.cpp +343 -0
  455. data/ext/snowcrash/test/vendor/Catch/projects/SelfTest/SurrogateCpps/catch_common.cpp +2 -0
  456. data/ext/snowcrash/test/vendor/Catch/projects/SelfTest/SurrogateCpps/catch_console_colour.cpp +2 -0
  457. data/ext/snowcrash/test/vendor/Catch/projects/SelfTest/SurrogateCpps/catch_debugger.cpp +2 -0
  458. data/ext/snowcrash/test/vendor/Catch/projects/SelfTest/SurrogateCpps/catch_interfaces_capture.cpp +2 -0
  459. data/ext/snowcrash/test/vendor/Catch/projects/SelfTest/SurrogateCpps/catch_interfaces_config.cpp +1 -0
  460. data/ext/snowcrash/test/vendor/Catch/projects/SelfTest/SurrogateCpps/catch_interfaces_exception.cpp +1 -0
  461. data/ext/snowcrash/test/vendor/Catch/projects/SelfTest/SurrogateCpps/catch_interfaces_generators.cpp +1 -0
  462. data/ext/snowcrash/test/vendor/Catch/projects/SelfTest/SurrogateCpps/catch_interfaces_registry_hub.cpp +2 -0
  463. data/ext/snowcrash/test/vendor/Catch/projects/SelfTest/SurrogateCpps/catch_interfaces_reporter.cpp +1 -0
  464. data/ext/snowcrash/test/vendor/Catch/projects/SelfTest/SurrogateCpps/catch_interfaces_runner.cpp +1 -0
  465. data/ext/snowcrash/test/vendor/Catch/projects/SelfTest/SurrogateCpps/catch_interfaces_testcase.cpp +1 -0
  466. data/ext/snowcrash/test/vendor/Catch/projects/SelfTest/SurrogateCpps/catch_message.cpp +2 -0
  467. data/ext/snowcrash/test/vendor/Catch/projects/SelfTest/SurrogateCpps/catch_option.cpp +2 -0
  468. data/ext/snowcrash/test/vendor/Catch/projects/SelfTest/SurrogateCpps/catch_ptr.cpp +2 -0
  469. data/ext/snowcrash/test/vendor/Catch/projects/SelfTest/SurrogateCpps/catch_stream.cpp +2 -0
  470. data/ext/snowcrash/test/vendor/Catch/projects/SelfTest/SurrogateCpps/catch_streambuf.cpp +2 -0
  471. data/ext/snowcrash/test/vendor/Catch/projects/SelfTest/SurrogateCpps/catch_tags.cpp +2 -0
  472. data/ext/snowcrash/test/vendor/Catch/projects/SelfTest/SurrogateCpps/catch_xmlwriter.cpp +2 -0
  473. data/ext/snowcrash/test/vendor/Catch/projects/SelfTest/TestMain.cpp +561 -0
  474. data/ext/snowcrash/test/vendor/Catch/projects/SelfTest/TrickyTests.cpp +382 -0
  475. data/ext/snowcrash/test/vendor/Catch/projects/SelfTest/VariadicMacrosTests.cpp +31 -0
  476. data/ext/snowcrash/test/vendor/Catch/projects/SelfTest/catch_self_test.cpp +31 -0
  477. data/ext/snowcrash/test/vendor/Catch/projects/SelfTest/catch_self_test.hpp +177 -0
  478. data/ext/snowcrash/test/vendor/Catch/projects/VS2008/TestCatch/TestCatch.sln +20 -0
  479. data/ext/snowcrash/test/vendor/Catch/projects/VS2008/TestCatch/TestCatch/ReadMe.txt +33 -0
  480. data/ext/snowcrash/test/vendor/Catch/projects/VS2008/TestCatch/TestCatch/TestCatch.cpp +8 -0
  481. data/ext/snowcrash/test/vendor/Catch/projects/VS2008/TestCatch/TestCatch/TestCatch.vcproj +398 -0
  482. data/ext/snowcrash/test/vendor/Catch/projects/VS2008/TestCatch/UpgradeLog.XML +12 -0
  483. data/ext/snowcrash/test/vendor/Catch/projects/VS2008/TestCatch/_UpgradeReport_Files/UpgradeReport.css +207 -0
  484. data/ext/snowcrash/test/vendor/Catch/projects/VS2008/TestCatch/_UpgradeReport_Files/UpgradeReport.xslt +232 -0
  485. data/ext/snowcrash/test/vendor/Catch/projects/VS2008/TestCatch/_UpgradeReport_Files/UpgradeReport_Minus.gif +0 -0
  486. data/ext/snowcrash/test/vendor/Catch/projects/VS2008/TestCatch/_UpgradeReport_Files/UpgradeReport_Plus.gif +0 -0
  487. data/ext/snowcrash/test/vendor/Catch/projects/VS2010/TestCatch/TestCatch.sln +20 -0
  488. data/ext/snowcrash/test/vendor/Catch/projects/VS2010/TestCatch/TestCatch/ReadMe.txt +33 -0
  489. data/ext/snowcrash/test/vendor/Catch/projects/VS2010/TestCatch/TestCatch/TestCatch.cpp +8 -0
  490. data/ext/snowcrash/test/vendor/Catch/projects/VS2010/TestCatch/TestCatch/TestCatch.vcxproj +149 -0
  491. data/ext/snowcrash/test/vendor/Catch/projects/XCode3/CatchSelfTest.xcodeproj/project.pbxproj +440 -0
  492. data/ext/snowcrash/test/vendor/Catch/projects/XCode3/CatchSelfTest.xcodeproj/project.xcworkspace/contents.xcworkspacedata +7 -0
  493. data/ext/snowcrash/test/vendor/Catch/projects/XCode3/CatchSelfTest.xcodeproj/xcuserdata/phil.xcuserdatad/xcdebugger/Breakpoints.xcbkptlist +81 -0
  494. data/ext/snowcrash/test/vendor/Catch/projects/XCode3/CatchSelfTest.xcodeproj/xcuserdata/phil.xcuserdatad/xcschemes/Test.xcscheme +154 -0
  495. data/ext/snowcrash/test/vendor/Catch/projects/XCode3/CatchSelfTest.xcodeproj/xcuserdata/phil.xcuserdatad/xcschemes/xcschememanagement.plist +22 -0
  496. data/ext/snowcrash/test/vendor/Catch/projects/XCode3/CatchSelfTestSingle/CatchSelfTestSingle.1 +79 -0
  497. data/ext/snowcrash/test/vendor/Catch/projects/XCode3/CatchSelfTestSingle/CatchSelfTestSingle.xcodeproj/project.pbxproj +246 -0
  498. data/ext/snowcrash/test/vendor/Catch/projects/XCode3/OCTest/CatchOCTestCase.h +25 -0
  499. data/ext/snowcrash/test/vendor/Catch/projects/XCode3/OCTest/CatchOCTestCase.mm +45 -0
  500. data/ext/snowcrash/test/vendor/Catch/projects/XCode3/OCTest/Main.mm +1 -0
  501. data/ext/snowcrash/test/vendor/Catch/projects/XCode3/OCTest/OCTest.1 +79 -0
  502. data/ext/snowcrash/test/vendor/Catch/projects/XCode3/OCTest/OCTest.mm +28 -0
  503. data/ext/snowcrash/test/vendor/Catch/projects/XCode3/OCTest/OCTest.xcodeproj/project.pbxproj +259 -0
  504. data/ext/snowcrash/test/vendor/Catch/projects/XCode3/OCTest/OCTest_Prefix.pch +7 -0
  505. data/ext/snowcrash/test/vendor/Catch/projects/XCode3/OCTest/TestObj.h +25 -0
  506. data/ext/snowcrash/test/vendor/Catch/projects/XCode3/OCTest/TestObj.m +18 -0
  507. data/ext/snowcrash/test/vendor/Catch/projects/XCode4/CatchSelfTest/CatchSelfTest.xcodeproj/project.pbxproj +667 -0
  508. data/ext/snowcrash/test/vendor/Catch/projects/XCode4/CatchSelfTest/CatchSelfTest.xcodeproj/project.xcworkspace/contents.xcworkspacedata +7 -0
  509. data/ext/snowcrash/test/vendor/Catch/projects/XCode4/CatchSelfTest/CatchSelfTest.xcodeproj/xcuserdata/Phil.xcuserdatad/xcschemes/xcschememanagement.plist +22 -0
  510. data/ext/snowcrash/test/vendor/Catch/projects/XCode4/CatchSelfTest/CatchSelfTest/CatchSelfTest.1 +79 -0
  511. data/ext/snowcrash/test/vendor/Catch/projects/XCode4/CatchSelfTest/CatchSelfTest/catch_text.cpp +2 -0
  512. data/ext/snowcrash/test/vendor/Catch/projects/XCode4/CatchSelfTest/CatchSelfTestSingle.xcodeproj/project.pbxproj +264 -0
  513. data/ext/snowcrash/test/vendor/Catch/projects/XCode4/CatchSelfTest/CatchSelfTestSingle.xcodeproj/project.xcworkspace/contents.xcworkspacedata +7 -0
  514. data/ext/snowcrash/test/vendor/Catch/projects/XCode4/CatchSelfTest/CatchSelfTestSingle/dummy.txt +0 -0
  515. data/ext/snowcrash/test/vendor/Catch/projects/XCode4/OCTest/OCTest.xcodeproj/project.pbxproj +249 -0
  516. data/ext/snowcrash/test/vendor/Catch/projects/XCode4/OCTest/OCTest.xcodeproj/project.xcworkspace/contents.xcworkspacedata +7 -0
  517. data/ext/snowcrash/test/vendor/Catch/projects/XCode4/OCTest/OCTest/CatchOCTestCase.h +25 -0
  518. data/ext/snowcrash/test/vendor/Catch/projects/XCode4/OCTest/OCTest/CatchOCTestCase.mm +82 -0
  519. data/ext/snowcrash/test/vendor/Catch/projects/XCode4/OCTest/OCTest/Main.mm +2 -0
  520. data/ext/snowcrash/test/vendor/Catch/projects/XCode4/OCTest/OCTest/OCTest.1 +79 -0
  521. data/ext/snowcrash/test/vendor/Catch/projects/XCode4/OCTest/OCTest/OCTest.mm +28 -0
  522. data/ext/snowcrash/test/vendor/Catch/projects/XCode4/OCTest/OCTest/TestObj.h +28 -0
  523. data/ext/snowcrash/test/vendor/Catch/projects/XCode4/OCTest/OCTest/TestObj.m +25 -0
  524. data/ext/snowcrash/test/vendor/Catch/projects/XCode4/iOSTest/iOSTest.xcodeproj/project.pbxproj +299 -0
  525. data/ext/snowcrash/test/vendor/Catch/projects/XCode4/iOSTest/iOSTest.xcodeproj/project.xcworkspace/contents.xcworkspacedata +7 -0
  526. data/ext/snowcrash/test/vendor/Catch/projects/XCode4/iOSTest/iOSTest/OCTest.mm +27 -0
  527. data/ext/snowcrash/test/vendor/Catch/projects/XCode4/iOSTest/iOSTest/TestObj.h +25 -0
  528. data/ext/snowcrash/test/vendor/Catch/projects/XCode4/iOSTest/iOSTest/TestObj.m +18 -0
  529. data/ext/snowcrash/test/vendor/Catch/projects/XCode4/iOSTest/iOSTest/en.lproj/InfoPlist.strings +2 -0
  530. data/ext/snowcrash/test/vendor/Catch/projects/XCode4/iOSTest/iOSTest/iOSTest-Info.plist +47 -0
  531. data/ext/snowcrash/test/vendor/Catch/projects/XCode4/iOSTest/iOSTest/iOSTest-Prefix.pch +14 -0
  532. data/ext/snowcrash/test/vendor/Catch/projects/runners/iTchRunner/internal/iTchRunnerAppDelegate.h +114 -0
  533. data/ext/snowcrash/test/vendor/Catch/projects/runners/iTchRunner/internal/iTchRunnerMainView.h +189 -0
  534. data/ext/snowcrash/test/vendor/Catch/projects/runners/iTchRunner/internal/iTchRunnerReporter.h +115 -0
  535. data/ext/snowcrash/test/vendor/Catch/projects/runners/iTchRunner/itChRunnerMain.mm +27 -0
  536. data/ext/snowcrash/test/vendor/Catch/projects/runners/iTchRunner/readme +6 -0
  537. data/ext/snowcrash/test/vendor/Catch/scripts/approvalTests.py +63 -0
  538. data/ext/snowcrash/test/vendor/Catch/scripts/approve.py +14 -0
  539. data/ext/snowcrash/test/vendor/Catch/scripts/generateSingleHeader.py +117 -0
  540. data/ext/snowcrash/test/vendor/Catch/scripts/scriptCommon.py +4 -0
  541. data/ext/snowcrash/test/vendor/Catch/single_include/catch.hpp +8046 -0
  542. data/ext/snowcrash/tools/README.md +27 -0
  543. data/ext/snowcrash/tools/gyp/LICENSE +27 -0
  544. data/ext/snowcrash/tools/gyp/gyptest.py +274 -0
  545. data/ext/snowcrash/tools/gyp/pylib/gyp/MSVSSettings_test.py +1483 -0
  546. data/ext/snowcrash/tools/gyp/pylib/gyp/__init__.pyc +0 -0
  547. data/ext/snowcrash/tools/gyp/pylib/gyp/common.pyc +0 -0
  548. data/ext/snowcrash/tools/gyp/pylib/gyp/common_test.py +72 -0
  549. data/ext/snowcrash/tools/gyp/pylib/gyp/easy_xml_test.py +103 -0
  550. data/ext/snowcrash/tools/gyp/pylib/gyp/generator/__init__.pyc +0 -0
  551. data/ext/snowcrash/tools/gyp/pylib/gyp/generator/make.pyc +0 -0
  552. data/ext/snowcrash/tools/gyp/pylib/gyp/generator/msvs_test.py +37 -0
  553. data/ext/snowcrash/tools/gyp/pylib/gyp/generator/ninja_test.py +44 -0
  554. data/ext/snowcrash/tools/gyp/pylib/gyp/generator/xcode.pyc +0 -0
  555. data/ext/snowcrash/tools/gyp/pylib/gyp/generator/xcode_test.py +23 -0
  556. data/ext/snowcrash/tools/gyp/pylib/gyp/input.pyc +0 -0
  557. data/ext/snowcrash/tools/gyp/pylib/gyp/input_test.py +90 -0
  558. data/ext/snowcrash/tools/gyp/pylib/gyp/xcode_emulation.pyc +0 -0
  559. data/ext/snowcrash/tools/gyp/pylib/gyp/xcodeproj_file.pyc +0 -0
  560. data/ext/snowcrash/tools/gyp/tools/README +15 -0
  561. data/ext/snowcrash/tools/gyp/tools/Xcode/README +5 -0
  562. data/ext/snowcrash/tools/gyp/tools/emacs/README +12 -0
  563. data/ext/snowcrash/tools/gyp/tools/emacs/gyp-tests.el +63 -0
  564. data/ext/snowcrash/tools/gyp/tools/emacs/run-unit-tests.sh +7 -0
  565. data/ext/snowcrash/tools/gyp/tools/emacs/testdata/media.gyp +1105 -0
  566. data/ext/snowcrash/tools/gyp/tools/emacs/testdata/media.gyp.fontified +1107 -0
  567. data/lib/redsnow.rb +2 -2
  568. data/lib/redsnow/blueprint.rb +2 -1
  569. data/lib/redsnow/version.rb +1 -1
  570. data/pkg/redsnow-0.1.3.gem +0 -0
  571. data/pkg/redsnow-0.1.4.gem +0 -0
  572. data/pkg/redsnow-0.1.5.gem +0 -0
  573. data/pkg/redsnow-0.1.6.gem +0 -0
  574. data/pkg/redsnow-0.2.0.gem +0 -0
  575. data/pkg/redsnow-0.2.1.gem +0 -0
  576. data/pkg/redsnow-0.3.1.gem +0 -0
  577. data/redsnow.gemspec +2 -1
  578. data/test/redsnow_binding_test.rb +1 -1
  579. data/test/redsnow_options_test.rb +4 -4
  580. metadata +540 -6
  581. data/.gitignore +0 -34
  582. data/.gitmodules +0 -3
  583. data/.travis.yml +0 -21
@@ -0,0 +1,15 @@
1
+ /*
2
+ * Created by Phil on 01/11/2010.
3
+ * Copyright 2010 Two Blue Cubes Ltd. All rights reserved.
4
+ *
5
+ * Distributed under the Boost Software License, Version 1.0. (See accompanying
6
+ * file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
7
+ */
8
+ #ifndef TWOBLUECUBES_CATCH_WITH_MAIN_HPP_INCLUDED
9
+ #define TWOBLUECUBES_CATCH_WITH_MAIN_HPP_INCLUDED
10
+
11
+ #include "catch_runner.hpp"
12
+ #include "catch.hpp"
13
+ #include "internal/catch_default_main.hpp"
14
+
15
+ #endif // TWOBLUECUBES_CATCH_WITH_MAIN_HPP_INCLUDED
@@ -0,0 +1,868 @@
1
+ /*
2
+ * Created by Phil on 25/05/2013.
3
+ * Copyright 2013 Two Blue Cubes Ltd. All rights reserved.
4
+ *
5
+ * Distributed under the Boost Software License, Version 1.0. (See accompanying
6
+ * file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
7
+ */
8
+
9
+ // Only use header guard if we are not using an outer namespace
10
+ #if !defined(TWOBLUECUBES_CLARA_H_INCLUDED) || defined(STITCH_CLARA_OPEN_NAMESPACE)
11
+
12
+ #ifndef STITCH_CLARA_OPEN_NAMESPACE
13
+ #define TWOBLUECUBES_CLARA_H_INCLUDED
14
+ #define STITCH_CLARA_OPEN_NAMESPACE
15
+ #define STITCH_CLARA_CLOSE_NAMESPACE
16
+ #else
17
+ #define STITCH_CLARA_CLOSE_NAMESPACE }
18
+ #endif
19
+
20
+
21
+ #define STITCH_TBC_TEXT_FORMAT_OPEN_NAMESPACE STITCH_CLARA_OPEN_NAMESPACE
22
+
23
+ // ----------- #included from tbc_text_format.h -----------
24
+
25
+ /*
26
+ * Created by Phil on 18/4/2013.
27
+ * Copyright 2013 Two Blue Cubes Ltd. All rights reserved.
28
+ *
29
+ * Distributed under the Boost Software License, Version 1.0. (See accompanying
30
+ * file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
31
+ */
32
+ // Only use header guard if we are not using an outer namespace
33
+ #if !defined(TBC_TEXT_FORMAT_H_INCLUDED) || defined(STITCH_TBC_TEXT_FORMAT_OUTER_NAMESPACE)
34
+ #ifndef STITCH_TBC_TEXT_FORMAT_OUTER_NAMESPACE
35
+ #define TBC_TEXT_FORMAT_H_INCLUDED
36
+ #endif
37
+
38
+ #include <string>
39
+ #include <vector>
40
+ #include <sstream>
41
+
42
+ // Use optional outer namespace
43
+ #ifdef STITCH_TBC_TEXT_FORMAT_OUTER_NAMESPACE
44
+ namespace STITCH_TBC_TEXT_FORMAT_OUTER_NAMESPACE {
45
+ #endif
46
+
47
+ namespace Tbc {
48
+
49
+ #ifdef TBC_TEXT_FORMAT_CONSOLE_WIDTH
50
+ const unsigned int consoleWidth = TBC_TEXT_FORMAT_CONSOLE_WIDTH;
51
+ #else
52
+ const unsigned int consoleWidth = 80;
53
+ #endif
54
+
55
+ struct TextAttributes {
56
+ TextAttributes()
57
+ : initialIndent( std::string::npos ),
58
+ indent( 0 ),
59
+ width( consoleWidth-1 ),
60
+ tabChar( '\t' )
61
+ {}
62
+
63
+ TextAttributes& setInitialIndent( std::size_t _value ) { initialIndent = _value; return *this; }
64
+ TextAttributes& setIndent( std::size_t _value ) { indent = _value; return *this; }
65
+ TextAttributes& setWidth( std::size_t _value ) { width = _value; return *this; }
66
+ TextAttributes& setTabChar( char _value ) { tabChar = _value; return *this; }
67
+
68
+ std::size_t initialIndent; // indent of first line, or npos
69
+ std::size_t indent; // indent of subsequent lines, or all if initialIndent is npos
70
+ std::size_t width; // maximum width of text, including indent. Longer text will wrap
71
+ char tabChar; // If this char is seen the indent is changed to current pos
72
+ };
73
+
74
+ class Text {
75
+ public:
76
+ Text( std::string const& _str, TextAttributes const& _attr = TextAttributes() )
77
+ : attr( _attr )
78
+ {
79
+ std::string wrappableChars = " [({.,/|\\-";
80
+ std::size_t indent = _attr.initialIndent != std::string::npos
81
+ ? _attr.initialIndent
82
+ : _attr.indent;
83
+ std::string remainder = _str;
84
+
85
+ while( !remainder.empty() ) {
86
+ if( lines.size() >= 1000 ) {
87
+ lines.push_back( "... message truncated due to excessive size" );
88
+ return;
89
+ }
90
+ std::size_t tabPos = std::string::npos;
91
+ std::size_t width = (std::min)( remainder.size(), _attr.width - indent );
92
+ std::size_t pos = remainder.find_first_of( '\n' );
93
+ if( pos <= width ) {
94
+ width = pos;
95
+ }
96
+ pos = remainder.find_last_of( _attr.tabChar, width );
97
+ if( pos != std::string::npos ) {
98
+ tabPos = pos;
99
+ if( remainder[width] == '\n' )
100
+ width--;
101
+ remainder = remainder.substr( 0, tabPos ) + remainder.substr( tabPos+1 );
102
+ }
103
+
104
+ if( width == remainder.size() ) {
105
+ spliceLine( indent, remainder, width );
106
+ }
107
+ else if( remainder[width] == '\n' ) {
108
+ spliceLine( indent, remainder, width );
109
+ if( width <= 1 || remainder.size() != 1 )
110
+ remainder = remainder.substr( 1 );
111
+ indent = _attr.indent;
112
+ }
113
+ else {
114
+ pos = remainder.find_last_of( wrappableChars, width );
115
+ if( pos != std::string::npos && pos > 0 ) {
116
+ spliceLine( indent, remainder, pos );
117
+ if( remainder[0] == ' ' )
118
+ remainder = remainder.substr( 1 );
119
+ }
120
+ else {
121
+ spliceLine( indent, remainder, width-1 );
122
+ lines.back() += "-";
123
+ }
124
+ if( lines.size() == 1 )
125
+ indent = _attr.indent;
126
+ if( tabPos != std::string::npos )
127
+ indent += tabPos;
128
+ }
129
+ }
130
+ }
131
+
132
+ void spliceLine( std::size_t _indent, std::string& _remainder, std::size_t _pos ) {
133
+ lines.push_back( std::string( _indent, ' ' ) + _remainder.substr( 0, _pos ) );
134
+ _remainder = _remainder.substr( _pos );
135
+ }
136
+
137
+ typedef std::vector<std::string>::const_iterator const_iterator;
138
+
139
+ const_iterator begin() const { return lines.begin(); }
140
+ const_iterator end() const { return lines.end(); }
141
+ std::string const& last() const { return lines.back(); }
142
+ std::size_t size() const { return lines.size(); }
143
+ std::string const& operator[]( std::size_t _index ) const { return lines[_index]; }
144
+ std::string toString() const {
145
+ std::ostringstream oss;
146
+ oss << *this;
147
+ return oss.str();
148
+ }
149
+
150
+ inline friend std::ostream& operator << ( std::ostream& _stream, Text const& _text ) {
151
+ for( Text::const_iterator it = _text.begin(), itEnd = _text.end();
152
+ it != itEnd; ++it ) {
153
+ if( it != _text.begin() )
154
+ _stream << "\n";
155
+ _stream << *it;
156
+ }
157
+ return _stream;
158
+ }
159
+
160
+ private:
161
+ std::string str;
162
+ TextAttributes attr;
163
+ std::vector<std::string> lines;
164
+ };
165
+
166
+ } // end namespace Tbc
167
+
168
+ #ifdef STITCH_TBC_TEXT_FORMAT_OUTER_NAMESPACE
169
+ } // end outer namespace
170
+ #endif
171
+
172
+ #endif // TBC_TEXT_FORMAT_H_INCLUDED
173
+
174
+ // ----------- end of #include from tbc_text_format.h -----------
175
+ // ........... back in /Users/philnash/Dev/OSS/Clara/srcs/clara.h
176
+
177
+ #undef STITCH_TBC_TEXT_FORMAT_OPEN_NAMESPACE
178
+
179
+
180
+ #include <map>
181
+ #include <algorithm>
182
+ #include <stdexcept>
183
+ #include <memory>
184
+
185
+ // Use optional outer namespace
186
+ #ifdef STITCH_CLARA_OPEN_NAMESPACE
187
+ STITCH_CLARA_OPEN_NAMESPACE
188
+ #endif
189
+
190
+ namespace Clara {
191
+
192
+ struct UnpositionalTag {};
193
+
194
+ extern UnpositionalTag _;
195
+
196
+ #ifdef CLARA_CONFIG_MAIN
197
+ UnpositionalTag _;
198
+ #endif
199
+
200
+ namespace Detail {
201
+
202
+ #ifdef CLARA_CONSOLE_WIDTH
203
+ const unsigned int consoleWidth = CLARA_CONFIG_CONSOLE_WIDTH;
204
+ #else
205
+ const unsigned int consoleWidth = 80;
206
+ #endif
207
+
208
+ using namespace Tbc;
209
+
210
+ inline bool startsWith( std::string const& str, std::string const& prefix ) {
211
+ return str.size() >= prefix.size() && str.substr( 0, prefix.size() ) == prefix;
212
+ }
213
+
214
+ template<typename T> struct RemoveConstRef{ typedef T type; };
215
+ template<typename T> struct RemoveConstRef<T&>{ typedef T type; };
216
+ template<typename T> struct RemoveConstRef<T const&>{ typedef T type; };
217
+ template<typename T> struct RemoveConstRef<T const>{ typedef T type; };
218
+
219
+ template<typename T> struct IsBool { static const bool value = false; };
220
+ template<> struct IsBool<bool> { static const bool value = true; };
221
+
222
+ template<typename T>
223
+ void convertInto( std::string const& _source, T& _dest ) {
224
+ std::stringstream ss;
225
+ ss << _source;
226
+ ss >> _dest;
227
+ if( ss.fail() )
228
+ throw std::runtime_error( "Unable to convert " + _source + " to destination type" );
229
+ }
230
+ inline void convertInto( std::string const& _source, std::string& _dest ) {
231
+ _dest = _source;
232
+ }
233
+ inline void convertInto( std::string const& _source, bool& _dest ) {
234
+ std::string sourceLC = _source;
235
+ std::transform( sourceLC.begin(), sourceLC.end(), sourceLC.begin(), ::tolower );
236
+ if( sourceLC == "y" || sourceLC == "1" || sourceLC == "true" || sourceLC == "yes" || sourceLC == "on" )
237
+ _dest = true;
238
+ else if( sourceLC == "n" || sourceLC == "0" || sourceLC == "false" || sourceLC == "no" || sourceLC == "off" )
239
+ _dest = false;
240
+ else
241
+ throw std::runtime_error( "Expected a boolean value but did not recognise:\n '" + _source + "'" );
242
+ }
243
+ inline void convertInto( bool _source, bool& _dest ) {
244
+ _dest = _source;
245
+ }
246
+ template<typename T>
247
+ inline void convertInto( bool, T& ) {
248
+ throw std::runtime_error( "Invalid conversion" );
249
+ }
250
+
251
+ template<typename ConfigT>
252
+ struct IArgFunction {
253
+ virtual ~IArgFunction() {}
254
+ # ifdef CATCH_CPP11_OR_GREATER
255
+ IArgFunction() = default;
256
+ IArgFunction( IArgFunction const& ) = default;
257
+ # endif
258
+ virtual void set( ConfigT& config, std::string const& value ) const = 0;
259
+ virtual void setFlag( ConfigT& config ) const = 0;
260
+ virtual bool takesArg() const = 0;
261
+ virtual IArgFunction* clone() const = 0;
262
+ };
263
+
264
+ template<typename ConfigT>
265
+ class BoundArgFunction {
266
+ public:
267
+ BoundArgFunction() : functionObj( NULL ) {}
268
+ BoundArgFunction( IArgFunction<ConfigT>* _functionObj ) : functionObj( _functionObj ) {}
269
+ BoundArgFunction( BoundArgFunction const& other ) : functionObj( other.functionObj ? other.functionObj->clone() : NULL ) {}
270
+ BoundArgFunction& operator = ( BoundArgFunction const& other ) {
271
+ IArgFunction<ConfigT>* newFunctionObj = other.functionObj ? other.functionObj->clone() : NULL;
272
+ delete functionObj;
273
+ functionObj = newFunctionObj;
274
+ return *this;
275
+ }
276
+ ~BoundArgFunction() { delete functionObj; }
277
+
278
+ void set( ConfigT& config, std::string const& value ) const {
279
+ functionObj->set( config, value );
280
+ }
281
+ void setFlag( ConfigT& config ) const {
282
+ functionObj->setFlag( config );
283
+ }
284
+ bool takesArg() const { return functionObj->takesArg(); }
285
+
286
+ bool isSet() const {
287
+ return functionObj != NULL;
288
+ }
289
+ private:
290
+ IArgFunction<ConfigT>* functionObj;
291
+ };
292
+
293
+
294
+ template<typename C>
295
+ struct NullBinder : IArgFunction<C>{
296
+ virtual void set( C&, std::string const& ) const {}
297
+ virtual void setFlag( C& ) const {}
298
+ virtual bool takesArg() const { return true; }
299
+ virtual IArgFunction<C>* clone() const { return new NullBinder( *this ); }
300
+ };
301
+
302
+ template<typename C, typename M>
303
+ struct BoundDataMember : IArgFunction<C>{
304
+ BoundDataMember( M C::* _member ) : member( _member ) {}
305
+ virtual void set( C& p, std::string const& stringValue ) const {
306
+ convertInto( stringValue, p.*member );
307
+ }
308
+ virtual void setFlag( C& p ) const {
309
+ convertInto( true, p.*member );
310
+ }
311
+ virtual bool takesArg() const { return !IsBool<M>::value; }
312
+ virtual IArgFunction<C>* clone() const { return new BoundDataMember( *this ); }
313
+ M C::* member;
314
+ };
315
+ template<typename C, typename M>
316
+ struct BoundUnaryMethod : IArgFunction<C>{
317
+ BoundUnaryMethod( void (C::*_member)( M ) ) : member( _member ) {}
318
+ virtual void set( C& p, std::string const& stringValue ) const {
319
+ typename RemoveConstRef<M>::type value;
320
+ convertInto( stringValue, value );
321
+ (p.*member)( value );
322
+ }
323
+ virtual void setFlag( C& p ) const {
324
+ typename RemoveConstRef<M>::type value;
325
+ convertInto( true, value );
326
+ (p.*member)( value );
327
+ }
328
+ virtual bool takesArg() const { return !IsBool<M>::value; }
329
+ virtual IArgFunction<C>* clone() const { return new BoundUnaryMethod( *this ); }
330
+ void (C::*member)( M );
331
+ };
332
+ template<typename C>
333
+ struct BoundNullaryMethod : IArgFunction<C>{
334
+ BoundNullaryMethod( void (C::*_member)() ) : member( _member ) {}
335
+ virtual void set( C& p, std::string const& stringValue ) const {
336
+ bool value;
337
+ convertInto( stringValue, value );
338
+ if( value )
339
+ (p.*member)();
340
+ }
341
+ virtual void setFlag( C& p ) const {
342
+ (p.*member)();
343
+ }
344
+ virtual bool takesArg() const { return false; }
345
+ virtual IArgFunction<C>* clone() const { return new BoundNullaryMethod( *this ); }
346
+ void (C::*member)();
347
+ };
348
+
349
+ template<typename C>
350
+ struct BoundUnaryFunction : IArgFunction<C>{
351
+ BoundUnaryFunction( void (*_function)( C& ) ) : function( _function ) {}
352
+ virtual void set( C& obj, std::string const& stringValue ) const {
353
+ bool value;
354
+ convertInto( stringValue, value );
355
+ if( value )
356
+ function( obj );
357
+ }
358
+ virtual void setFlag( C& p ) const {
359
+ function( p );
360
+ }
361
+ virtual bool takesArg() const { return false; }
362
+ virtual IArgFunction<C>* clone() const { return new BoundUnaryFunction( *this ); }
363
+ void (*function)( C& );
364
+ };
365
+
366
+ template<typename C, typename T>
367
+ struct BoundBinaryFunction : IArgFunction<C>{
368
+ BoundBinaryFunction( void (*_function)( C&, T ) ) : function( _function ) {}
369
+ virtual void set( C& obj, std::string const& stringValue ) const {
370
+ typename RemoveConstRef<T>::type value;
371
+ convertInto( stringValue, value );
372
+ function( obj, value );
373
+ }
374
+ virtual void setFlag( C& obj ) const {
375
+ typename RemoveConstRef<T>::type value;
376
+ convertInto( true, value );
377
+ function( obj, value );
378
+ }
379
+ virtual bool takesArg() const { return !IsBool<T>::value; }
380
+ virtual IArgFunction<C>* clone() const { return new BoundBinaryFunction( *this ); }
381
+ void (*function)( C&, T );
382
+ };
383
+
384
+ } // namespace Detail
385
+
386
+ struct Parser {
387
+ Parser() : separators( " \t=:" ) {}
388
+
389
+ struct Token {
390
+ enum Type { Positional, ShortOpt, LongOpt };
391
+ Token( Type _type, std::string const& _data ) : type( _type ), data( _data ) {}
392
+ Type type;
393
+ std::string data;
394
+ };
395
+
396
+ void parseIntoTokens( int argc, char const * const * argv, std::vector<Parser::Token>& tokens ) const {
397
+ const std::string doubleDash = "--";
398
+ for( int i = 1; i < argc && argv[i] != doubleDash; ++i )
399
+ parseIntoTokens( argv[i] , tokens);
400
+ }
401
+ void parseIntoTokens( std::string arg, std::vector<Parser::Token>& tokens ) const {
402
+ while( !arg.empty() ) {
403
+ Parser::Token token( Parser::Token::Positional, arg );
404
+ arg = "";
405
+ if( token.data[0] == '-' ) {
406
+ if( token.data.size() > 1 && token.data[1] == '-' ) {
407
+ token = Parser::Token( Parser::Token::LongOpt, token.data.substr( 2 ) );
408
+ }
409
+ else {
410
+ token = Parser::Token( Parser::Token::ShortOpt, token.data.substr( 1 ) );
411
+ if( token.data.size() > 1 && separators.find( token.data[1] ) == std::string::npos ) {
412
+ arg = "-" + token.data.substr( 1 );
413
+ token.data = token.data.substr( 0, 1 );
414
+ }
415
+ }
416
+ }
417
+ if( token.type != Parser::Token::Positional ) {
418
+ std::size_t pos = token.data.find_first_of( separators );
419
+ if( pos != std::string::npos ) {
420
+ arg = token.data.substr( pos+1 );
421
+ token.data = token.data.substr( 0, pos );
422
+ }
423
+ }
424
+ tokens.push_back( token );
425
+ }
426
+ }
427
+ std::string separators;
428
+ };
429
+
430
+ template<typename ConfigT>
431
+ struct CommonArgProperties {
432
+ CommonArgProperties() {}
433
+ CommonArgProperties( Detail::BoundArgFunction<ConfigT> const& _boundField ) : boundField( _boundField ) {}
434
+
435
+ Detail::BoundArgFunction<ConfigT> boundField;
436
+ std::string description;
437
+ std::string detail;
438
+ std::string placeholder; // Only value if boundField takes an arg
439
+
440
+ bool takesArg() const {
441
+ return !placeholder.empty();
442
+ }
443
+ void validate() const {
444
+ if( !boundField.isSet() )
445
+ throw std::logic_error( "option not bound" );
446
+ }
447
+ };
448
+ struct OptionArgProperties {
449
+ std::vector<std::string> shortNames;
450
+ std::string longName;
451
+
452
+ bool hasShortName( std::string const& shortName ) const {
453
+ return std::find( shortNames.begin(), shortNames.end(), shortName ) != shortNames.end();
454
+ }
455
+ bool hasLongName( std::string const& _longName ) const {
456
+ return _longName == longName;
457
+ }
458
+ };
459
+ struct PositionalArgProperties {
460
+ PositionalArgProperties() : position( -1 ) {}
461
+ int position; // -1 means non-positional (floating)
462
+
463
+ bool isFixedPositional() const {
464
+ return position != -1;
465
+ }
466
+ };
467
+
468
+ template<typename ConfigT>
469
+ class CommandLine {
470
+
471
+ struct Arg : CommonArgProperties<ConfigT>, OptionArgProperties, PositionalArgProperties {
472
+ Arg() {}
473
+ Arg( Detail::BoundArgFunction<ConfigT> const& _boundField ) : CommonArgProperties<ConfigT>( _boundField ) {}
474
+
475
+ using CommonArgProperties<ConfigT>::placeholder; // !TBD
476
+
477
+ std::string dbgName() const {
478
+ if( !longName.empty() )
479
+ return "--" + longName;
480
+ if( !shortNames.empty() )
481
+ return "-" + shortNames[0];
482
+ return "positional args";
483
+ }
484
+ std::string commands() const {
485
+ std::ostringstream oss;
486
+ bool first = true;
487
+ std::vector<std::string>::const_iterator it = shortNames.begin(), itEnd = shortNames.end();
488
+ for(; it != itEnd; ++it ) {
489
+ if( first )
490
+ first = false;
491
+ else
492
+ oss << ", ";
493
+ oss << "-" << *it;
494
+ }
495
+ if( !longName.empty() ) {
496
+ if( !first )
497
+ oss << ", ";
498
+ oss << "--" << longName;
499
+ }
500
+ if( !placeholder.empty() )
501
+ oss << " <" << placeholder << ">";
502
+ return oss.str();
503
+ }
504
+ };
505
+
506
+ // NOTE: std::auto_ptr is deprecated in c++11/c++0x
507
+ #if defined(__cplusplus) && __cplusplus > 199711L
508
+ typedef std::unique_ptr<Arg> ArgAutoPtr;
509
+ #else
510
+ typedef std::auto_ptr<Arg> ArgAutoPtr;
511
+ #endif
512
+
513
+ friend void addOptName( Arg& arg, std::string const& optName )
514
+ {
515
+ if( optName.empty() )
516
+ return;
517
+ if( Detail::startsWith( optName, "--" ) ) {
518
+ if( !arg.longName.empty() )
519
+ throw std::logic_error( "Only one long opt may be specified. '"
520
+ + arg.longName
521
+ + "' already specified, now attempting to add '"
522
+ + optName + "'" );
523
+ arg.longName = optName.substr( 2 );
524
+ }
525
+ else if( Detail::startsWith( optName, "-" ) )
526
+ arg.shortNames.push_back( optName.substr( 1 ) );
527
+ else
528
+ throw std::logic_error( "option must begin with - or --. Option was: '" + optName + "'" );
529
+ }
530
+ friend void setPositionalArg( Arg& arg, int position )
531
+ {
532
+ arg.position = position;
533
+ }
534
+
535
+
536
+ class ArgBuilder {
537
+ public:
538
+ ArgBuilder( Arg* arg ) : m_arg( arg ) {}
539
+
540
+ // Bind a non-boolean data member (requires placeholder string)
541
+ template<typename C, typename M>
542
+ void bind( M C::* field, std::string const& placeholder ) {
543
+ m_arg->boundField = new Detail::BoundDataMember<C,M>( field );
544
+ m_arg->placeholder = placeholder;
545
+ }
546
+ // Bind a boolean data member (no placeholder required)
547
+ template<typename C>
548
+ void bind( bool C::* field ) {
549
+ m_arg->boundField = new Detail::BoundDataMember<C,bool>( field );
550
+ }
551
+
552
+ // Bind a method taking a single, non-boolean argument (requires a placeholder string)
553
+ template<typename C, typename M>
554
+ void bind( void (C::* unaryMethod)( M ), std::string const& placeholder ) {
555
+ m_arg->boundField = new Detail::BoundUnaryMethod<C,M>( unaryMethod );
556
+ m_arg->placeholder = placeholder;
557
+ }
558
+
559
+ // Bind a method taking a single, boolean argument (no placeholder string required)
560
+ template<typename C>
561
+ void bind( void (C::* unaryMethod)( bool ) ) {
562
+ m_arg->boundField = new Detail::BoundUnaryMethod<C,bool>( unaryMethod );
563
+ }
564
+
565
+ // Bind a method that takes no arguments (will be called if opt is present)
566
+ template<typename C>
567
+ void bind( void (C::* nullaryMethod)() ) {
568
+ m_arg->boundField = new Detail::BoundNullaryMethod<C>( nullaryMethod );
569
+ }
570
+
571
+ // Bind a free function taking a single argument - the object to operate on (no placeholder string required)
572
+ template<typename C>
573
+ void bind( void (* unaryFunction)( C& ) ) {
574
+ m_arg->boundField = new Detail::BoundUnaryFunction<C>( unaryFunction );
575
+ }
576
+
577
+ // Bind a free function taking a single argument - the object to operate on (requires a placeholder string)
578
+ template<typename C, typename T>
579
+ void bind( void (* binaryFunction)( C&, T ), std::string const& placeholder ) {
580
+ m_arg->boundField = new Detail::BoundBinaryFunction<C, T>( binaryFunction );
581
+ m_arg->placeholder = placeholder;
582
+ }
583
+
584
+ ArgBuilder& describe( std::string const& description ) {
585
+ m_arg->description = description;
586
+ return *this;
587
+ }
588
+ ArgBuilder& detail( std::string const& detail ) {
589
+ m_arg->detail = detail;
590
+ return *this;
591
+ }
592
+
593
+ protected:
594
+ Arg* m_arg;
595
+ };
596
+
597
+ class OptBuilder : public ArgBuilder {
598
+ public:
599
+ OptBuilder( Arg* arg ) : ArgBuilder( arg ) {}
600
+ OptBuilder( OptBuilder& other ) : ArgBuilder( other ) {}
601
+
602
+ OptBuilder& operator[]( std::string const& optName ) {
603
+ addOptName( *ArgBuilder::m_arg, optName );
604
+ return *this;
605
+ }
606
+ };
607
+
608
+ public:
609
+
610
+ CommandLine()
611
+ : m_boundProcessName( new Detail::NullBinder<ConfigT>() ),
612
+ m_highestSpecifiedArgPosition( 0 ),
613
+ m_throwOnUnrecognisedTokens( false )
614
+ {}
615
+ CommandLine( CommandLine const& other )
616
+ : m_boundProcessName( other.m_boundProcessName ),
617
+ m_options ( other.m_options ),
618
+ m_positionalArgs( other.m_positionalArgs ),
619
+ m_highestSpecifiedArgPosition( other.m_highestSpecifiedArgPosition ),
620
+ m_throwOnUnrecognisedTokens( other.m_throwOnUnrecognisedTokens )
621
+ {
622
+ if( other.m_floatingArg.get() )
623
+ m_floatingArg = ArgAutoPtr( new Arg( *other.m_floatingArg ) );
624
+ }
625
+
626
+ CommandLine& setThrowOnUnrecognisedTokens( bool shouldThrow = true ) {
627
+ m_throwOnUnrecognisedTokens = shouldThrow;
628
+ return *this;
629
+ }
630
+
631
+
632
+ OptBuilder operator[]( std::string const& optName ) {
633
+ m_options.push_back( Arg() );
634
+ addOptName( m_options.back(), optName );
635
+ OptBuilder builder( &m_options.back() );
636
+ return builder;
637
+ }
638
+
639
+ ArgBuilder operator[]( int position ) {
640
+ m_positionalArgs.insert( std::make_pair( position, Arg() ) );
641
+ if( position > m_highestSpecifiedArgPosition )
642
+ m_highestSpecifiedArgPosition = position;
643
+ setPositionalArg( m_positionalArgs[position], position );
644
+ ArgBuilder builder( &m_positionalArgs[position] );
645
+ return builder;
646
+ }
647
+
648
+ // Invoke this with the _ instance
649
+ ArgBuilder operator[]( UnpositionalTag ) {
650
+ if( m_floatingArg.get() )
651
+ throw std::logic_error( "Only one unpositional argument can be added" );
652
+ m_floatingArg = ArgAutoPtr( new Arg() );
653
+ ArgBuilder builder( m_floatingArg.get() );
654
+ return builder;
655
+ }
656
+
657
+ template<typename C, typename M>
658
+ void bindProcessName( M C::* field ) {
659
+ m_boundProcessName = new Detail::BoundDataMember<C,M>( field );
660
+ }
661
+ template<typename C, typename M>
662
+ void bindProcessName( void (C::*_unaryMethod)( M ) ) {
663
+ m_boundProcessName = new Detail::BoundUnaryMethod<C,M>( _unaryMethod );
664
+ }
665
+
666
+ void optUsage( std::ostream& os, std::size_t indent = 0, std::size_t width = Detail::consoleWidth ) const {
667
+ typename std::vector<Arg>::const_iterator itBegin = m_options.begin(), itEnd = m_options.end(), it;
668
+ std::size_t maxWidth = 0;
669
+ for( it = itBegin; it != itEnd; ++it )
670
+ maxWidth = (std::max)( maxWidth, it->commands().size() );
671
+
672
+ for( it = itBegin; it != itEnd; ++it ) {
673
+ Detail::Text usage( it->commands(), Detail::TextAttributes()
674
+ .setWidth( maxWidth+indent )
675
+ .setIndent( indent ) );
676
+ Detail::Text desc( it->description, Detail::TextAttributes()
677
+ .setWidth( width - maxWidth - 3 ) );
678
+
679
+ for( std::size_t i = 0; i < (std::max)( usage.size(), desc.size() ); ++i ) {
680
+ std::string usageCol = i < usage.size() ? usage[i] : "";
681
+ os << usageCol;
682
+
683
+ if( i < desc.size() && !desc[i].empty() )
684
+ os << std::string( indent + 2 + maxWidth - usageCol.size(), ' ' )
685
+ << desc[i];
686
+ os << "\n";
687
+ }
688
+ }
689
+ }
690
+ std::string optUsage() const {
691
+ std::ostringstream oss;
692
+ optUsage( oss );
693
+ return oss.str();
694
+ }
695
+
696
+ void argSynopsis( std::ostream& os ) const {
697
+ for( int i = 1; i <= m_highestSpecifiedArgPosition; ++i ) {
698
+ if( i > 1 )
699
+ os << " ";
700
+ typename std::map<int, Arg>::const_iterator it = m_positionalArgs.find( i );
701
+ if( it != m_positionalArgs.end() )
702
+ os << "<" << it->second.placeholder << ">";
703
+ else if( m_floatingArg.get() )
704
+ os << "<" << m_floatingArg->placeholder << ">";
705
+ else
706
+ throw std::logic_error( "non consecutive positional arguments with no floating args" );
707
+ }
708
+ // !TBD No indication of mandatory args
709
+ if( m_floatingArg.get() ) {
710
+ if( m_highestSpecifiedArgPosition > 1 )
711
+ os << " ";
712
+ os << "[<" << m_floatingArg->placeholder << "> ...]";
713
+ }
714
+ }
715
+ std::string argSynopsis() const {
716
+ std::ostringstream oss;
717
+ argSynopsis( oss );
718
+ return oss.str();
719
+ }
720
+
721
+ void usage( std::ostream& os, std::string const& procName ) const {
722
+ validate();
723
+ os << "usage:\n " << procName << " ";
724
+ argSynopsis( os );
725
+ if( !m_options.empty() ) {
726
+ os << " [options]\n\nwhere options are: \n";
727
+ optUsage( os, 2 );
728
+ }
729
+ os << "\n";
730
+ }
731
+ std::string usage( std::string const& procName ) const {
732
+ std::ostringstream oss;
733
+ usage( oss, procName );
734
+ return oss.str();
735
+ }
736
+
737
+ ConfigT parse( int argc, char const * const * argv ) const {
738
+ ConfigT config;
739
+ parseInto( argc, argv, config );
740
+ return config;
741
+ }
742
+
743
+ std::vector<Parser::Token> parseInto( int argc, char const * const * argv, ConfigT& config ) const {
744
+ std::string processName = argv[0];
745
+ std::size_t lastSlash = processName.find_last_of( "/\\" );
746
+ if( lastSlash != std::string::npos )
747
+ processName = processName.substr( lastSlash+1 );
748
+ m_boundProcessName.set( config, processName );
749
+ std::vector<Parser::Token> tokens;
750
+ Parser parser;
751
+ parser.parseIntoTokens( argc, argv, tokens );
752
+ return populate( tokens, config );
753
+ }
754
+
755
+ std::vector<Parser::Token> populate( std::vector<Parser::Token> const& tokens, ConfigT& config ) const {
756
+ validate();
757
+ std::vector<Parser::Token> unusedTokens = populateOptions( tokens, config );
758
+ unusedTokens = populateFixedArgs( unusedTokens, config );
759
+ unusedTokens = populateFloatingArgs( unusedTokens, config );
760
+ return unusedTokens;
761
+ }
762
+
763
+ std::vector<Parser::Token> populateOptions( std::vector<Parser::Token> const& tokens, ConfigT& config ) const {
764
+ std::vector<Parser::Token> unusedTokens;
765
+ std::vector<std::string> errors;
766
+ for( std::size_t i = 0; i < tokens.size(); ++i ) {
767
+ Parser::Token const& token = tokens[i];
768
+ typename std::vector<Arg>::const_iterator it = m_options.begin(), itEnd = m_options.end();
769
+ for(; it != itEnd; ++it ) {
770
+ Arg const& arg = *it;
771
+
772
+ try {
773
+ if( ( token.type == Parser::Token::ShortOpt && arg.hasShortName( token.data ) ) ||
774
+ ( token.type == Parser::Token::LongOpt && arg.hasLongName( token.data ) ) ) {
775
+ if( arg.takesArg() ) {
776
+ if( i == tokens.size()-1 || tokens[i+1].type != Parser::Token::Positional )
777
+ errors.push_back( "Expected argument to option: " + token.data );
778
+ else
779
+ arg.boundField.set( config, tokens[++i].data );
780
+ }
781
+ else {
782
+ arg.boundField.setFlag( config );
783
+ }
784
+ break;
785
+ }
786
+ }
787
+ catch( std::exception& ex ) {
788
+ errors.push_back( std::string( ex.what() ) + "\n- while parsing: (" + arg.commands() + ")" );
789
+ }
790
+ }
791
+ if( it == itEnd ) {
792
+ if( token.type == Parser::Token::Positional || !m_throwOnUnrecognisedTokens )
793
+ unusedTokens.push_back( token );
794
+ else if( m_throwOnUnrecognisedTokens )
795
+ errors.push_back( "unrecognised option: " + token.data );
796
+ }
797
+ }
798
+ if( !errors.empty() ) {
799
+ std::ostringstream oss;
800
+ for( std::vector<std::string>::const_iterator it = errors.begin(), itEnd = errors.end();
801
+ it != itEnd;
802
+ ++it ) {
803
+ if( it != errors.begin() )
804
+ oss << "\n";
805
+ oss << *it;
806
+ }
807
+ throw std::runtime_error( oss.str() );
808
+ }
809
+ return unusedTokens;
810
+ }
811
+ std::vector<Parser::Token> populateFixedArgs( std::vector<Parser::Token> const& tokens, ConfigT& config ) const {
812
+ std::vector<Parser::Token> unusedTokens;
813
+ int position = 1;
814
+ for( std::size_t i = 0; i < tokens.size(); ++i ) {
815
+ Parser::Token const& token = tokens[i];
816
+ typename std::map<int, Arg>::const_iterator it = m_positionalArgs.find( position );
817
+ if( it != m_positionalArgs.end() )
818
+ it->second.boundField.set( config, token.data );
819
+ else
820
+ unusedTokens.push_back( token );
821
+ if( token.type == Parser::Token::Positional )
822
+ position++;
823
+ }
824
+ return unusedTokens;
825
+ }
826
+ std::vector<Parser::Token> populateFloatingArgs( std::vector<Parser::Token> const& tokens, ConfigT& config ) const {
827
+ if( !m_floatingArg.get() )
828
+ return tokens;
829
+ std::vector<Parser::Token> unusedTokens;
830
+ for( std::size_t i = 0; i < tokens.size(); ++i ) {
831
+ Parser::Token const& token = tokens[i];
832
+ if( token.type == Parser::Token::Positional )
833
+ m_floatingArg->boundField.set( config, token.data );
834
+ else
835
+ unusedTokens.push_back( token );
836
+ }
837
+ return unusedTokens;
838
+ }
839
+
840
+ void validate() const
841
+ {
842
+ if( m_options.empty() && m_positionalArgs.empty() && !m_floatingArg.get() )
843
+ throw std::logic_error( "No options or arguments specified" );
844
+
845
+ for( typename std::vector<Arg>::const_iterator it = m_options.begin(),
846
+ itEnd = m_options.end();
847
+ it != itEnd; ++it )
848
+ it->validate();
849
+ }
850
+
851
+ private:
852
+ Detail::BoundArgFunction<ConfigT> m_boundProcessName;
853
+ std::vector<Arg> m_options;
854
+ std::map<int, Arg> m_positionalArgs;
855
+ ArgAutoPtr m_floatingArg;
856
+ int m_highestSpecifiedArgPosition;
857
+ bool m_throwOnUnrecognisedTokens;
858
+ };
859
+
860
+ } // end namespace Clara
861
+
862
+
863
+ STITCH_CLARA_CLOSE_NAMESPACE
864
+ #undef STITCH_CLARA_OPEN_NAMESPACE
865
+ #undef STITCH_CLARA_CLOSE_NAMESPACE
866
+
867
+
868
+ #endif // TWOBLUECUBES_CLARA_H_INCLUDED