rj_schema 0.2.4 → 1.0.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/ext/rj_schema/rapidjson/CHANGELOG.md +158 -0
- data/ext/rj_schema/rapidjson/CMakeLists.txt +248 -0
- data/ext/rj_schema/rapidjson/CMakeModules/FindGTestSrc.cmake +30 -0
- data/ext/rj_schema/rapidjson/RapidJSON.pc.in +7 -0
- data/ext/rj_schema/rapidjson/RapidJSONConfig.cmake.in +25 -0
- data/ext/rj_schema/rapidjson/RapidJSONConfigVersion.cmake.in +10 -0
- data/ext/rj_schema/rapidjson/appveyor.yml +102 -0
- data/ext/rj_schema/rapidjson/bin/data/abcde.txt +1 -0
- data/ext/rj_schema/rapidjson/bin/data/glossary.json +22 -0
- data/ext/rj_schema/rapidjson/bin/data/menu.json +27 -0
- data/ext/rj_schema/rapidjson/bin/data/readme.txt +1 -0
- data/ext/rj_schema/rapidjson/bin/data/sample.json +3315 -0
- data/ext/rj_schema/rapidjson/bin/data/webapp.json +88 -0
- data/ext/rj_schema/rapidjson/bin/data/widget.json +26 -0
- data/ext/rj_schema/rapidjson/bin/draft-04/schema +150 -0
- data/ext/rj_schema/rapidjson/bin/encodings/utf16be.json +0 -0
- data/ext/rj_schema/rapidjson/bin/encodings/utf16bebom.json +0 -0
- data/ext/rj_schema/rapidjson/bin/encodings/utf16le.json +0 -0
- data/ext/rj_schema/rapidjson/bin/encodings/utf16lebom.json +0 -0
- data/ext/rj_schema/rapidjson/bin/encodings/utf32be.json +0 -0
- data/ext/rj_schema/rapidjson/bin/encodings/utf32bebom.json +0 -0
- data/ext/rj_schema/rapidjson/bin/encodings/utf32le.json +0 -0
- data/ext/rj_schema/rapidjson/bin/encodings/utf32lebom.json +0 -0
- data/ext/rj_schema/rapidjson/bin/encodings/utf8.json +7 -0
- data/ext/rj_schema/rapidjson/bin/encodings/utf8bom.json +7 -0
- data/ext/rj_schema/rapidjson/bin/jsonchecker/fail1.json +1 -0
- data/ext/rj_schema/rapidjson/bin/jsonchecker/fail10.json +1 -0
- data/ext/rj_schema/rapidjson/bin/jsonchecker/fail11.json +1 -0
- data/ext/rj_schema/rapidjson/bin/jsonchecker/fail12.json +1 -0
- data/ext/rj_schema/rapidjson/bin/jsonchecker/fail13.json +1 -0
- data/ext/rj_schema/rapidjson/bin/jsonchecker/fail14.json +1 -0
- data/ext/rj_schema/rapidjson/bin/jsonchecker/fail15.json +1 -0
- data/ext/rj_schema/rapidjson/bin/jsonchecker/fail16.json +1 -0
- data/ext/rj_schema/rapidjson/bin/jsonchecker/fail17.json +1 -0
- data/ext/rj_schema/rapidjson/bin/jsonchecker/fail18.json +1 -0
- data/ext/rj_schema/rapidjson/bin/jsonchecker/fail19.json +1 -0
- data/ext/rj_schema/rapidjson/bin/jsonchecker/fail2.json +1 -0
- data/ext/rj_schema/rapidjson/bin/jsonchecker/fail20.json +1 -0
- data/ext/rj_schema/rapidjson/bin/jsonchecker/fail21.json +1 -0
- data/ext/rj_schema/rapidjson/bin/jsonchecker/fail22.json +1 -0
- data/ext/rj_schema/rapidjson/bin/jsonchecker/fail23.json +1 -0
- data/ext/rj_schema/rapidjson/bin/jsonchecker/fail24.json +1 -0
- data/ext/rj_schema/rapidjson/bin/jsonchecker/fail25.json +1 -0
- data/ext/rj_schema/rapidjson/bin/jsonchecker/fail26.json +1 -0
- data/ext/rj_schema/rapidjson/bin/jsonchecker/fail27.json +2 -0
- data/ext/rj_schema/rapidjson/bin/jsonchecker/fail28.json +2 -0
- data/ext/rj_schema/rapidjson/bin/jsonchecker/fail29.json +1 -0
- data/ext/rj_schema/rapidjson/bin/jsonchecker/fail3.json +1 -0
- data/ext/rj_schema/rapidjson/bin/jsonchecker/fail30.json +1 -0
- data/ext/rj_schema/rapidjson/bin/jsonchecker/fail31.json +1 -0
- data/ext/rj_schema/rapidjson/bin/jsonchecker/fail32.json +1 -0
- data/ext/rj_schema/rapidjson/bin/jsonchecker/fail33.json +1 -0
- data/ext/rj_schema/rapidjson/bin/jsonchecker/fail4.json +1 -0
- data/ext/rj_schema/rapidjson/bin/jsonchecker/fail5.json +1 -0
- data/ext/rj_schema/rapidjson/bin/jsonchecker/fail6.json +1 -0
- data/ext/rj_schema/rapidjson/bin/jsonchecker/fail7.json +1 -0
- data/ext/rj_schema/rapidjson/bin/jsonchecker/fail8.json +1 -0
- data/ext/rj_schema/rapidjson/bin/jsonchecker/fail9.json +1 -0
- data/ext/rj_schema/rapidjson/bin/jsonchecker/pass1.json +58 -0
- data/ext/rj_schema/rapidjson/bin/jsonchecker/pass2.json +1 -0
- data/ext/rj_schema/rapidjson/bin/jsonchecker/pass3.json +6 -0
- data/ext/rj_schema/rapidjson/bin/jsonchecker/readme.txt +3 -0
- data/ext/rj_schema/rapidjson/bin/jsonschema/LICENSE +19 -0
- data/ext/rj_schema/rapidjson/bin/jsonschema/README.md +148 -0
- data/ext/rj_schema/rapidjson/bin/jsonschema/bin/jsonschema_suite +283 -0
- data/ext/rj_schema/rapidjson/bin/jsonschema/remotes/folder/folderInteger.json +3 -0
- data/ext/rj_schema/rapidjson/bin/jsonschema/remotes/integer.json +3 -0
- data/ext/rj_schema/rapidjson/bin/jsonschema/remotes/subSchemas.json +8 -0
- data/ext/rj_schema/rapidjson/bin/jsonschema/tests/draft3/additionalItems.json +82 -0
- data/ext/rj_schema/rapidjson/bin/jsonschema/tests/draft3/additionalProperties.json +88 -0
- data/ext/rj_schema/rapidjson/bin/jsonschema/tests/draft3/default.json +49 -0
- data/ext/rj_schema/rapidjson/bin/jsonschema/tests/draft3/dependencies.json +108 -0
- data/ext/rj_schema/rapidjson/bin/jsonschema/tests/draft3/disallow.json +80 -0
- data/ext/rj_schema/rapidjson/bin/jsonschema/tests/draft3/divisibleBy.json +60 -0
- data/ext/rj_schema/rapidjson/bin/jsonschema/tests/draft3/enum.json +71 -0
- data/ext/rj_schema/rapidjson/bin/jsonschema/tests/draft3/extends.json +94 -0
- data/ext/rj_schema/rapidjson/bin/jsonschema/tests/draft3/items.json +46 -0
- data/ext/rj_schema/rapidjson/bin/jsonschema/tests/draft3/maxItems.json +28 -0
- data/ext/rj_schema/rapidjson/bin/jsonschema/tests/draft3/maxLength.json +33 -0
- data/ext/rj_schema/rapidjson/bin/jsonschema/tests/draft3/maximum.json +42 -0
- data/ext/rj_schema/rapidjson/bin/jsonschema/tests/draft3/minItems.json +28 -0
- data/ext/rj_schema/rapidjson/bin/jsonschema/tests/draft3/minLength.json +33 -0
- data/ext/rj_schema/rapidjson/bin/jsonschema/tests/draft3/minimum.json +42 -0
- data/ext/rj_schema/rapidjson/bin/jsonschema/tests/draft3/optional/bignum.json +107 -0
- data/ext/rj_schema/rapidjson/bin/jsonschema/tests/draft3/optional/format.json +222 -0
- data/ext/rj_schema/rapidjson/bin/jsonschema/tests/draft3/optional/jsregex.json +18 -0
- data/ext/rj_schema/rapidjson/bin/jsonschema/tests/draft3/optional/zeroTerminatedFloats.json +15 -0
- data/ext/rj_schema/rapidjson/bin/jsonschema/tests/draft3/pattern.json +34 -0
- data/ext/rj_schema/rapidjson/bin/jsonschema/tests/draft3/patternProperties.json +110 -0
- data/ext/rj_schema/rapidjson/bin/jsonschema/tests/draft3/properties.json +92 -0
- data/ext/rj_schema/rapidjson/bin/jsonschema/tests/draft3/ref.json +159 -0
- data/ext/rj_schema/rapidjson/bin/jsonschema/tests/draft3/refRemote.json +74 -0
- data/ext/rj_schema/rapidjson/bin/jsonschema/tests/draft3/required.json +53 -0
- data/ext/rj_schema/rapidjson/bin/jsonschema/tests/draft3/type.json +474 -0
- data/ext/rj_schema/rapidjson/bin/jsonschema/tests/draft3/uniqueItems.json +79 -0
- data/ext/rj_schema/rapidjson/bin/jsonschema/tests/draft4/additionalItems.json +82 -0
- data/ext/rj_schema/rapidjson/bin/jsonschema/tests/draft4/additionalProperties.json +88 -0
- data/ext/rj_schema/rapidjson/bin/jsonschema/tests/draft4/allOf.json +112 -0
- data/ext/rj_schema/rapidjson/bin/jsonschema/tests/draft4/anyOf.json +68 -0
- data/ext/rj_schema/rapidjson/bin/jsonschema/tests/draft4/default.json +49 -0
- data/ext/rj_schema/rapidjson/bin/jsonschema/tests/draft4/definitions.json +32 -0
- data/ext/rj_schema/rapidjson/bin/jsonschema/tests/draft4/dependencies.json +113 -0
- data/ext/rj_schema/rapidjson/bin/jsonschema/tests/draft4/enum.json +72 -0
- data/ext/rj_schema/rapidjson/bin/jsonschema/tests/draft4/items.json +46 -0
- data/ext/rj_schema/rapidjson/bin/jsonschema/tests/draft4/maxItems.json +28 -0
- data/ext/rj_schema/rapidjson/bin/jsonschema/tests/draft4/maxLength.json +33 -0
- data/ext/rj_schema/rapidjson/bin/jsonschema/tests/draft4/maxProperties.json +28 -0
- data/ext/rj_schema/rapidjson/bin/jsonschema/tests/draft4/maximum.json +42 -0
- data/ext/rj_schema/rapidjson/bin/jsonschema/tests/draft4/minItems.json +28 -0
- data/ext/rj_schema/rapidjson/bin/jsonschema/tests/draft4/minLength.json +33 -0
- data/ext/rj_schema/rapidjson/bin/jsonschema/tests/draft4/minProperties.json +28 -0
- data/ext/rj_schema/rapidjson/bin/jsonschema/tests/draft4/minimum.json +42 -0
- data/ext/rj_schema/rapidjson/bin/jsonschema/tests/draft4/multipleOf.json +60 -0
- data/ext/rj_schema/rapidjson/bin/jsonschema/tests/draft4/not.json +96 -0
- data/ext/rj_schema/rapidjson/bin/jsonschema/tests/draft4/oneOf.json +68 -0
- data/ext/rj_schema/rapidjson/bin/jsonschema/tests/draft4/optional/bignum.json +107 -0
- data/ext/rj_schema/rapidjson/bin/jsonschema/tests/draft4/optional/format.json +148 -0
- data/ext/rj_schema/rapidjson/bin/jsonschema/tests/draft4/optional/zeroTerminatedFloats.json +15 -0
- data/ext/rj_schema/rapidjson/bin/jsonschema/tests/draft4/pattern.json +34 -0
- data/ext/rj_schema/rapidjson/bin/jsonschema/tests/draft4/patternProperties.json +110 -0
- data/ext/rj_schema/rapidjson/bin/jsonschema/tests/draft4/properties.json +92 -0
- data/ext/rj_schema/rapidjson/bin/jsonschema/tests/draft4/ref.json +159 -0
- data/ext/rj_schema/rapidjson/bin/jsonschema/tests/draft4/refRemote.json +74 -0
- data/ext/rj_schema/rapidjson/bin/jsonschema/tests/draft4/required.json +39 -0
- data/ext/rj_schema/rapidjson/bin/jsonschema/tests/draft4/type.json +330 -0
- data/ext/rj_schema/rapidjson/bin/jsonschema/tests/draft4/uniqueItems.json +79 -0
- data/ext/rj_schema/rapidjson/bin/jsonschema/tox.ini +8 -0
- data/ext/rj_schema/rapidjson/bin/types/alotofkeys.json +502 -0
- data/ext/rj_schema/rapidjson/bin/types/booleans.json +102 -0
- data/ext/rj_schema/rapidjson/bin/types/floats.json +102 -0
- data/ext/rj_schema/rapidjson/bin/types/guids.json +102 -0
- data/ext/rj_schema/rapidjson/bin/types/integers.json +102 -0
- data/ext/rj_schema/rapidjson/bin/types/mixed.json +592 -0
- data/ext/rj_schema/rapidjson/bin/types/nulls.json +102 -0
- data/ext/rj_schema/rapidjson/bin/types/paragraphs.json +102 -0
- data/ext/rj_schema/rapidjson/bin/types/readme.txt +1 -0
- data/ext/rj_schema/rapidjson/bin/unittestschema/address.json +139 -0
- data/ext/rj_schema/rapidjson/bin/unittestschema/allOf_address.json +7 -0
- data/ext/rj_schema/rapidjson/bin/unittestschema/anyOf_address.json +7 -0
- data/ext/rj_schema/rapidjson/bin/unittestschema/idandref.json +69 -0
- data/ext/rj_schema/rapidjson/bin/unittestschema/oneOf_address.json +7 -0
- data/ext/rj_schema/rapidjson/contrib/natvis/LICENSE +45 -0
- data/ext/rj_schema/rapidjson/contrib/natvis/README.md +7 -0
- data/ext/rj_schema/rapidjson/contrib/natvis/rapidjson.natvis +38 -0
- data/ext/rj_schema/rapidjson/doc/CMakeLists.txt +27 -0
- data/ext/rj_schema/rapidjson/doc/Doxyfile.in +2369 -0
- data/ext/rj_schema/rapidjson/doc/Doxyfile.zh-cn.in +2369 -0
- data/ext/rj_schema/rapidjson/doc/diagram/architecture.dot +50 -0
- data/ext/rj_schema/rapidjson/doc/diagram/architecture.png +0 -0
- data/ext/rj_schema/rapidjson/doc/diagram/insituparsing.dot +65 -0
- data/ext/rj_schema/rapidjson/doc/diagram/insituparsing.png +0 -0
- data/ext/rj_schema/rapidjson/doc/diagram/iterative-parser-states-diagram.dot +62 -0
- data/ext/rj_schema/rapidjson/doc/diagram/iterative-parser-states-diagram.png +0 -0
- data/ext/rj_schema/rapidjson/doc/diagram/makefile +8 -0
- data/ext/rj_schema/rapidjson/doc/diagram/move1.dot +47 -0
- data/ext/rj_schema/rapidjson/doc/diagram/move1.png +0 -0
- data/ext/rj_schema/rapidjson/doc/diagram/move2.dot +62 -0
- data/ext/rj_schema/rapidjson/doc/diagram/move2.png +0 -0
- data/ext/rj_schema/rapidjson/doc/diagram/move3.dot +60 -0
- data/ext/rj_schema/rapidjson/doc/diagram/move3.png +0 -0
- data/ext/rj_schema/rapidjson/doc/diagram/normalparsing.dot +56 -0
- data/ext/rj_schema/rapidjson/doc/diagram/normalparsing.png +0 -0
- data/ext/rj_schema/rapidjson/doc/diagram/simpledom.dot +54 -0
- data/ext/rj_schema/rapidjson/doc/diagram/simpledom.png +0 -0
- data/ext/rj_schema/rapidjson/doc/diagram/tutorial.dot +58 -0
- data/ext/rj_schema/rapidjson/doc/diagram/tutorial.png +0 -0
- data/ext/rj_schema/rapidjson/doc/diagram/utilityclass.dot +73 -0
- data/ext/rj_schema/rapidjson/doc/diagram/utilityclass.png +0 -0
- data/ext/rj_schema/rapidjson/doc/dom.md +281 -0
- data/ext/rj_schema/rapidjson/doc/dom.zh-cn.md +285 -0
- data/ext/rj_schema/rapidjson/doc/encoding.md +146 -0
- data/ext/rj_schema/rapidjson/doc/encoding.zh-cn.md +152 -0
- data/ext/rj_schema/rapidjson/doc/faq.md +289 -0
- data/ext/rj_schema/rapidjson/doc/faq.zh-cn.md +290 -0
- data/ext/rj_schema/rapidjson/doc/features.md +104 -0
- data/ext/rj_schema/rapidjson/doc/features.zh-cn.md +103 -0
- data/ext/rj_schema/rapidjson/doc/internals.md +368 -0
- data/ext/rj_schema/rapidjson/doc/internals.zh-cn.md +363 -0
- data/ext/rj_schema/rapidjson/doc/logo/rapidjson.png +0 -0
- data/ext/rj_schema/rapidjson/doc/logo/rapidjson.svg +119 -0
- data/ext/rj_schema/rapidjson/doc/misc/DoxygenLayout.xml +194 -0
- data/ext/rj_schema/rapidjson/doc/misc/doxygenextra.css +274 -0
- data/ext/rj_schema/rapidjson/doc/misc/footer.html +11 -0
- data/ext/rj_schema/rapidjson/doc/misc/header.html +24 -0
- data/ext/rj_schema/rapidjson/doc/npm.md +31 -0
- data/ext/rj_schema/rapidjson/doc/performance.md +26 -0
- data/ext/rj_schema/rapidjson/doc/performance.zh-cn.md +26 -0
- data/ext/rj_schema/rapidjson/doc/pointer.md +234 -0
- data/ext/rj_schema/rapidjson/doc/pointer.zh-cn.md +234 -0
- data/ext/rj_schema/rapidjson/doc/sax.md +509 -0
- data/ext/rj_schema/rapidjson/doc/sax.zh-cn.md +487 -0
- data/ext/rj_schema/rapidjson/doc/schema.md +505 -0
- data/ext/rj_schema/rapidjson/doc/schema.zh-cn.md +237 -0
- data/ext/rj_schema/rapidjson/doc/stream.md +429 -0
- data/ext/rj_schema/rapidjson/doc/stream.zh-cn.md +429 -0
- data/ext/rj_schema/rapidjson/doc/tutorial.md +536 -0
- data/ext/rj_schema/rapidjson/doc/tutorial.zh-cn.md +535 -0
- data/ext/rj_schema/rapidjson/docker/debian/Dockerfile +8 -0
- data/ext/rj_schema/rapidjson/example/CMakeLists.txt +46 -0
- data/ext/rj_schema/rapidjson/example/archiver/archiver.cpp +292 -0
- data/ext/rj_schema/rapidjson/example/archiver/archiver.h +145 -0
- data/ext/rj_schema/rapidjson/example/archiver/archivertest.cpp +287 -0
- data/ext/rj_schema/rapidjson/example/capitalize/capitalize.cpp +67 -0
- data/ext/rj_schema/rapidjson/example/condense/condense.cpp +32 -0
- data/ext/rj_schema/rapidjson/example/filterkey/filterkey.cpp +135 -0
- data/ext/rj_schema/rapidjson/example/filterkeydom/filterkeydom.cpp +170 -0
- data/ext/rj_schema/rapidjson/example/jsonx/jsonx.cpp +207 -0
- data/ext/rj_schema/rapidjson/example/lookaheadparser/lookaheadparser.cpp +350 -0
- data/ext/rj_schema/rapidjson/example/messagereader/messagereader.cpp +105 -0
- data/ext/rj_schema/rapidjson/example/parsebyparts/parsebyparts.cpp +176 -0
- data/ext/rj_schema/rapidjson/example/pretty/pretty.cpp +30 -0
- data/ext/rj_schema/rapidjson/example/prettyauto/prettyauto.cpp +56 -0
- data/ext/rj_schema/rapidjson/example/schemavalidator/schemavalidator.cpp +198 -0
- data/ext/rj_schema/rapidjson/example/serialize/serialize.cpp +173 -0
- data/ext/rj_schema/rapidjson/example/simpledom/simpledom.cpp +29 -0
- data/ext/rj_schema/rapidjson/example/simplepullreader/simplepullreader.cpp +53 -0
- data/ext/rj_schema/rapidjson/example/simplereader/simplereader.cpp +42 -0
- data/ext/rj_schema/rapidjson/example/simplewriter/simplewriter.cpp +36 -0
- data/ext/rj_schema/rapidjson/example/sortkeys/sortkeys.cpp +62 -0
- data/ext/rj_schema/rapidjson/example/traverseaspointer.cpp +39 -0
- data/ext/rj_schema/rapidjson/example/tutorial/tutorial.cpp +151 -0
- data/ext/rj_schema/rapidjson/include/rapidjson/allocators.h +692 -0
- data/ext/rj_schema/rapidjson/include/rapidjson/cursorstreamwrapper.h +78 -0
- data/ext/rj_schema/rapidjson/include/rapidjson/document.h +3027 -0
- data/ext/rj_schema/rapidjson/include/rapidjson/encodedstream.h +299 -0
- data/ext/rj_schema/rapidjson/include/rapidjson/encodings.h +716 -0
- data/ext/rj_schema/rapidjson/include/rapidjson/error/en.h +122 -0
- data/ext/rj_schema/rapidjson/include/rapidjson/error/error.h +216 -0
- data/ext/rj_schema/rapidjson/include/rapidjson/filereadstream.h +99 -0
- data/ext/rj_schema/rapidjson/include/rapidjson/filewritestream.h +104 -0
- data/ext/rj_schema/rapidjson/include/rapidjson/fwd.h +151 -0
- data/ext/rj_schema/rapidjson/include/rapidjson/internal/biginteger.h +290 -0
- data/ext/rj_schema/rapidjson/include/rapidjson/internal/clzll.h +71 -0
- data/ext/rj_schema/rapidjson/include/rapidjson/internal/diyfp.h +257 -0
- data/ext/rj_schema/rapidjson/include/rapidjson/internal/dtoa.h +245 -0
- data/ext/rj_schema/rapidjson/include/rapidjson/internal/ieee754.h +78 -0
- data/ext/rj_schema/rapidjson/include/rapidjson/internal/itoa.h +308 -0
- data/ext/rj_schema/rapidjson/include/rapidjson/internal/meta.h +186 -0
- data/ext/rj_schema/rapidjson/include/rapidjson/internal/pow10.h +55 -0
- data/ext/rj_schema/rapidjson/include/rapidjson/internal/regex.h +739 -0
- data/ext/rj_schema/rapidjson/include/rapidjson/internal/stack.h +232 -0
- data/ext/rj_schema/rapidjson/include/rapidjson/internal/strfunc.h +83 -0
- data/ext/rj_schema/rapidjson/include/rapidjson/internal/strtod.h +290 -0
- data/ext/rj_schema/rapidjson/include/rapidjson/internal/swap.h +46 -0
- data/ext/rj_schema/rapidjson/include/rapidjson/istreamwrapper.h +128 -0
- data/ext/rj_schema/rapidjson/include/rapidjson/memorybuffer.h +70 -0
- data/ext/rj_schema/rapidjson/include/rapidjson/memorystream.h +71 -0
- data/ext/rj_schema/rapidjson/include/rapidjson/msinttypes/inttypes.h +316 -0
- data/ext/rj_schema/rapidjson/include/rapidjson/msinttypes/stdint.h +300 -0
- data/ext/rj_schema/rapidjson/include/rapidjson/ostreamwrapper.h +81 -0
- data/ext/rj_schema/rapidjson/include/rapidjson/pointer.h +1482 -0
- data/ext/rj_schema/rapidjson/include/rapidjson/prettywriter.h +277 -0
- data/ext/rj_schema/rapidjson/include/rapidjson/rapidjson.h +741 -0
- data/ext/rj_schema/rapidjson/include/rapidjson/reader.h +2244 -0
- data/ext/rj_schema/rapidjson/include/rapidjson/schema.h +2795 -0
- data/ext/rj_schema/rapidjson/include/rapidjson/stream.h +223 -0
- data/ext/rj_schema/rapidjson/include/rapidjson/stringbuffer.h +121 -0
- data/ext/rj_schema/rapidjson/include/rapidjson/uri.h +466 -0
- data/ext/rj_schema/rapidjson/include/rapidjson/writer.h +710 -0
- data/ext/rj_schema/rapidjson/include_dirs.js +2 -0
- data/ext/rj_schema/rapidjson/library.json +15 -0
- data/ext/rj_schema/rapidjson/license.txt +57 -0
- data/ext/rj_schema/rapidjson/package.json +24 -0
- data/ext/rj_schema/rapidjson/rapidjson.autopkg +77 -0
- data/ext/rj_schema/rapidjson/readme.md +210 -0
- data/ext/rj_schema/rapidjson/readme.zh-cn.md +152 -0
- data/ext/rj_schema/rapidjson/test/CMakeLists.txt +20 -0
- data/ext/rj_schema/rapidjson/test/perftest/CMakeLists.txt +28 -0
- data/ext/rj_schema/rapidjson/test/perftest/misctest.cpp +974 -0
- data/ext/rj_schema/rapidjson/test/perftest/perftest.cpp +24 -0
- data/ext/rj_schema/rapidjson/test/perftest/perftest.h +186 -0
- data/ext/rj_schema/rapidjson/test/perftest/platformtest.cpp +166 -0
- data/ext/rj_schema/rapidjson/test/perftest/rapidjsontest.cpp +564 -0
- data/ext/rj_schema/rapidjson/test/perftest/schematest.cpp +223 -0
- data/ext/rj_schema/rapidjson/test/unittest/CMakeLists.txt +95 -0
- data/ext/rj_schema/rapidjson/test/unittest/allocatorstest.cpp +292 -0
- data/ext/rj_schema/rapidjson/test/unittest/bigintegertest.cpp +138 -0
- data/ext/rj_schema/rapidjson/test/unittest/clzlltest.cpp +34 -0
- data/ext/rj_schema/rapidjson/test/unittest/cursorstreamwrappertest.cpp +115 -0
- data/ext/rj_schema/rapidjson/test/unittest/documenttest.cpp +674 -0
- data/ext/rj_schema/rapidjson/test/unittest/dtoatest.cpp +98 -0
- data/ext/rj_schema/rapidjson/test/unittest/encodedstreamtest.cpp +313 -0
- data/ext/rj_schema/rapidjson/test/unittest/encodingstest.cpp +451 -0
- data/ext/rj_schema/rapidjson/test/unittest/filestreamtest.cpp +155 -0
- data/ext/rj_schema/rapidjson/test/unittest/fwdtest.cpp +230 -0
- data/ext/rj_schema/rapidjson/test/unittest/istreamwrappertest.cpp +181 -0
- data/ext/rj_schema/rapidjson/test/unittest/itoatest.cpp +160 -0
- data/ext/rj_schema/rapidjson/test/unittest/jsoncheckertest.cpp +143 -0
- data/ext/rj_schema/rapidjson/test/unittest/namespacetest.cpp +70 -0
- data/ext/rj_schema/rapidjson/test/unittest/ostreamwrappertest.cpp +92 -0
- data/ext/rj_schema/rapidjson/test/unittest/platformtest.cpp +40 -0
- data/ext/rj_schema/rapidjson/test/unittest/pointertest.cpp +1730 -0
- data/ext/rj_schema/rapidjson/test/unittest/prettywritertest.cpp +373 -0
- data/ext/rj_schema/rapidjson/test/unittest/readertest.cpp +2228 -0
- data/ext/rj_schema/rapidjson/test/unittest/regextest.cpp +639 -0
- data/ext/rj_schema/rapidjson/test/unittest/schematest.cpp +2952 -0
- data/ext/rj_schema/rapidjson/test/unittest/simdtest.cpp +219 -0
- data/ext/rj_schema/rapidjson/test/unittest/strfunctest.cpp +30 -0
- data/ext/rj_schema/rapidjson/test/unittest/stringbuffertest.cpp +192 -0
- data/ext/rj_schema/rapidjson/test/unittest/strtodtest.cpp +132 -0
- data/ext/rj_schema/rapidjson/test/unittest/unittest.cpp +51 -0
- data/ext/rj_schema/rapidjson/test/unittest/unittest.h +143 -0
- data/ext/rj_schema/rapidjson/test/unittest/uritest.cpp +718 -0
- data/ext/rj_schema/rapidjson/test/unittest/valuetest.cpp +1861 -0
- data/ext/rj_schema/rapidjson/test/unittest/writertest.cpp +598 -0
- data/ext/rj_schema/rapidjson/test/valgrind.supp +17 -0
- data/ext/rj_schema/rapidjson/thirdparty/gtest/BUILD.bazel +175 -0
- data/ext/rj_schema/rapidjson/thirdparty/gtest/CMakeLists.txt +33 -0
- data/ext/rj_schema/rapidjson/thirdparty/gtest/CONTRIBUTING.md +160 -0
- data/ext/rj_schema/rapidjson/thirdparty/gtest/LICENSE +28 -0
- data/ext/rj_schema/rapidjson/thirdparty/gtest/Makefile.am +14 -0
- data/ext/rj_schema/rapidjson/thirdparty/gtest/README.md +122 -0
- data/ext/rj_schema/rapidjson/thirdparty/gtest/WORKSPACE +8 -0
- data/ext/rj_schema/rapidjson/thirdparty/gtest/appveyor.yml +104 -0
- data/ext/rj_schema/rapidjson/thirdparty/gtest/ci/build-linux-autotools.sh +44 -0
- data/ext/rj_schema/rapidjson/thirdparty/gtest/ci/build-linux-bazel.sh +36 -0
- data/ext/rj_schema/rapidjson/thirdparty/gtest/ci/env-linux.sh +41 -0
- data/ext/rj_schema/rapidjson/thirdparty/gtest/ci/env-osx.sh +40 -0
- data/ext/rj_schema/rapidjson/thirdparty/gtest/ci/get-nprocessors.sh +48 -0
- data/ext/rj_schema/rapidjson/thirdparty/gtest/ci/install-linux.sh +49 -0
- data/ext/rj_schema/rapidjson/thirdparty/gtest/ci/install-osx.sh +39 -0
- data/ext/rj_schema/rapidjson/thirdparty/gtest/ci/log-config.sh +51 -0
- data/ext/rj_schema/rapidjson/thirdparty/gtest/ci/travis.sh +44 -0
- data/ext/rj_schema/rapidjson/thirdparty/gtest/configure.ac +16 -0
- data/ext/rj_schema/rapidjson/thirdparty/gtest/googlemock/CHANGES +126 -0
- data/ext/rj_schema/rapidjson/thirdparty/gtest/googlemock/CMakeLists.txt +242 -0
- data/ext/rj_schema/rapidjson/thirdparty/gtest/googlemock/CONTRIBUTORS +40 -0
- data/ext/rj_schema/rapidjson/thirdparty/gtest/googlemock/LICENSE +28 -0
- data/ext/rj_schema/rapidjson/thirdparty/gtest/googlemock/Makefile.am +224 -0
- data/ext/rj_schema/rapidjson/thirdparty/gtest/googlemock/README.md +344 -0
- data/ext/rj_schema/rapidjson/thirdparty/gtest/googlemock/cmake/gmock.pc.in +9 -0
- data/ext/rj_schema/rapidjson/thirdparty/gtest/googlemock/cmake/gmock_main.pc.in +9 -0
- data/ext/rj_schema/rapidjson/thirdparty/gtest/googlemock/configure.ac +146 -0
- data/ext/rj_schema/rapidjson/thirdparty/gtest/googlemock/docs/CheatSheet.md +564 -0
- data/ext/rj_schema/rapidjson/thirdparty/gtest/googlemock/docs/CookBook.md +3660 -0
- data/ext/rj_schema/rapidjson/thirdparty/gtest/googlemock/docs/DesignDoc.md +280 -0
- data/ext/rj_schema/rapidjson/thirdparty/gtest/googlemock/docs/Documentation.md +15 -0
- data/ext/rj_schema/rapidjson/thirdparty/gtest/googlemock/docs/ForDummies.md +447 -0
- data/ext/rj_schema/rapidjson/thirdparty/gtest/googlemock/docs/FrequentlyAskedQuestions.md +627 -0
- data/ext/rj_schema/rapidjson/thirdparty/gtest/googlemock/docs/KnownIssues.md +19 -0
- data/ext/rj_schema/rapidjson/thirdparty/gtest/googlemock/include/gmock/gmock-actions.h +1262 -0
- data/ext/rj_schema/rapidjson/thirdparty/gtest/googlemock/include/gmock/gmock-cardinalities.h +147 -0
- data/ext/rj_schema/rapidjson/thirdparty/gtest/googlemock/include/gmock/gmock-generated-actions.h +2571 -0
- data/ext/rj_schema/rapidjson/thirdparty/gtest/googlemock/include/gmock/gmock-generated-actions.h.pump +833 -0
- data/ext/rj_schema/rapidjson/thirdparty/gtest/googlemock/include/gmock/gmock-generated-function-mockers.h +1379 -0
- data/ext/rj_schema/rapidjson/thirdparty/gtest/googlemock/include/gmock/gmock-generated-function-mockers.h.pump +347 -0
- data/ext/rj_schema/rapidjson/thirdparty/gtest/googlemock/include/gmock/gmock-generated-matchers.h +2258 -0
- data/ext/rj_schema/rapidjson/thirdparty/gtest/googlemock/include/gmock/gmock-generated-matchers.h.pump +675 -0
- data/ext/rj_schema/rapidjson/thirdparty/gtest/googlemock/include/gmock/gmock-generated-nice-strict.h +458 -0
- data/ext/rj_schema/rapidjson/thirdparty/gtest/googlemock/include/gmock/gmock-generated-nice-strict.h.pump +178 -0
- data/ext/rj_schema/rapidjson/thirdparty/gtest/googlemock/include/gmock/gmock-matchers.h +5255 -0
- data/ext/rj_schema/rapidjson/thirdparty/gtest/googlemock/include/gmock/gmock-more-actions.h +246 -0
- data/ext/rj_schema/rapidjson/thirdparty/gtest/googlemock/include/gmock/gmock-more-matchers.h +91 -0
- data/ext/rj_schema/rapidjson/thirdparty/gtest/googlemock/include/gmock/gmock-spec-builders.h +1918 -0
- data/ext/rj_schema/rapidjson/thirdparty/gtest/googlemock/include/gmock/gmock.h +95 -0
- data/ext/rj_schema/rapidjson/thirdparty/gtest/googlemock/include/gmock/internal/custom/gmock-generated-actions.h +8 -0
- data/ext/rj_schema/rapidjson/thirdparty/gtest/googlemock/include/gmock/internal/custom/gmock-generated-actions.h.pump +10 -0
- data/ext/rj_schema/rapidjson/thirdparty/gtest/googlemock/include/gmock/internal/custom/gmock-matchers.h +38 -0
- data/ext/rj_schema/rapidjson/thirdparty/gtest/googlemock/include/gmock/internal/custom/gmock-port.h +46 -0
- data/ext/rj_schema/rapidjson/thirdparty/gtest/googlemock/include/gmock/internal/gmock-generated-internal-utils.h +286 -0
- data/ext/rj_schema/rapidjson/thirdparty/gtest/googlemock/include/gmock/internal/gmock-generated-internal-utils.h.pump +136 -0
- data/ext/rj_schema/rapidjson/thirdparty/gtest/googlemock/include/gmock/internal/gmock-internal-utils.h +574 -0
- data/ext/rj_schema/rapidjson/thirdparty/gtest/googlemock/include/gmock/internal/gmock-port.h +87 -0
- data/ext/rj_schema/rapidjson/thirdparty/gtest/googlemock/make/Makefile +101 -0
- data/ext/rj_schema/rapidjson/thirdparty/gtest/googlemock/msvc/2005/gmock.sln +32 -0
- data/ext/rj_schema/rapidjson/thirdparty/gtest/googlemock/msvc/2005/gmock.vcproj +191 -0
- data/ext/rj_schema/rapidjson/thirdparty/gtest/googlemock/msvc/2005/gmock_config.vsprops +15 -0
- data/ext/rj_schema/rapidjson/thirdparty/gtest/googlemock/msvc/2005/gmock_main.vcproj +187 -0
- data/ext/rj_schema/rapidjson/thirdparty/gtest/googlemock/msvc/2005/gmock_test.vcproj +201 -0
- data/ext/rj_schema/rapidjson/thirdparty/gtest/googlemock/msvc/2010/gmock.sln +46 -0
- data/ext/rj_schema/rapidjson/thirdparty/gtest/googlemock/msvc/2010/gmock.vcxproj +145 -0
- data/ext/rj_schema/rapidjson/thirdparty/gtest/googlemock/msvc/2010/gmock_config.props +19 -0
- data/ext/rj_schema/rapidjson/thirdparty/gtest/googlemock/msvc/2010/gmock_main.vcxproj +151 -0
- data/ext/rj_schema/rapidjson/thirdparty/gtest/googlemock/msvc/2010/gmock_test.vcxproj +176 -0
- data/ext/rj_schema/rapidjson/thirdparty/gtest/googlemock/msvc/2015/gmock.sln +46 -0
- data/ext/rj_schema/rapidjson/thirdparty/gtest/googlemock/msvc/2015/gmock.vcxproj +145 -0
- data/ext/rj_schema/rapidjson/thirdparty/gtest/googlemock/msvc/2015/gmock_config.props +19 -0
- data/ext/rj_schema/rapidjson/thirdparty/gtest/googlemock/msvc/2015/gmock_main.vcxproj +151 -0
- data/ext/rj_schema/rapidjson/thirdparty/gtest/googlemock/msvc/2015/gmock_test.vcxproj +176 -0
- data/ext/rj_schema/rapidjson/thirdparty/gtest/googlemock/scripts/fuse_gmock_files.py +240 -0
- data/ext/rj_schema/rapidjson/thirdparty/gtest/googlemock/scripts/generator/LICENSE +203 -0
- data/ext/rj_schema/rapidjson/thirdparty/gtest/googlemock/scripts/generator/README +34 -0
- data/ext/rj_schema/rapidjson/thirdparty/gtest/googlemock/scripts/generator/README.cppclean +115 -0
- data/ext/rj_schema/rapidjson/thirdparty/gtest/googlemock/scripts/generator/cpp/__init__.py +0 -0
- data/ext/rj_schema/rapidjson/thirdparty/gtest/googlemock/scripts/generator/cpp/ast.py +1733 -0
- data/ext/rj_schema/rapidjson/thirdparty/gtest/googlemock/scripts/generator/cpp/gmock_class.py +227 -0
- data/ext/rj_schema/rapidjson/thirdparty/gtest/googlemock/scripts/generator/cpp/gmock_class_test.py +448 -0
- data/ext/rj_schema/rapidjson/thirdparty/gtest/googlemock/scripts/generator/cpp/keywords.py +59 -0
- data/ext/rj_schema/rapidjson/thirdparty/gtest/googlemock/scripts/generator/cpp/tokenize.py +287 -0
- data/ext/rj_schema/rapidjson/thirdparty/gtest/googlemock/scripts/generator/cpp/utils.py +41 -0
- data/ext/rj_schema/rapidjson/thirdparty/gtest/googlemock/scripts/generator/gmock_gen.py +31 -0
- data/ext/rj_schema/rapidjson/thirdparty/gtest/googlemock/scripts/gmock-config.in +303 -0
- data/ext/rj_schema/rapidjson/thirdparty/gtest/googlemock/scripts/gmock_doctor.py +640 -0
- data/ext/rj_schema/rapidjson/thirdparty/gtest/googlemock/scripts/upload.py +1387 -0
- data/ext/rj_schema/rapidjson/thirdparty/gtest/googlemock/scripts/upload_gmock.py +78 -0
- data/ext/rj_schema/rapidjson/thirdparty/gtest/googlemock/src/gmock-all.cc +47 -0
- data/ext/rj_schema/rapidjson/thirdparty/gtest/googlemock/src/gmock-cardinalities.cc +156 -0
- data/ext/rj_schema/rapidjson/thirdparty/gtest/googlemock/src/gmock-internal-utils.cc +204 -0
- data/ext/rj_schema/rapidjson/thirdparty/gtest/googlemock/src/gmock-matchers.cc +573 -0
- data/ext/rj_schema/rapidjson/thirdparty/gtest/googlemock/src/gmock-spec-builders.cc +883 -0
- data/ext/rj_schema/rapidjson/thirdparty/gtest/googlemock/src/gmock.cc +205 -0
- data/ext/rj_schema/rapidjson/thirdparty/gtest/googlemock/src/gmock_main.cc +54 -0
- data/ext/rj_schema/rapidjson/thirdparty/gtest/googlemock/test/BUILD.bazel +123 -0
- data/ext/rj_schema/rapidjson/thirdparty/gtest/googlemock/test/gmock-actions_test.cc +1575 -0
- data/ext/rj_schema/rapidjson/thirdparty/gtest/googlemock/test/gmock-cardinalities_test.cc +428 -0
- data/ext/rj_schema/rapidjson/thirdparty/gtest/googlemock/test/gmock-generated-actions_test.cc +1230 -0
- data/ext/rj_schema/rapidjson/thirdparty/gtest/googlemock/test/gmock-generated-function-mockers_test.cc +647 -0
- data/ext/rj_schema/rapidjson/thirdparty/gtest/googlemock/test/gmock-generated-internal-utils_test.cc +129 -0
- data/ext/rj_schema/rapidjson/thirdparty/gtest/googlemock/test/gmock-generated-matchers_test.cc +1341 -0
- data/ext/rj_schema/rapidjson/thirdparty/gtest/googlemock/test/gmock-internal-utils_test.cc +718 -0
- data/ext/rj_schema/rapidjson/thirdparty/gtest/googlemock/test/gmock-matchers_test.cc +6767 -0
- data/ext/rj_schema/rapidjson/thirdparty/gtest/googlemock/test/gmock-more-actions_test.cc +710 -0
- data/ext/rj_schema/rapidjson/thirdparty/gtest/googlemock/test/gmock-nice-strict_test.cc +511 -0
- data/ext/rj_schema/rapidjson/thirdparty/gtest/googlemock/test/gmock-port_test.cc +43 -0
- data/ext/rj_schema/rapidjson/thirdparty/gtest/googlemock/test/gmock-spec-builders_test.cc +2771 -0
- data/ext/rj_schema/rapidjson/thirdparty/gtest/googlemock/test/gmock_all_test.cc +51 -0
- data/ext/rj_schema/rapidjson/thirdparty/gtest/googlemock/test/gmock_ex_test.cc +81 -0
- data/ext/rj_schema/rapidjson/thirdparty/gtest/googlemock/test/gmock_leak_test.py +108 -0
- data/ext/rj_schema/rapidjson/thirdparty/gtest/googlemock/test/gmock_leak_test_.cc +100 -0
- data/ext/rj_schema/rapidjson/thirdparty/gtest/googlemock/test/gmock_link2_test.cc +40 -0
- data/ext/rj_schema/rapidjson/thirdparty/gtest/googlemock/test/gmock_link_test.cc +40 -0
- data/ext/rj_schema/rapidjson/thirdparty/gtest/googlemock/test/gmock_link_test.h +691 -0
- data/ext/rj_schema/rapidjson/thirdparty/gtest/googlemock/test/gmock_output_test.py +183 -0
- data/ext/rj_schema/rapidjson/thirdparty/gtest/googlemock/test/gmock_output_test_.cc +310 -0
- data/ext/rj_schema/rapidjson/thirdparty/gtest/googlemock/test/gmock_output_test_golden.txt +317 -0
- data/ext/rj_schema/rapidjson/thirdparty/gtest/googlemock/test/gmock_stress_test.cc +323 -0
- data/ext/rj_schema/rapidjson/thirdparty/gtest/googlemock/test/gmock_test.cc +262 -0
- data/ext/rj_schema/rapidjson/thirdparty/gtest/googlemock/test/gmock_test_utils.py +110 -0
- data/ext/rj_schema/rapidjson/thirdparty/gtest/googletest/CHANGES +157 -0
- data/ext/rj_schema/rapidjson/thirdparty/gtest/googletest/CMakeLists.txt +312 -0
- data/ext/rj_schema/rapidjson/thirdparty/gtest/googletest/CONTRIBUTORS +37 -0
- data/ext/rj_schema/rapidjson/thirdparty/gtest/googletest/LICENSE +28 -0
- data/ext/rj_schema/rapidjson/thirdparty/gtest/googletest/Makefile.am +339 -0
- data/ext/rj_schema/rapidjson/thirdparty/gtest/googletest/README.md +341 -0
- data/ext/rj_schema/rapidjson/thirdparty/gtest/googletest/cmake/gtest.pc.in +9 -0
- data/ext/rj_schema/rapidjson/thirdparty/gtest/googletest/cmake/gtest_main.pc.in +10 -0
- data/ext/rj_schema/rapidjson/thirdparty/gtest/googletest/cmake/internal_utils.cmake +280 -0
- data/ext/rj_schema/rapidjson/thirdparty/gtest/googletest/codegear/gtest.cbproj +138 -0
- data/ext/rj_schema/rapidjson/thirdparty/gtest/googletest/codegear/gtest.groupproj +54 -0
- data/ext/rj_schema/rapidjson/thirdparty/gtest/googletest/codegear/gtest_all.cc +38 -0
- data/ext/rj_schema/rapidjson/thirdparty/gtest/googletest/codegear/gtest_link.cc +40 -0
- data/ext/rj_schema/rapidjson/thirdparty/gtest/googletest/codegear/gtest_main.cbproj +82 -0
- data/ext/rj_schema/rapidjson/thirdparty/gtest/googletest/codegear/gtest_unittest.cbproj +88 -0
- data/ext/rj_schema/rapidjson/thirdparty/gtest/googletest/configure.ac +68 -0
- data/ext/rj_schema/rapidjson/thirdparty/gtest/googletest/docs/Pkgconfig.md +146 -0
- data/ext/rj_schema/rapidjson/thirdparty/gtest/googletest/docs/PumpManual.md +177 -0
- data/ext/rj_schema/rapidjson/thirdparty/gtest/googletest/docs/XcodeGuide.md +93 -0
- data/ext/rj_schema/rapidjson/thirdparty/gtest/googletest/docs/advanced.md +2416 -0
- data/ext/rj_schema/rapidjson/thirdparty/gtest/googletest/docs/faq.md +1092 -0
- data/ext/rj_schema/rapidjson/thirdparty/gtest/googletest/docs/primer.md +536 -0
- data/ext/rj_schema/rapidjson/thirdparty/gtest/googletest/docs/samples.md +14 -0
- data/ext/rj_schema/rapidjson/thirdparty/gtest/googletest/include/gtest/gtest-death-test.h +342 -0
- data/ext/rj_schema/rapidjson/thirdparty/gtest/googletest/include/gtest/gtest-message.h +249 -0
- data/ext/rj_schema/rapidjson/thirdparty/gtest/googletest/include/gtest/gtest-param-test.h +1438 -0
- data/ext/rj_schema/rapidjson/thirdparty/gtest/googletest/include/gtest/gtest-param-test.h.pump +501 -0
- data/ext/rj_schema/rapidjson/thirdparty/gtest/googletest/include/gtest/gtest-printers.h +1082 -0
- data/ext/rj_schema/rapidjson/thirdparty/gtest/googletest/include/gtest/gtest-spi.h +231 -0
- data/ext/rj_schema/rapidjson/thirdparty/gtest/googletest/include/gtest/gtest-test-part.h +179 -0
- data/ext/rj_schema/rapidjson/thirdparty/gtest/googletest/include/gtest/gtest-typed-test.h +264 -0
- data/ext/rj_schema/rapidjson/thirdparty/gtest/googletest/include/gtest/gtest.h +2332 -0
- data/ext/rj_schema/rapidjson/thirdparty/gtest/googletest/include/gtest/gtest_pred_impl.h +357 -0
- data/ext/rj_schema/rapidjson/thirdparty/gtest/googletest/include/gtest/gtest_prod.h +61 -0
- data/ext/rj_schema/rapidjson/thirdparty/gtest/googletest/include/gtest/internal/custom/gtest-port.h +70 -0
- data/ext/rj_schema/rapidjson/thirdparty/gtest/googletest/include/gtest/internal/custom/gtest-printers.h +42 -0
- data/ext/rj_schema/rapidjson/thirdparty/gtest/googletest/include/gtest/internal/custom/gtest.h +45 -0
- data/ext/rj_schema/rapidjson/thirdparty/gtest/googletest/include/gtest/internal/gtest-death-test-internal.h +275 -0
- data/ext/rj_schema/rapidjson/thirdparty/gtest/googletest/include/gtest/internal/gtest-filepath.h +205 -0
- data/ext/rj_schema/rapidjson/thirdparty/gtest/googletest/include/gtest/internal/gtest-internal.h +1277 -0
- data/ext/rj_schema/rapidjson/thirdparty/gtest/googletest/include/gtest/internal/gtest-linked_ptr.h +243 -0
- data/ext/rj_schema/rapidjson/thirdparty/gtest/googletest/include/gtest/internal/gtest-param-util-generated.h +5139 -0
- data/ext/rj_schema/rapidjson/thirdparty/gtest/googletest/include/gtest/internal/gtest-param-util-generated.h.pump +279 -0
- data/ext/rj_schema/rapidjson/thirdparty/gtest/googletest/include/gtest/internal/gtest-param-util.h +723 -0
- data/ext/rj_schema/rapidjson/thirdparty/gtest/googletest/include/gtest/internal/gtest-port-arch.h +100 -0
- data/ext/rj_schema/rapidjson/thirdparty/gtest/googletest/include/gtest/internal/gtest-port.h +2687 -0
- data/ext/rj_schema/rapidjson/thirdparty/gtest/googletest/include/gtest/internal/gtest-string.h +167 -0
- data/ext/rj_schema/rapidjson/thirdparty/gtest/googletest/include/gtest/internal/gtest-tuple.h +1020 -0
- data/ext/rj_schema/rapidjson/thirdparty/gtest/googletest/include/gtest/internal/gtest-tuple.h.pump +347 -0
- data/ext/rj_schema/rapidjson/thirdparty/gtest/googletest/include/gtest/internal/gtest-type-util.h +3347 -0
- data/ext/rj_schema/rapidjson/thirdparty/gtest/googletest/include/gtest/internal/gtest-type-util.h.pump +313 -0
- data/ext/rj_schema/rapidjson/thirdparty/gtest/googletest/m4/acx_pthread.m4 +363 -0
- data/ext/rj_schema/rapidjson/thirdparty/gtest/googletest/m4/gtest.m4 +74 -0
- data/ext/rj_schema/rapidjson/thirdparty/gtest/googletest/make/Makefile +82 -0
- data/ext/rj_schema/rapidjson/thirdparty/gtest/googletest/msvc/2010/gtest-md.sln +55 -0
- data/ext/rj_schema/rapidjson/thirdparty/gtest/googletest/msvc/2010/gtest-md.vcxproj +149 -0
- data/ext/rj_schema/rapidjson/thirdparty/gtest/googletest/msvc/2010/gtest-md.vcxproj.filters +18 -0
- data/ext/rj_schema/rapidjson/thirdparty/gtest/googletest/msvc/2010/gtest.sln +55 -0
- data/ext/rj_schema/rapidjson/thirdparty/gtest/googletest/msvc/2010/gtest.vcxproj +149 -0
- data/ext/rj_schema/rapidjson/thirdparty/gtest/googletest/msvc/2010/gtest.vcxproj.filters +18 -0
- data/ext/rj_schema/rapidjson/thirdparty/gtest/googletest/msvc/2010/gtest_main-md.vcxproj +154 -0
- data/ext/rj_schema/rapidjson/thirdparty/gtest/googletest/msvc/2010/gtest_main-md.vcxproj.filters +18 -0
- data/ext/rj_schema/rapidjson/thirdparty/gtest/googletest/msvc/2010/gtest_main.vcxproj +162 -0
- data/ext/rj_schema/rapidjson/thirdparty/gtest/googletest/msvc/2010/gtest_main.vcxproj.filters +18 -0
- data/ext/rj_schema/rapidjson/thirdparty/gtest/googletest/msvc/2010/gtest_prod_test-md.vcxproj +199 -0
- data/ext/rj_schema/rapidjson/thirdparty/gtest/googletest/msvc/2010/gtest_prod_test-md.vcxproj.filters +26 -0
- data/ext/rj_schema/rapidjson/thirdparty/gtest/googletest/msvc/2010/gtest_prod_test.vcxproj +191 -0
- data/ext/rj_schema/rapidjson/thirdparty/gtest/googletest/msvc/2010/gtest_prod_test.vcxproj.filters +26 -0
- data/ext/rj_schema/rapidjson/thirdparty/gtest/googletest/msvc/2010/gtest_unittest-md.vcxproj +188 -0
- data/ext/rj_schema/rapidjson/thirdparty/gtest/googletest/msvc/2010/gtest_unittest-md.vcxproj.filters +18 -0
- data/ext/rj_schema/rapidjson/thirdparty/gtest/googletest/msvc/2010/gtest_unittest.vcxproj +180 -0
- data/ext/rj_schema/rapidjson/thirdparty/gtest/googletest/msvc/2010/gtest_unittest.vcxproj.filters +18 -0
- data/ext/rj_schema/rapidjson/thirdparty/gtest/googletest/samples/prime_tables.h +127 -0
- data/ext/rj_schema/rapidjson/thirdparty/gtest/googletest/samples/sample1.cc +68 -0
- data/ext/rj_schema/rapidjson/thirdparty/gtest/googletest/samples/sample1.h +43 -0
- data/ext/rj_schema/rapidjson/thirdparty/gtest/googletest/samples/sample10_unittest.cc +140 -0
- data/ext/rj_schema/rapidjson/thirdparty/gtest/googletest/samples/sample1_unittest.cc +154 -0
- data/ext/rj_schema/rapidjson/thirdparty/gtest/googletest/samples/sample2.cc +56 -0
- data/ext/rj_schema/rapidjson/thirdparty/gtest/googletest/samples/sample2.h +85 -0
- data/ext/rj_schema/rapidjson/thirdparty/gtest/googletest/samples/sample2_unittest.cc +110 -0
- data/ext/rj_schema/rapidjson/thirdparty/gtest/googletest/samples/sample3-inl.h +172 -0
- data/ext/rj_schema/rapidjson/thirdparty/gtest/googletest/samples/sample3_unittest.cc +152 -0
- data/ext/rj_schema/rapidjson/thirdparty/gtest/googletest/samples/sample4.cc +46 -0
- data/ext/rj_schema/rapidjson/thirdparty/gtest/googletest/samples/sample4.h +53 -0
- data/ext/rj_schema/rapidjson/thirdparty/gtest/googletest/samples/sample4_unittest.cc +49 -0
- data/ext/rj_schema/rapidjson/thirdparty/gtest/googletest/samples/sample5_unittest.cc +199 -0
- data/ext/rj_schema/rapidjson/thirdparty/gtest/googletest/samples/sample6_unittest.cc +225 -0
- data/ext/rj_schema/rapidjson/thirdparty/gtest/googletest/samples/sample7_unittest.cc +118 -0
- data/ext/rj_schema/rapidjson/thirdparty/gtest/googletest/samples/sample8_unittest.cc +174 -0
- data/ext/rj_schema/rapidjson/thirdparty/gtest/googletest/samples/sample9_unittest.cc +157 -0
- data/ext/rj_schema/rapidjson/thirdparty/gtest/googletest/scripts/common.py +83 -0
- data/ext/rj_schema/rapidjson/thirdparty/gtest/googletest/scripts/fuse_gtest_files.py +253 -0
- data/ext/rj_schema/rapidjson/thirdparty/gtest/googletest/scripts/gen_gtest_pred_impl.py +730 -0
- data/ext/rj_schema/rapidjson/thirdparty/gtest/googletest/scripts/gtest-config.in +274 -0
- data/ext/rj_schema/rapidjson/thirdparty/gtest/googletest/scripts/pump.py +855 -0
- data/ext/rj_schema/rapidjson/thirdparty/gtest/googletest/scripts/release_docs.py +158 -0
- data/ext/rj_schema/rapidjson/thirdparty/gtest/googletest/scripts/test/Makefile +59 -0
- data/ext/rj_schema/rapidjson/thirdparty/gtest/googletest/scripts/upload.py +1387 -0
- data/ext/rj_schema/rapidjson/thirdparty/gtest/googletest/scripts/upload_gtest.py +78 -0
- data/ext/rj_schema/rapidjson/thirdparty/gtest/googletest/src/gtest-all.cc +48 -0
- data/ext/rj_schema/rapidjson/thirdparty/gtest/googletest/src/gtest-death-test.cc +1536 -0
- data/ext/rj_schema/rapidjson/thirdparty/gtest/googletest/src/gtest-filepath.cc +385 -0
- data/ext/rj_schema/rapidjson/thirdparty/gtest/googletest/src/gtest-internal-inl.h +1175 -0
- data/ext/rj_schema/rapidjson/thirdparty/gtest/googletest/src/gtest-port.cc +1277 -0
- data/ext/rj_schema/rapidjson/thirdparty/gtest/googletest/src/gtest-printers.cc +458 -0
- data/ext/rj_schema/rapidjson/thirdparty/gtest/googletest/src/gtest-test-part.cc +102 -0
- data/ext/rj_schema/rapidjson/thirdparty/gtest/googletest/src/gtest-typed-test.cc +119 -0
- data/ext/rj_schema/rapidjson/thirdparty/gtest/googletest/src/gtest.cc +5846 -0
- data/ext/rj_schema/rapidjson/thirdparty/gtest/googletest/src/gtest_main.cc +38 -0
- data/ext/rj_schema/rapidjson/thirdparty/gtest/googletest/test/BUILD.bazel +396 -0
- data/ext/rj_schema/rapidjson/thirdparty/gtest/googletest/test/gtest-death-test_ex_test.cc +93 -0
- data/ext/rj_schema/rapidjson/thirdparty/gtest/googletest/test/gtest-death-test_test.cc +1424 -0
- data/ext/rj_schema/rapidjson/thirdparty/gtest/googletest/test/gtest-filepath_test.cc +652 -0
- data/ext/rj_schema/rapidjson/thirdparty/gtest/googletest/test/gtest-linked_ptr_test.cc +154 -0
- data/ext/rj_schema/rapidjson/thirdparty/gtest/googletest/test/gtest-listener_test.cc +311 -0
- data/ext/rj_schema/rapidjson/thirdparty/gtest/googletest/test/gtest-message_test.cc +159 -0
- data/ext/rj_schema/rapidjson/thirdparty/gtest/googletest/test/gtest-options_test.cc +213 -0
- data/ext/rj_schema/rapidjson/thirdparty/gtest/googletest/test/gtest-param-test2_test.cc +61 -0
- data/ext/rj_schema/rapidjson/thirdparty/gtest/googletest/test/gtest-param-test_test.cc +1110 -0
- data/ext/rj_schema/rapidjson/thirdparty/gtest/googletest/test/gtest-param-test_test.h +53 -0
- data/ext/rj_schema/rapidjson/thirdparty/gtest/googletest/test/gtest-port_test.cc +1303 -0
- data/ext/rj_schema/rapidjson/thirdparty/gtest/googletest/test/gtest-printers_test.cc +1737 -0
- data/ext/rj_schema/rapidjson/thirdparty/gtest/googletest/test/gtest-test-part_test.cc +208 -0
- data/ext/rj_schema/rapidjson/thirdparty/gtest/googletest/test/gtest-tuple_test.cc +320 -0
- data/ext/rj_schema/rapidjson/thirdparty/gtest/googletest/test/gtest-typed-test2_test.cc +45 -0
- data/ext/rj_schema/rapidjson/thirdparty/gtest/googletest/test/gtest-typed-test_test.cc +380 -0
- data/ext/rj_schema/rapidjson/thirdparty/gtest/googletest/test/gtest-typed-test_test.h +66 -0
- data/ext/rj_schema/rapidjson/thirdparty/gtest/googletest/test/gtest-unittest-api_test.cc +341 -0
- data/ext/rj_schema/rapidjson/thirdparty/gtest/googletest/test/gtest_all_test.cc +47 -0
- data/ext/rj_schema/rapidjson/thirdparty/gtest/googletest/test/gtest_assert_by_exception_test.cc +119 -0
- data/ext/rj_schema/rapidjson/thirdparty/gtest/googletest/test/gtest_break_on_failure_unittest.py +210 -0
- data/ext/rj_schema/rapidjson/thirdparty/gtest/googletest/test/gtest_break_on_failure_unittest_.cc +87 -0
- data/ext/rj_schema/rapidjson/thirdparty/gtest/googletest/test/gtest_catch_exceptions_test.py +235 -0
- data/ext/rj_schema/rapidjson/thirdparty/gtest/googletest/test/gtest_catch_exceptions_test_.cc +311 -0
- data/ext/rj_schema/rapidjson/thirdparty/gtest/googletest/test/gtest_color_test.py +129 -0
- data/ext/rj_schema/rapidjson/thirdparty/gtest/googletest/test/gtest_color_test_.cc +63 -0
- data/ext/rj_schema/rapidjson/thirdparty/gtest/googletest/test/gtest_env_var_test.py +119 -0
- data/ext/rj_schema/rapidjson/thirdparty/gtest/googletest/test/gtest_env_var_test_.cc +124 -0
- data/ext/rj_schema/rapidjson/thirdparty/gtest/googletest/test/gtest_environment_test.cc +189 -0
- data/ext/rj_schema/rapidjson/thirdparty/gtest/googletest/test/gtest_filter_unittest.py +638 -0
- data/ext/rj_schema/rapidjson/thirdparty/gtest/googletest/test/gtest_filter_unittest_.cc +138 -0
- data/ext/rj_schema/rapidjson/thirdparty/gtest/googletest/test/gtest_help_test.py +172 -0
- data/ext/rj_schema/rapidjson/thirdparty/gtest/googletest/test/gtest_help_test_.cc +46 -0
- data/ext/rj_schema/rapidjson/thirdparty/gtest/googletest/test/gtest_json_outfiles_test.py +162 -0
- data/ext/rj_schema/rapidjson/thirdparty/gtest/googletest/test/gtest_json_output_unittest.py +611 -0
- data/ext/rj_schema/rapidjson/thirdparty/gtest/googletest/test/gtest_json_test_utils.py +60 -0
- data/ext/rj_schema/rapidjson/thirdparty/gtest/googletest/test/gtest_list_tests_unittest.py +207 -0
- data/ext/rj_schema/rapidjson/thirdparty/gtest/googletest/test/gtest_list_tests_unittest_.cc +157 -0
- data/ext/rj_schema/rapidjson/thirdparty/gtest/googletest/test/gtest_main_unittest.cc +45 -0
- data/ext/rj_schema/rapidjson/thirdparty/gtest/googletest/test/gtest_no_test_unittest.cc +56 -0
- data/ext/rj_schema/rapidjson/thirdparty/gtest/googletest/test/gtest_output_test.py +344 -0
- data/ext/rj_schema/rapidjson/thirdparty/gtest/googletest/test/gtest_output_test_.cc +1067 -0
- data/ext/rj_schema/rapidjson/thirdparty/gtest/googletest/test/gtest_output_test_golden_lin.txt +781 -0
- data/ext/rj_schema/rapidjson/thirdparty/gtest/googletest/test/gtest_pred_impl_unittest.cc +2427 -0
- data/ext/rj_schema/rapidjson/thirdparty/gtest/googletest/test/gtest_premature_exit_test.cc +127 -0
- data/ext/rj_schema/rapidjson/thirdparty/gtest/googletest/test/gtest_prod_test.cc +57 -0
- data/ext/rj_schema/rapidjson/thirdparty/gtest/googletest/test/gtest_repeat_test.cc +236 -0
- data/ext/rj_schema/rapidjson/thirdparty/gtest/googletest/test/gtest_shuffle_test.py +325 -0
- data/ext/rj_schema/rapidjson/thirdparty/gtest/googletest/test/gtest_shuffle_test_.cc +103 -0
- data/ext/rj_schema/rapidjson/thirdparty/gtest/googletest/test/gtest_sole_header_test.cc +57 -0
- data/ext/rj_schema/rapidjson/thirdparty/gtest/googletest/test/gtest_stress_test.cc +250 -0
- data/ext/rj_schema/rapidjson/thirdparty/gtest/googletest/test/gtest_test_utils.py +318 -0
- data/ext/rj_schema/rapidjson/thirdparty/gtest/googletest/test/gtest_testbridge_test.py +65 -0
- data/ext/rj_schema/rapidjson/thirdparty/gtest/googletest/test/gtest_testbridge_test_.cc +44 -0
- data/ext/rj_schema/rapidjson/thirdparty/gtest/googletest/test/gtest_throw_on_failure_ex_test.cc +92 -0
- data/ext/rj_schema/rapidjson/thirdparty/gtest/googletest/test/gtest_throw_on_failure_test.py +171 -0
- data/ext/rj_schema/rapidjson/thirdparty/gtest/googletest/test/gtest_throw_on_failure_test_.cc +72 -0
- data/ext/rj_schema/rapidjson/thirdparty/gtest/googletest/test/gtest_uninitialized_test.py +69 -0
- data/ext/rj_schema/rapidjson/thirdparty/gtest/googletest/test/gtest_uninitialized_test_.cc +43 -0
- data/ext/rj_schema/rapidjson/thirdparty/gtest/googletest/test/gtest_unittest.cc +7797 -0
- data/ext/rj_schema/rapidjson/thirdparty/gtest/googletest/test/gtest_xml_outfile1_test_.cc +48 -0
- data/ext/rj_schema/rapidjson/thirdparty/gtest/googletest/test/gtest_xml_outfile2_test_.cc +48 -0
- data/ext/rj_schema/rapidjson/thirdparty/gtest/googletest/test/gtest_xml_outfiles_test.py +140 -0
- data/ext/rj_schema/rapidjson/thirdparty/gtest/googletest/test/gtest_xml_output_unittest.py +378 -0
- data/ext/rj_schema/rapidjson/thirdparty/gtest/googletest/test/gtest_xml_output_unittest_.cc +179 -0
- data/ext/rj_schema/rapidjson/thirdparty/gtest/googletest/test/gtest_xml_test_utils.py +196 -0
- data/ext/rj_schema/rapidjson/thirdparty/gtest/googletest/test/production.cc +36 -0
- data/ext/rj_schema/rapidjson/thirdparty/gtest/googletest/test/production.h +55 -0
- data/ext/rj_schema/rapidjson/thirdparty/gtest/googletest/xcode/Config/DebugProject.xcconfig +30 -0
- data/ext/rj_schema/rapidjson/thirdparty/gtest/googletest/xcode/Config/FrameworkTarget.xcconfig +17 -0
- data/ext/rj_schema/rapidjson/thirdparty/gtest/googletest/xcode/Config/General.xcconfig +41 -0
- data/ext/rj_schema/rapidjson/thirdparty/gtest/googletest/xcode/Config/ReleaseProject.xcconfig +32 -0
- data/ext/rj_schema/rapidjson/thirdparty/gtest/googletest/xcode/Config/StaticLibraryTarget.xcconfig +18 -0
- data/ext/rj_schema/rapidjson/thirdparty/gtest/googletest/xcode/Config/TestTarget.xcconfig +8 -0
- data/ext/rj_schema/rapidjson/thirdparty/gtest/googletest/xcode/Resources/Info.plist +30 -0
- data/ext/rj_schema/rapidjson/thirdparty/gtest/googletest/xcode/Samples/FrameworkSample/Info.plist +28 -0
- data/ext/rj_schema/rapidjson/thirdparty/gtest/googletest/xcode/Samples/FrameworkSample/WidgetFramework.xcodeproj/project.pbxproj +457 -0
- data/ext/rj_schema/rapidjson/thirdparty/gtest/googletest/xcode/Samples/FrameworkSample/runtests.sh +62 -0
- data/ext/rj_schema/rapidjson/thirdparty/gtest/googletest/xcode/Samples/FrameworkSample/widget.cc +63 -0
- data/ext/rj_schema/rapidjson/thirdparty/gtest/googletest/xcode/Samples/FrameworkSample/widget.h +59 -0
- data/ext/rj_schema/rapidjson/thirdparty/gtest/googletest/xcode/Samples/FrameworkSample/widget_test.cc +68 -0
- data/ext/rj_schema/rapidjson/thirdparty/gtest/googletest/xcode/Scripts/runtests.sh +65 -0
- data/ext/rj_schema/rapidjson/thirdparty/gtest/googletest/xcode/Scripts/versiongenerate.py +100 -0
- data/ext/rj_schema/rapidjson/thirdparty/gtest/googletest/xcode/gtest.xcodeproj/project.pbxproj +1182 -0
- data/ext/rj_schema/rapidjson/travis-doxygen.sh +128 -0
- data/ext/rj_schema/rj_schema.cpp +162 -18
- data/lib/rj_schema.rb +1 -1
- metadata +626 -3
@@ -0,0 +1,223 @@
|
|
1
|
+
// Tencent is pleased to support the open source community by making RapidJSON available.
|
2
|
+
//
|
3
|
+
// Copyright (C) 2015 THL A29 Limited, a Tencent company, and Milo Yip.
|
4
|
+
//
|
5
|
+
// Licensed under the MIT License (the "License"); you may not use this file except
|
6
|
+
// in compliance with the License. You may obtain a copy of the License at
|
7
|
+
//
|
8
|
+
// http://opensource.org/licenses/MIT
|
9
|
+
//
|
10
|
+
// Unless required by applicable law or agreed to in writing, software distributed
|
11
|
+
// under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR
|
12
|
+
// CONDITIONS OF ANY KIND, either express or implied. See the License for the
|
13
|
+
// specific language governing permissions and limitations under the License.
|
14
|
+
|
15
|
+
#include "rapidjson.h"
|
16
|
+
|
17
|
+
#ifndef RAPIDJSON_STREAM_H_
|
18
|
+
#define RAPIDJSON_STREAM_H_
|
19
|
+
|
20
|
+
#include "encodings.h"
|
21
|
+
|
22
|
+
RAPIDJSON_NAMESPACE_BEGIN
|
23
|
+
|
24
|
+
///////////////////////////////////////////////////////////////////////////////
|
25
|
+
// Stream
|
26
|
+
|
27
|
+
/*! \class rapidjson::Stream
|
28
|
+
\brief Concept for reading and writing characters.
|
29
|
+
|
30
|
+
For read-only stream, no need to implement PutBegin(), Put(), Flush() and PutEnd().
|
31
|
+
|
32
|
+
For write-only stream, only need to implement Put() and Flush().
|
33
|
+
|
34
|
+
\code
|
35
|
+
concept Stream {
|
36
|
+
typename Ch; //!< Character type of the stream.
|
37
|
+
|
38
|
+
//! Read the current character from stream without moving the read cursor.
|
39
|
+
Ch Peek() const;
|
40
|
+
|
41
|
+
//! Read the current character from stream and moving the read cursor to next character.
|
42
|
+
Ch Take();
|
43
|
+
|
44
|
+
//! Get the current read cursor.
|
45
|
+
//! \return Number of characters read from start.
|
46
|
+
size_t Tell();
|
47
|
+
|
48
|
+
//! Begin writing operation at the current read pointer.
|
49
|
+
//! \return The begin writer pointer.
|
50
|
+
Ch* PutBegin();
|
51
|
+
|
52
|
+
//! Write a character.
|
53
|
+
void Put(Ch c);
|
54
|
+
|
55
|
+
//! Flush the buffer.
|
56
|
+
void Flush();
|
57
|
+
|
58
|
+
//! End the writing operation.
|
59
|
+
//! \param begin The begin write pointer returned by PutBegin().
|
60
|
+
//! \return Number of characters written.
|
61
|
+
size_t PutEnd(Ch* begin);
|
62
|
+
}
|
63
|
+
\endcode
|
64
|
+
*/
|
65
|
+
|
66
|
+
//! Provides additional information for stream.
|
67
|
+
/*!
|
68
|
+
By using traits pattern, this type provides a default configuration for stream.
|
69
|
+
For custom stream, this type can be specialized for other configuration.
|
70
|
+
See TEST(Reader, CustomStringStream) in readertest.cpp for example.
|
71
|
+
*/
|
72
|
+
template<typename Stream>
|
73
|
+
struct StreamTraits {
|
74
|
+
//! Whether to make local copy of stream for optimization during parsing.
|
75
|
+
/*!
|
76
|
+
By default, for safety, streams do not use local copy optimization.
|
77
|
+
Stream that can be copied fast should specialize this, like StreamTraits<StringStream>.
|
78
|
+
*/
|
79
|
+
enum { copyOptimization = 0 };
|
80
|
+
};
|
81
|
+
|
82
|
+
//! Reserve n characters for writing to a stream.
|
83
|
+
template<typename Stream>
|
84
|
+
inline void PutReserve(Stream& stream, size_t count) {
|
85
|
+
(void)stream;
|
86
|
+
(void)count;
|
87
|
+
}
|
88
|
+
|
89
|
+
//! Write character to a stream, presuming buffer is reserved.
|
90
|
+
template<typename Stream>
|
91
|
+
inline void PutUnsafe(Stream& stream, typename Stream::Ch c) {
|
92
|
+
stream.Put(c);
|
93
|
+
}
|
94
|
+
|
95
|
+
//! Put N copies of a character to a stream.
|
96
|
+
template<typename Stream, typename Ch>
|
97
|
+
inline void PutN(Stream& stream, Ch c, size_t n) {
|
98
|
+
PutReserve(stream, n);
|
99
|
+
for (size_t i = 0; i < n; i++)
|
100
|
+
PutUnsafe(stream, c);
|
101
|
+
}
|
102
|
+
|
103
|
+
///////////////////////////////////////////////////////////////////////////////
|
104
|
+
// GenericStreamWrapper
|
105
|
+
|
106
|
+
//! A Stream Wrapper
|
107
|
+
/*! \tThis string stream is a wrapper for any stream by just forwarding any
|
108
|
+
\treceived message to the origin stream.
|
109
|
+
\note implements Stream concept
|
110
|
+
*/
|
111
|
+
|
112
|
+
#if defined(_MSC_VER) && _MSC_VER <= 1800
|
113
|
+
RAPIDJSON_DIAG_PUSH
|
114
|
+
RAPIDJSON_DIAG_OFF(4702) // unreachable code
|
115
|
+
RAPIDJSON_DIAG_OFF(4512) // assignment operator could not be generated
|
116
|
+
#endif
|
117
|
+
|
118
|
+
template <typename InputStream, typename Encoding = UTF8<> >
|
119
|
+
class GenericStreamWrapper {
|
120
|
+
public:
|
121
|
+
typedef typename Encoding::Ch Ch;
|
122
|
+
GenericStreamWrapper(InputStream& is): is_(is) {}
|
123
|
+
|
124
|
+
Ch Peek() const { return is_.Peek(); }
|
125
|
+
Ch Take() { return is_.Take(); }
|
126
|
+
size_t Tell() { return is_.Tell(); }
|
127
|
+
Ch* PutBegin() { return is_.PutBegin(); }
|
128
|
+
void Put(Ch ch) { is_.Put(ch); }
|
129
|
+
void Flush() { is_.Flush(); }
|
130
|
+
size_t PutEnd(Ch* ch) { return is_.PutEnd(ch); }
|
131
|
+
|
132
|
+
// wrapper for MemoryStream
|
133
|
+
const Ch* Peek4() const { return is_.Peek4(); }
|
134
|
+
|
135
|
+
// wrapper for AutoUTFInputStream
|
136
|
+
UTFType GetType() const { return is_.GetType(); }
|
137
|
+
bool HasBOM() const { return is_.HasBOM(); }
|
138
|
+
|
139
|
+
protected:
|
140
|
+
InputStream& is_;
|
141
|
+
};
|
142
|
+
|
143
|
+
#if defined(_MSC_VER) && _MSC_VER <= 1800
|
144
|
+
RAPIDJSON_DIAG_POP
|
145
|
+
#endif
|
146
|
+
|
147
|
+
///////////////////////////////////////////////////////////////////////////////
|
148
|
+
// StringStream
|
149
|
+
|
150
|
+
//! Read-only string stream.
|
151
|
+
/*! \note implements Stream concept
|
152
|
+
*/
|
153
|
+
template <typename Encoding>
|
154
|
+
struct GenericStringStream {
|
155
|
+
typedef typename Encoding::Ch Ch;
|
156
|
+
|
157
|
+
GenericStringStream(const Ch *src) : src_(src), head_(src) {}
|
158
|
+
|
159
|
+
Ch Peek() const { return *src_; }
|
160
|
+
Ch Take() { return *src_++; }
|
161
|
+
size_t Tell() const { return static_cast<size_t>(src_ - head_); }
|
162
|
+
|
163
|
+
Ch* PutBegin() { RAPIDJSON_ASSERT(false); return 0; }
|
164
|
+
void Put(Ch) { RAPIDJSON_ASSERT(false); }
|
165
|
+
void Flush() { RAPIDJSON_ASSERT(false); }
|
166
|
+
size_t PutEnd(Ch*) { RAPIDJSON_ASSERT(false); return 0; }
|
167
|
+
|
168
|
+
const Ch* src_; //!< Current read position.
|
169
|
+
const Ch* head_; //!< Original head of the string.
|
170
|
+
};
|
171
|
+
|
172
|
+
template <typename Encoding>
|
173
|
+
struct StreamTraits<GenericStringStream<Encoding> > {
|
174
|
+
enum { copyOptimization = 1 };
|
175
|
+
};
|
176
|
+
|
177
|
+
//! String stream with UTF8 encoding.
|
178
|
+
typedef GenericStringStream<UTF8<> > StringStream;
|
179
|
+
|
180
|
+
///////////////////////////////////////////////////////////////////////////////
|
181
|
+
// InsituStringStream
|
182
|
+
|
183
|
+
//! A read-write string stream.
|
184
|
+
/*! This string stream is particularly designed for in-situ parsing.
|
185
|
+
\note implements Stream concept
|
186
|
+
*/
|
187
|
+
template <typename Encoding>
|
188
|
+
struct GenericInsituStringStream {
|
189
|
+
typedef typename Encoding::Ch Ch;
|
190
|
+
|
191
|
+
GenericInsituStringStream(Ch *src) : src_(src), dst_(0), head_(src) {}
|
192
|
+
|
193
|
+
// Read
|
194
|
+
Ch Peek() { return *src_; }
|
195
|
+
Ch Take() { return *src_++; }
|
196
|
+
size_t Tell() { return static_cast<size_t>(src_ - head_); }
|
197
|
+
|
198
|
+
// Write
|
199
|
+
void Put(Ch c) { RAPIDJSON_ASSERT(dst_ != 0); *dst_++ = c; }
|
200
|
+
|
201
|
+
Ch* PutBegin() { return dst_ = src_; }
|
202
|
+
size_t PutEnd(Ch* begin) { return static_cast<size_t>(dst_ - begin); }
|
203
|
+
void Flush() {}
|
204
|
+
|
205
|
+
Ch* Push(size_t count) { Ch* begin = dst_; dst_ += count; return begin; }
|
206
|
+
void Pop(size_t count) { dst_ -= count; }
|
207
|
+
|
208
|
+
Ch* src_;
|
209
|
+
Ch* dst_;
|
210
|
+
Ch* head_;
|
211
|
+
};
|
212
|
+
|
213
|
+
template <typename Encoding>
|
214
|
+
struct StreamTraits<GenericInsituStringStream<Encoding> > {
|
215
|
+
enum { copyOptimization = 1 };
|
216
|
+
};
|
217
|
+
|
218
|
+
//! Insitu string stream with UTF8 encoding.
|
219
|
+
typedef GenericInsituStringStream<UTF8<> > InsituStringStream;
|
220
|
+
|
221
|
+
RAPIDJSON_NAMESPACE_END
|
222
|
+
|
223
|
+
#endif // RAPIDJSON_STREAM_H_
|
@@ -0,0 +1,121 @@
|
|
1
|
+
// Tencent is pleased to support the open source community by making RapidJSON available.
|
2
|
+
//
|
3
|
+
// Copyright (C) 2015 THL A29 Limited, a Tencent company, and Milo Yip.
|
4
|
+
//
|
5
|
+
// Licensed under the MIT License (the "License"); you may not use this file except
|
6
|
+
// in compliance with the License. You may obtain a copy of the License at
|
7
|
+
//
|
8
|
+
// http://opensource.org/licenses/MIT
|
9
|
+
//
|
10
|
+
// Unless required by applicable law or agreed to in writing, software distributed
|
11
|
+
// under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR
|
12
|
+
// CONDITIONS OF ANY KIND, either express or implied. See the License for the
|
13
|
+
// specific language governing permissions and limitations under the License.
|
14
|
+
|
15
|
+
#ifndef RAPIDJSON_STRINGBUFFER_H_
|
16
|
+
#define RAPIDJSON_STRINGBUFFER_H_
|
17
|
+
|
18
|
+
#include "stream.h"
|
19
|
+
#include "internal/stack.h"
|
20
|
+
|
21
|
+
#if RAPIDJSON_HAS_CXX11_RVALUE_REFS
|
22
|
+
#include <utility> // std::move
|
23
|
+
#endif
|
24
|
+
|
25
|
+
#include "internal/stack.h"
|
26
|
+
|
27
|
+
#if defined(__clang__)
|
28
|
+
RAPIDJSON_DIAG_PUSH
|
29
|
+
RAPIDJSON_DIAG_OFF(c++98-compat)
|
30
|
+
#endif
|
31
|
+
|
32
|
+
RAPIDJSON_NAMESPACE_BEGIN
|
33
|
+
|
34
|
+
//! Represents an in-memory output stream.
|
35
|
+
/*!
|
36
|
+
\tparam Encoding Encoding of the stream.
|
37
|
+
\tparam Allocator type for allocating memory buffer.
|
38
|
+
\note implements Stream concept
|
39
|
+
*/
|
40
|
+
template <typename Encoding, typename Allocator = CrtAllocator>
|
41
|
+
class GenericStringBuffer {
|
42
|
+
public:
|
43
|
+
typedef typename Encoding::Ch Ch;
|
44
|
+
|
45
|
+
GenericStringBuffer(Allocator* allocator = 0, size_t capacity = kDefaultCapacity) : stack_(allocator, capacity) {}
|
46
|
+
|
47
|
+
#if RAPIDJSON_HAS_CXX11_RVALUE_REFS
|
48
|
+
GenericStringBuffer(GenericStringBuffer&& rhs) : stack_(std::move(rhs.stack_)) {}
|
49
|
+
GenericStringBuffer& operator=(GenericStringBuffer&& rhs) {
|
50
|
+
if (&rhs != this)
|
51
|
+
stack_ = std::move(rhs.stack_);
|
52
|
+
return *this;
|
53
|
+
}
|
54
|
+
#endif
|
55
|
+
|
56
|
+
void Put(Ch c) { *stack_.template Push<Ch>() = c; }
|
57
|
+
void PutUnsafe(Ch c) { *stack_.template PushUnsafe<Ch>() = c; }
|
58
|
+
void Flush() {}
|
59
|
+
|
60
|
+
void Clear() { stack_.Clear(); }
|
61
|
+
void ShrinkToFit() {
|
62
|
+
// Push and pop a null terminator. This is safe.
|
63
|
+
*stack_.template Push<Ch>() = '\0';
|
64
|
+
stack_.ShrinkToFit();
|
65
|
+
stack_.template Pop<Ch>(1);
|
66
|
+
}
|
67
|
+
|
68
|
+
void Reserve(size_t count) { stack_.template Reserve<Ch>(count); }
|
69
|
+
Ch* Push(size_t count) { return stack_.template Push<Ch>(count); }
|
70
|
+
Ch* PushUnsafe(size_t count) { return stack_.template PushUnsafe<Ch>(count); }
|
71
|
+
void Pop(size_t count) { stack_.template Pop<Ch>(count); }
|
72
|
+
|
73
|
+
const Ch* GetString() const {
|
74
|
+
// Push and pop a null terminator. This is safe.
|
75
|
+
*stack_.template Push<Ch>() = '\0';
|
76
|
+
stack_.template Pop<Ch>(1);
|
77
|
+
|
78
|
+
return stack_.template Bottom<Ch>();
|
79
|
+
}
|
80
|
+
|
81
|
+
//! Get the size of string in bytes in the string buffer.
|
82
|
+
size_t GetSize() const { return stack_.GetSize(); }
|
83
|
+
|
84
|
+
//! Get the length of string in Ch in the string buffer.
|
85
|
+
size_t GetLength() const { return stack_.GetSize() / sizeof(Ch); }
|
86
|
+
|
87
|
+
static const size_t kDefaultCapacity = 256;
|
88
|
+
mutable internal::Stack<Allocator> stack_;
|
89
|
+
|
90
|
+
private:
|
91
|
+
// Prohibit copy constructor & assignment operator.
|
92
|
+
GenericStringBuffer(const GenericStringBuffer&);
|
93
|
+
GenericStringBuffer& operator=(const GenericStringBuffer&);
|
94
|
+
};
|
95
|
+
|
96
|
+
//! String buffer with UTF8 encoding
|
97
|
+
typedef GenericStringBuffer<UTF8<> > StringBuffer;
|
98
|
+
|
99
|
+
template<typename Encoding, typename Allocator>
|
100
|
+
inline void PutReserve(GenericStringBuffer<Encoding, Allocator>& stream, size_t count) {
|
101
|
+
stream.Reserve(count);
|
102
|
+
}
|
103
|
+
|
104
|
+
template<typename Encoding, typename Allocator>
|
105
|
+
inline void PutUnsafe(GenericStringBuffer<Encoding, Allocator>& stream, typename Encoding::Ch c) {
|
106
|
+
stream.PutUnsafe(c);
|
107
|
+
}
|
108
|
+
|
109
|
+
//! Implement specialized version of PutN() with memset() for better performance.
|
110
|
+
template<>
|
111
|
+
inline void PutN(GenericStringBuffer<UTF8<> >& stream, char c, size_t n) {
|
112
|
+
std::memset(stream.stack_.Push<char>(n), c, n * sizeof(c));
|
113
|
+
}
|
114
|
+
|
115
|
+
RAPIDJSON_NAMESPACE_END
|
116
|
+
|
117
|
+
#if defined(__clang__)
|
118
|
+
RAPIDJSON_DIAG_POP
|
119
|
+
#endif
|
120
|
+
|
121
|
+
#endif // RAPIDJSON_STRINGBUFFER_H_
|
@@ -0,0 +1,466 @@
|
|
1
|
+
// Tencent is pleased to support the open source community by making RapidJSON available.
|
2
|
+
//
|
3
|
+
// (C) Copyright IBM Corporation 2021
|
4
|
+
//
|
5
|
+
// Licensed under the MIT License (the "License"); you may not use this file except
|
6
|
+
// in compliance with the License. You may obtain a copy of the License at
|
7
|
+
//
|
8
|
+
// http://opensource.org/licenses/MIT
|
9
|
+
//
|
10
|
+
// Unless required by applicable law or agreed to in writing, software distributed
|
11
|
+
// under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR
|
12
|
+
// CONDITIONS OF ANY KIND, either express or implied. See the License for the
|
13
|
+
// specific language governing permissions and limitations under the License.
|
14
|
+
|
15
|
+
#ifndef RAPIDJSON_URI_H_
|
16
|
+
#define RAPIDJSON_URI_H_
|
17
|
+
|
18
|
+
#include "internal/strfunc.h"
|
19
|
+
|
20
|
+
#if defined(__clang__)
|
21
|
+
RAPIDJSON_DIAG_PUSH
|
22
|
+
RAPIDJSON_DIAG_OFF(c++98-compat)
|
23
|
+
#elif defined(_MSC_VER)
|
24
|
+
RAPIDJSON_DIAG_OFF(4512) // assignment operator could not be generated
|
25
|
+
#endif
|
26
|
+
|
27
|
+
RAPIDJSON_NAMESPACE_BEGIN
|
28
|
+
|
29
|
+
///////////////////////////////////////////////////////////////////////////////
|
30
|
+
// GenericUri
|
31
|
+
|
32
|
+
template <typename ValueType, typename Allocator=CrtAllocator>
|
33
|
+
class GenericUri {
|
34
|
+
public:
|
35
|
+
typedef typename ValueType::Ch Ch;
|
36
|
+
#if RAPIDJSON_HAS_STDSTRING
|
37
|
+
typedef std::basic_string<Ch> String;
|
38
|
+
#endif
|
39
|
+
|
40
|
+
//! Constructors
|
41
|
+
GenericUri(Allocator* allocator = 0) : uri_(), base_(), scheme_(), auth_(), path_(), query_(), frag_(), allocator_(allocator), ownAllocator_() {
|
42
|
+
}
|
43
|
+
|
44
|
+
GenericUri(const Ch* uri, SizeType len, Allocator* allocator = 0) : uri_(), base_(), scheme_(), auth_(), path_(), query_(), frag_(), allocator_(allocator), ownAllocator_() {
|
45
|
+
Parse(uri, len);
|
46
|
+
}
|
47
|
+
|
48
|
+
GenericUri(const Ch* uri, Allocator* allocator = 0) : uri_(), base_(), scheme_(), auth_(), path_(), query_(), frag_(), allocator_(allocator), ownAllocator_() {
|
49
|
+
Parse(uri, internal::StrLen<Ch>(uri));
|
50
|
+
}
|
51
|
+
|
52
|
+
// Use with specializations of GenericValue
|
53
|
+
template<typename T> GenericUri(const T& uri, Allocator* allocator = 0) : uri_(), base_(), scheme_(), auth_(), path_(), query_(), frag_(), allocator_(allocator), ownAllocator_() {
|
54
|
+
const Ch* u = uri.template Get<const Ch*>(); // TypeHelper from document.h
|
55
|
+
Parse(u, internal::StrLen<Ch>(u));
|
56
|
+
}
|
57
|
+
|
58
|
+
#if RAPIDJSON_HAS_STDSTRING
|
59
|
+
GenericUri(const String& uri, Allocator* allocator = 0) : uri_(), base_(), scheme_(), auth_(), path_(), query_(), frag_(), allocator_(allocator), ownAllocator_() {
|
60
|
+
Parse(uri.c_str(), internal::StrLen<Ch>(uri.c_str()));
|
61
|
+
}
|
62
|
+
#endif
|
63
|
+
|
64
|
+
//! Copy constructor
|
65
|
+
GenericUri(const GenericUri& rhs) : uri_(), base_(), scheme_(), auth_(), path_(), query_(), frag_(), allocator_(), ownAllocator_() {
|
66
|
+
*this = rhs;
|
67
|
+
}
|
68
|
+
|
69
|
+
//! Copy constructor
|
70
|
+
GenericUri(const GenericUri& rhs, Allocator* allocator) : uri_(), base_(), scheme_(), auth_(), path_(), query_(), frag_(), allocator_(allocator), ownAllocator_() {
|
71
|
+
*this = rhs;
|
72
|
+
}
|
73
|
+
|
74
|
+
//! Destructor.
|
75
|
+
~GenericUri() {
|
76
|
+
Free();
|
77
|
+
RAPIDJSON_DELETE(ownAllocator_);
|
78
|
+
}
|
79
|
+
|
80
|
+
//! Assignment operator
|
81
|
+
GenericUri& operator=(const GenericUri& rhs) {
|
82
|
+
if (this != &rhs) {
|
83
|
+
// Do not delete ownAllocator
|
84
|
+
Free();
|
85
|
+
Allocate(rhs.GetStringLength());
|
86
|
+
auth_ = CopyPart(scheme_, rhs.scheme_, rhs.GetSchemeStringLength());
|
87
|
+
path_ = CopyPart(auth_, rhs.auth_, rhs.GetAuthStringLength());
|
88
|
+
query_ = CopyPart(path_, rhs.path_, rhs.GetPathStringLength());
|
89
|
+
frag_ = CopyPart(query_, rhs.query_, rhs.GetQueryStringLength());
|
90
|
+
base_ = CopyPart(frag_, rhs.frag_, rhs.GetFragStringLength());
|
91
|
+
uri_ = CopyPart(base_, rhs.base_, rhs.GetBaseStringLength());
|
92
|
+
CopyPart(uri_, rhs.uri_, rhs.GetStringLength());
|
93
|
+
}
|
94
|
+
return *this;
|
95
|
+
}
|
96
|
+
|
97
|
+
//! Getters
|
98
|
+
// Use with specializations of GenericValue
|
99
|
+
template<typename T> void Get(T& uri, Allocator& allocator) {
|
100
|
+
uri.template Set<const Ch*>(this->GetString(), allocator); // TypeHelper from document.h
|
101
|
+
}
|
102
|
+
|
103
|
+
const Ch* GetString() const { return uri_; }
|
104
|
+
SizeType GetStringLength() const { return uri_ == 0 ? 0 : internal::StrLen<Ch>(uri_); }
|
105
|
+
const Ch* GetBaseString() const { return base_; }
|
106
|
+
SizeType GetBaseStringLength() const { return base_ == 0 ? 0 : internal::StrLen<Ch>(base_); }
|
107
|
+
const Ch* GetSchemeString() const { return scheme_; }
|
108
|
+
SizeType GetSchemeStringLength() const { return scheme_ == 0 ? 0 : internal::StrLen<Ch>(scheme_); }
|
109
|
+
const Ch* GetAuthString() const { return auth_; }
|
110
|
+
SizeType GetAuthStringLength() const { return auth_ == 0 ? 0 : internal::StrLen<Ch>(auth_); }
|
111
|
+
const Ch* GetPathString() const { return path_; }
|
112
|
+
SizeType GetPathStringLength() const { return path_ == 0 ? 0 : internal::StrLen<Ch>(path_); }
|
113
|
+
const Ch* GetQueryString() const { return query_; }
|
114
|
+
SizeType GetQueryStringLength() const { return query_ == 0 ? 0 : internal::StrLen<Ch>(query_); }
|
115
|
+
const Ch* GetFragString() const { return frag_; }
|
116
|
+
SizeType GetFragStringLength() const { return frag_ == 0 ? 0 : internal::StrLen<Ch>(frag_); }
|
117
|
+
|
118
|
+
#if RAPIDJSON_HAS_STDSTRING
|
119
|
+
static String Get(const GenericUri& uri) { return String(uri.GetString(), uri.GetStringLength()); }
|
120
|
+
static String GetBase(const GenericUri& uri) { return String(uri.GetBaseString(), uri.GetBaseStringLength()); }
|
121
|
+
static String GetScheme(const GenericUri& uri) { return String(uri.GetSchemeString(), uri.GetSchemeStringLength()); }
|
122
|
+
static String GetAuth(const GenericUri& uri) { return String(uri.GetAuthString(), uri.GetAuthStringLength()); }
|
123
|
+
static String GetPath(const GenericUri& uri) { return String(uri.GetPathString(), uri.GetPathStringLength()); }
|
124
|
+
static String GetQuery(const GenericUri& uri) { return String(uri.GetQueryString(), uri.GetQueryStringLength()); }
|
125
|
+
static String GetFrag(const GenericUri& uri) { return String(uri.GetFragString(), uri.GetFragStringLength()); }
|
126
|
+
#endif
|
127
|
+
|
128
|
+
//! Equality operators
|
129
|
+
bool operator==(const GenericUri& rhs) const {
|
130
|
+
return Match(rhs, true);
|
131
|
+
}
|
132
|
+
|
133
|
+
bool operator!=(const GenericUri& rhs) const {
|
134
|
+
return !Match(rhs, true);
|
135
|
+
}
|
136
|
+
|
137
|
+
bool Match(const GenericUri& uri, bool full = true) const {
|
138
|
+
Ch* s1;
|
139
|
+
Ch* s2;
|
140
|
+
if (full) {
|
141
|
+
s1 = uri_;
|
142
|
+
s2 = uri.uri_;
|
143
|
+
} else {
|
144
|
+
s1 = base_;
|
145
|
+
s2 = uri.base_;
|
146
|
+
}
|
147
|
+
if (s1 == s2) return true;
|
148
|
+
if (s1 == 0 || s2 == 0) return false;
|
149
|
+
return internal::StrCmp<Ch>(s1, s2) == 0;
|
150
|
+
}
|
151
|
+
|
152
|
+
//! Resolve this URI against another (base) URI in accordance with URI resolution rules.
|
153
|
+
// See https://tools.ietf.org/html/rfc3986
|
154
|
+
// Use for resolving an id or $ref with an in-scope id.
|
155
|
+
// Returns a new GenericUri for the resolved URI.
|
156
|
+
GenericUri Resolve(const GenericUri& baseuri, Allocator* allocator = 0) {
|
157
|
+
GenericUri resuri;
|
158
|
+
resuri.allocator_ = allocator;
|
159
|
+
// Ensure enough space for combining paths
|
160
|
+
resuri.Allocate(GetStringLength() + baseuri.GetStringLength() + 1); // + 1 for joining slash
|
161
|
+
|
162
|
+
if (!(GetSchemeStringLength() == 0)) {
|
163
|
+
// Use all of this URI
|
164
|
+
resuri.auth_ = CopyPart(resuri.scheme_, scheme_, GetSchemeStringLength());
|
165
|
+
resuri.path_ = CopyPart(resuri.auth_, auth_, GetAuthStringLength());
|
166
|
+
resuri.query_ = CopyPart(resuri.path_, path_, GetPathStringLength());
|
167
|
+
resuri.frag_ = CopyPart(resuri.query_, query_, GetQueryStringLength());
|
168
|
+
resuri.RemoveDotSegments();
|
169
|
+
} else {
|
170
|
+
// Use the base scheme
|
171
|
+
resuri.auth_ = CopyPart(resuri.scheme_, baseuri.scheme_, baseuri.GetSchemeStringLength());
|
172
|
+
if (!(GetAuthStringLength() == 0)) {
|
173
|
+
// Use this auth, path, query
|
174
|
+
resuri.path_ = CopyPart(resuri.auth_, auth_, GetAuthStringLength());
|
175
|
+
resuri.query_ = CopyPart(resuri.path_, path_, GetPathStringLength());
|
176
|
+
resuri.frag_ = CopyPart(resuri.query_, query_, GetQueryStringLength());
|
177
|
+
resuri.RemoveDotSegments();
|
178
|
+
} else {
|
179
|
+
// Use the base auth
|
180
|
+
resuri.path_ = CopyPart(resuri.auth_, baseuri.auth_, baseuri.GetAuthStringLength());
|
181
|
+
if (GetPathStringLength() == 0) {
|
182
|
+
// Use the base path
|
183
|
+
resuri.query_ = CopyPart(resuri.path_, baseuri.path_, baseuri.GetPathStringLength());
|
184
|
+
if (GetQueryStringLength() == 0) {
|
185
|
+
// Use the base query
|
186
|
+
resuri.frag_ = CopyPart(resuri.query_, baseuri.query_, baseuri.GetQueryStringLength());
|
187
|
+
} else {
|
188
|
+
// Use this query
|
189
|
+
resuri.frag_ = CopyPart(resuri.query_, query_, GetQueryStringLength());
|
190
|
+
}
|
191
|
+
} else {
|
192
|
+
if (path_[0] == '/') {
|
193
|
+
// Absolute path - use all of this path
|
194
|
+
resuri.query_ = CopyPart(resuri.path_, path_, GetPathStringLength());
|
195
|
+
resuri.RemoveDotSegments();
|
196
|
+
} else {
|
197
|
+
// Relative path - append this path to base path after base path's last slash
|
198
|
+
size_t pos = 0;
|
199
|
+
if (!(baseuri.GetAuthStringLength() == 0) && baseuri.GetPathStringLength() == 0) {
|
200
|
+
resuri.path_[pos] = '/';
|
201
|
+
pos++;
|
202
|
+
}
|
203
|
+
size_t lastslashpos = baseuri.GetPathStringLength();
|
204
|
+
while (lastslashpos > 0) {
|
205
|
+
if (baseuri.path_[lastslashpos - 1] == '/') break;
|
206
|
+
lastslashpos--;
|
207
|
+
}
|
208
|
+
std::memcpy(&resuri.path_[pos], baseuri.path_, lastslashpos * sizeof(Ch));
|
209
|
+
pos += lastslashpos;
|
210
|
+
resuri.query_ = CopyPart(&resuri.path_[pos], path_, GetPathStringLength());
|
211
|
+
resuri.RemoveDotSegments();
|
212
|
+
}
|
213
|
+
// Use this query
|
214
|
+
resuri.frag_ = CopyPart(resuri.query_, query_, GetQueryStringLength());
|
215
|
+
}
|
216
|
+
}
|
217
|
+
}
|
218
|
+
// Always use this frag
|
219
|
+
resuri.base_ = CopyPart(resuri.frag_, frag_, GetFragStringLength());
|
220
|
+
|
221
|
+
// Re-constitute base_ and uri_
|
222
|
+
resuri.SetBase();
|
223
|
+
resuri.uri_ = resuri.base_ + resuri.GetBaseStringLength() + 1;
|
224
|
+
resuri.SetUri();
|
225
|
+
return resuri;
|
226
|
+
}
|
227
|
+
|
228
|
+
//! Get the allocator of this GenericUri.
|
229
|
+
Allocator& GetAllocator() { return *allocator_; }
|
230
|
+
|
231
|
+
private:
|
232
|
+
// Allocate memory for a URI
|
233
|
+
// Returns total amount allocated
|
234
|
+
std::size_t Allocate(std::size_t len) {
|
235
|
+
// Create own allocator if user did not supply.
|
236
|
+
if (!allocator_)
|
237
|
+
ownAllocator_ = allocator_ = RAPIDJSON_NEW(Allocator)();
|
238
|
+
|
239
|
+
// Allocate one block containing each part of the URI (5) plus base plus full URI, all null terminated.
|
240
|
+
// Order: scheme, auth, path, query, frag, base, uri
|
241
|
+
size_t total = (3 * len + 7) * sizeof(Ch);
|
242
|
+
scheme_ = static_cast<Ch*>(allocator_->Malloc(total));
|
243
|
+
*scheme_ = '\0';
|
244
|
+
auth_ = scheme_ + 1;
|
245
|
+
*auth_ = '\0';
|
246
|
+
path_ = auth_ + 1;
|
247
|
+
*path_ = '\0';
|
248
|
+
query_ = path_ + 1;
|
249
|
+
*query_ = '\0';
|
250
|
+
frag_ = query_ + 1;
|
251
|
+
*frag_ = '\0';
|
252
|
+
base_ = frag_ + 1;
|
253
|
+
*base_ = '\0';
|
254
|
+
uri_ = base_ + 1;
|
255
|
+
*uri_ = '\0';
|
256
|
+
return total;
|
257
|
+
}
|
258
|
+
|
259
|
+
// Free memory for a URI
|
260
|
+
void Free() {
|
261
|
+
if (scheme_) {
|
262
|
+
Allocator::Free(scheme_);
|
263
|
+
scheme_ = 0;
|
264
|
+
}
|
265
|
+
}
|
266
|
+
|
267
|
+
// Parse a URI into constituent scheme, authority, path, query, & fragment parts
|
268
|
+
// Supports URIs that match regex ^(([^:/?#]+):)?(//([^/?#]*))?([^?#]*)(\?([^#]*))?(#(.*))? as per
|
269
|
+
// https://tools.ietf.org/html/rfc3986
|
270
|
+
void Parse(const Ch* uri, std::size_t len) {
|
271
|
+
std::size_t start = 0, pos1 = 0, pos2 = 0;
|
272
|
+
Allocate(len);
|
273
|
+
|
274
|
+
// Look for scheme ([^:/?#]+):)?
|
275
|
+
if (start < len) {
|
276
|
+
while (pos1 < len) {
|
277
|
+
if (uri[pos1] == ':') break;
|
278
|
+
pos1++;
|
279
|
+
}
|
280
|
+
if (pos1 != len) {
|
281
|
+
while (pos2 < len) {
|
282
|
+
if (uri[pos2] == '/') break;
|
283
|
+
if (uri[pos2] == '?') break;
|
284
|
+
if (uri[pos2] == '#') break;
|
285
|
+
pos2++;
|
286
|
+
}
|
287
|
+
if (pos1 < pos2) {
|
288
|
+
pos1++;
|
289
|
+
std::memcpy(scheme_, &uri[start], pos1 * sizeof(Ch));
|
290
|
+
scheme_[pos1] = '\0';
|
291
|
+
start = pos1;
|
292
|
+
}
|
293
|
+
}
|
294
|
+
}
|
295
|
+
// Look for auth (//([^/?#]*))?
|
296
|
+
auth_ = scheme_ + GetSchemeStringLength() + 1;
|
297
|
+
*auth_ = '\0';
|
298
|
+
if (start < len - 1 && uri[start] == '/' && uri[start + 1] == '/') {
|
299
|
+
pos2 = start + 2;
|
300
|
+
while (pos2 < len) {
|
301
|
+
if (uri[pos2] == '/') break;
|
302
|
+
if (uri[pos2] == '?') break;
|
303
|
+
if (uri[pos2] == '#') break;
|
304
|
+
pos2++;
|
305
|
+
}
|
306
|
+
std::memcpy(auth_, &uri[start], (pos2 - start) * sizeof(Ch));
|
307
|
+
auth_[pos2 - start] = '\0';
|
308
|
+
start = pos2;
|
309
|
+
}
|
310
|
+
// Look for path ([^?#]*)
|
311
|
+
path_ = auth_ + GetAuthStringLength() + 1;
|
312
|
+
*path_ = '\0';
|
313
|
+
if (start < len) {
|
314
|
+
pos2 = start;
|
315
|
+
while (pos2 < len) {
|
316
|
+
if (uri[pos2] == '?') break;
|
317
|
+
if (uri[pos2] == '#') break;
|
318
|
+
pos2++;
|
319
|
+
}
|
320
|
+
if (start != pos2) {
|
321
|
+
std::memcpy(path_, &uri[start], (pos2 - start) * sizeof(Ch));
|
322
|
+
path_[pos2 - start] = '\0';
|
323
|
+
if (path_[0] == '/')
|
324
|
+
RemoveDotSegments(); // absolute path - normalize
|
325
|
+
start = pos2;
|
326
|
+
}
|
327
|
+
}
|
328
|
+
// Look for query (\?([^#]*))?
|
329
|
+
query_ = path_ + GetPathStringLength() + 1;
|
330
|
+
*query_ = '\0';
|
331
|
+
if (start < len && uri[start] == '?') {
|
332
|
+
pos2 = start + 1;
|
333
|
+
while (pos2 < len) {
|
334
|
+
if (uri[pos2] == '#') break;
|
335
|
+
pos2++;
|
336
|
+
}
|
337
|
+
if (start != pos2) {
|
338
|
+
std::memcpy(query_, &uri[start], (pos2 - start) * sizeof(Ch));
|
339
|
+
query_[pos2 - start] = '\0';
|
340
|
+
start = pos2;
|
341
|
+
}
|
342
|
+
}
|
343
|
+
// Look for fragment (#(.*))?
|
344
|
+
frag_ = query_ + GetQueryStringLength() + 1;
|
345
|
+
*frag_ = '\0';
|
346
|
+
if (start < len && uri[start] == '#') {
|
347
|
+
std::memcpy(frag_, &uri[start], (len - start) * sizeof(Ch));
|
348
|
+
frag_[len - start] = '\0';
|
349
|
+
}
|
350
|
+
|
351
|
+
// Re-constitute base_ and uri_
|
352
|
+
base_ = frag_ + GetFragStringLength() + 1;
|
353
|
+
SetBase();
|
354
|
+
uri_ = base_ + GetBaseStringLength() + 1;
|
355
|
+
SetUri();
|
356
|
+
}
|
357
|
+
|
358
|
+
// Reconstitute base
|
359
|
+
void SetBase() {
|
360
|
+
Ch* next = base_;
|
361
|
+
std::memcpy(next, scheme_, GetSchemeStringLength() * sizeof(Ch));
|
362
|
+
next+= GetSchemeStringLength();
|
363
|
+
std::memcpy(next, auth_, GetAuthStringLength() * sizeof(Ch));
|
364
|
+
next+= GetAuthStringLength();
|
365
|
+
std::memcpy(next, path_, GetPathStringLength() * sizeof(Ch));
|
366
|
+
next+= GetPathStringLength();
|
367
|
+
std::memcpy(next, query_, GetQueryStringLength() * sizeof(Ch));
|
368
|
+
next+= GetQueryStringLength();
|
369
|
+
*next = '\0';
|
370
|
+
}
|
371
|
+
|
372
|
+
// Reconstitute uri
|
373
|
+
void SetUri() {
|
374
|
+
Ch* next = uri_;
|
375
|
+
std::memcpy(next, base_, GetBaseStringLength() * sizeof(Ch));
|
376
|
+
next+= GetBaseStringLength();
|
377
|
+
std::memcpy(next, frag_, GetFragStringLength() * sizeof(Ch));
|
378
|
+
next+= GetFragStringLength();
|
379
|
+
*next = '\0';
|
380
|
+
}
|
381
|
+
|
382
|
+
// Copy a part from one GenericUri to another
|
383
|
+
// Return the pointer to the next part to be copied to
|
384
|
+
Ch* CopyPart(Ch* to, Ch* from, std::size_t len) {
|
385
|
+
RAPIDJSON_ASSERT(to != 0);
|
386
|
+
RAPIDJSON_ASSERT(from != 0);
|
387
|
+
std::memcpy(to, from, len * sizeof(Ch));
|
388
|
+
to[len] = '\0';
|
389
|
+
Ch* next = to + len + 1;
|
390
|
+
return next;
|
391
|
+
}
|
392
|
+
|
393
|
+
// Remove . and .. segments from the path_ member.
|
394
|
+
// https://tools.ietf.org/html/rfc3986
|
395
|
+
// This is done in place as we are only removing segments.
|
396
|
+
void RemoveDotSegments() {
|
397
|
+
std::size_t pathlen = GetPathStringLength();
|
398
|
+
std::size_t pathpos = 0; // Position in path_
|
399
|
+
std::size_t newpos = 0; // Position in new path_
|
400
|
+
|
401
|
+
// Loop through each segment in original path_
|
402
|
+
while (pathpos < pathlen) {
|
403
|
+
// Get next segment, bounded by '/' or end
|
404
|
+
size_t slashpos = 0;
|
405
|
+
while ((pathpos + slashpos) < pathlen) {
|
406
|
+
if (path_[pathpos + slashpos] == '/') break;
|
407
|
+
slashpos++;
|
408
|
+
}
|
409
|
+
// Check for .. and . segments
|
410
|
+
if (slashpos == 2 && path_[pathpos] == '.' && path_[pathpos + 1] == '.') {
|
411
|
+
// Backup a .. segment in the new path_
|
412
|
+
// We expect to find a previously added slash at the end or nothing
|
413
|
+
RAPIDJSON_ASSERT(newpos == 0 || path_[newpos - 1] == '/');
|
414
|
+
size_t lastslashpos = newpos;
|
415
|
+
// Make sure we don't go beyond the start segment
|
416
|
+
if (lastslashpos > 1) {
|
417
|
+
// Find the next to last slash and back up to it
|
418
|
+
lastslashpos--;
|
419
|
+
while (lastslashpos > 0) {
|
420
|
+
if (path_[lastslashpos - 1] == '/') break;
|
421
|
+
lastslashpos--;
|
422
|
+
}
|
423
|
+
// Set the new path_ position
|
424
|
+
newpos = lastslashpos;
|
425
|
+
}
|
426
|
+
} else if (slashpos == 1 && path_[pathpos] == '.') {
|
427
|
+
// Discard . segment, leaves new path_ unchanged
|
428
|
+
} else {
|
429
|
+
// Move any other kind of segment to the new path_
|
430
|
+
RAPIDJSON_ASSERT(newpos <= pathpos);
|
431
|
+
std::memmove(&path_[newpos], &path_[pathpos], slashpos * sizeof(Ch));
|
432
|
+
newpos += slashpos;
|
433
|
+
// Add slash if not at end
|
434
|
+
if ((pathpos + slashpos) < pathlen) {
|
435
|
+
path_[newpos] = '/';
|
436
|
+
newpos++;
|
437
|
+
}
|
438
|
+
}
|
439
|
+
// Move to next segment
|
440
|
+
pathpos += slashpos + 1;
|
441
|
+
}
|
442
|
+
path_[newpos] = '\0';
|
443
|
+
}
|
444
|
+
|
445
|
+
Ch* uri_; // Everything
|
446
|
+
Ch* base_; // Everything except fragment
|
447
|
+
Ch* scheme_; // Includes the :
|
448
|
+
Ch* auth_; // Includes the //
|
449
|
+
Ch* path_; // Absolute if starts with /
|
450
|
+
Ch* query_; // Includes the ?
|
451
|
+
Ch* frag_; // Includes the #
|
452
|
+
|
453
|
+
Allocator* allocator_; //!< The current allocator. It is either user-supplied or equal to ownAllocator_.
|
454
|
+
Allocator* ownAllocator_; //!< Allocator owned by this Uri.
|
455
|
+
};
|
456
|
+
|
457
|
+
//! GenericUri for Value (UTF-8, default allocator).
|
458
|
+
typedef GenericUri<Value> Uri;
|
459
|
+
|
460
|
+
RAPIDJSON_NAMESPACE_END
|
461
|
+
|
462
|
+
#if defined(__clang__)
|
463
|
+
RAPIDJSON_DIAG_POP
|
464
|
+
#endif
|
465
|
+
|
466
|
+
#endif // RAPIDJSON_URI_H_
|