diff --git a/include/valijson/utils/utf8_utils.hpp b/include/valijson/utils/utf8_utils.hpp new file mode 100644 index 0000000..fadc06a --- /dev/null +++ b/include/valijson/utils/utf8_utils.hpp @@ -0,0 +1,53 @@ +#ifndef __VALIJSON_UTILS_UTF8_UTILS_HPP +#define __VALIJSON_UTILS_UTF8_UTILS_HPP + +/* + Basic UTF-8 manipulation routines, adapted from code that was released into + the public domain by Jeff Bezanson. +*/ + +namespace valijson { +namespace utils { + +static const u_int32_t offsetsFromUTF8[6] = { + 0x00000000UL, 0x00003080UL, 0x000E2080UL, + 0x03C82080UL, 0xFA082080UL, 0x82082080UL +}; + +/* is c the start of a utf8 sequence? */ +inline bool isutf(char c) { + return ((c & 0xC0) != 0x80); +} + +/* reads the next utf-8 sequence out of a string, updating an index */ +inline u_int32_t u8_nextchar(const char *s, int *i) +{ + u_int32_t ch = 0; + int sz = 0; + + do { + ch <<= 6; + ch += (unsigned char)s[(*i)++]; + sz++; + } while (s[*i] && !isutf(s[*i])); + ch -= offsetsFromUTF8[sz-1]; + + return ch; +} + +/* number of characters */ +inline int u8_strlen(const char *s) +{ + int count = 0; + int i = 0; + + while (u8_nextchar(s, &i) != 0) + count++; + + return count; +} + +} // namespace utils +} // namespace valijson + +#endif diff --git a/include/valijson/validation_visitor.hpp b/include/valijson/validation_visitor.hpp index 041d65f..1a3d10e 100644 --- a/include/valijson/validation_visitor.hpp +++ b/include/valijson/validation_visitor.hpp @@ -8,6 +8,8 @@ #include #include +#include + namespace valijson { class ValidationResults; @@ -465,14 +467,17 @@ public: */ virtual bool visit(const MaxLengthConstraint &constraint) { - if (target.isString() && - target.getString().size() > constraint.maxLength) { - if (results) { - results->pushError(context, "String should be no more than " + - boost::lexical_cast(constraint.maxLength) + - " characters in length."); + if (target.isString()) { + const std::string s = target.getString(); + const int len = utils::u8_strlen(s.c_str()); + if (len > constraint.maxLength) { + if (results) { + results->pushError(context, "String should be no more than " + + boost::lexical_cast(constraint.maxLength) + + " characters in length."); + } + return false; } - return false; } return true; @@ -572,14 +577,17 @@ public: */ virtual bool visit(const MinLengthConstraint &constraint) { - if (target.isString() && - target.getString().size() < constraint.minLength) { - if (results) { - results->pushError(context, "String should be no fewer than " + - boost::lexical_cast(constraint.minLength) + - " characters in length."); + if (target.isString()) { + const std::string s = target.getString(); + const int len = utils::u8_strlen(s.c_str()); + if (len < constraint.minLength) { + if (results) { + results->pushError(context, "String should be no fewer than " + + boost::lexical_cast(constraint.minLength) + + " characters in length."); + } + return false; } - return false; } return true; diff --git a/thirdparty/JSON-Schema-Test-Suite/LICENSE b/thirdparty/JSON-Schema-Test-Suite/LICENSE old mode 100755 new mode 100644 diff --git a/thirdparty/JSON-Schema-Test-Suite/README.md b/thirdparty/JSON-Schema-Test-Suite/README.md old mode 100755 new mode 100644 index ba8f255..12c49c0 --- a/thirdparty/JSON-Schema-Test-Suite/README.md +++ b/thirdparty/JSON-Schema-Test-Suite/README.md @@ -1,4 +1,4 @@ -JSON Schema Test Suite +JSON Schema Test Suite [![Build Status](https://travis-ci.org/json-schema/JSON-Schema-Test-Suite.png?branch=develop)](https://travis-ci.org/json-schema/JSON-Schema-Test-Suite) ====================== This repository contains a set of JSON objects that implementors of JSON Schema @@ -67,9 +67,14 @@ This suite is being used by: * [jsonschema (javascript)](https://github.com/tdegrunt/jsonschema) * [JaySchema (javascript)](https://github.com/natesilva/jayschema) * [z-schema (javascript)](https://github.com/zaggino/z-schema) + * [jassi (javascript)](https://github.com/iclanzan/jassi) + * [json-schema-valid (javascript)](https://github.com/ericgj/json-schema-valid) * [jesse (Erlang)](https://github.com/klarna/jesse) * [json-schema (PHP)](https://github.com/justinrainbow/json-schema) * [gojsonschema (Go)](https://github.com/sigu-399/gojsonschema) + * [json_schema (Dart)](https://github.com/patefacio/json_schema) + * [tv4 (JavaScript)](https://github.com/geraintluff/tv4) + * [Jsonary (JavaScript)](https://github.com/jsonary-js/jsonary) If you use it as well, please fork and send a pull request adding yourself to the list :). @@ -78,3 +83,7 @@ Contributing ------------ If you see something missing or incorrect, a pull request is most welcome! + +There are some sanity checks in place for testing the test suite. You can run +them with `bin/jsonschema_suite check`. They will be run automatically by +[Travis CI](https://travis-ci.org/) as well. diff --git a/thirdparty/JSON-Schema-Test-Suite/tests/draft3/additionalItems.json b/thirdparty/JSON-Schema-Test-Suite/tests/draft3/additionalItems.json old mode 100755 new mode 100644 diff --git a/thirdparty/JSON-Schema-Test-Suite/tests/draft3/additionalProperties.json b/thirdparty/JSON-Schema-Test-Suite/tests/draft3/additionalProperties.json old mode 100755 new mode 100644 index c997f75..eb334c9 --- a/thirdparty/JSON-Schema-Test-Suite/tests/draft3/additionalProperties.json +++ b/thirdparty/JSON-Schema-Test-Suite/tests/draft3/additionalProperties.json @@ -4,6 +4,7 @@ "additionalProperties being false does not allow other properties", "schema": { "properties": {"foo": {}, "bar": {}}, + "patternProperties": { "^v": {} }, "additionalProperties": false }, "tests": [ @@ -21,6 +22,11 @@ "description": "ignores non-objects", "data": [1, 2, 3], "valid": true + }, + { + "description": "patternProperties are not additional properties", + "data": {"foo":1, "vroom": 2}, + "valid": true } ] }, diff --git a/thirdparty/JSON-Schema-Test-Suite/tests/draft3/dependencies.json b/thirdparty/JSON-Schema-Test-Suite/tests/draft3/dependencies.json old mode 100755 new mode 100644 diff --git a/thirdparty/JSON-Schema-Test-Suite/tests/draft3/disallow.json b/thirdparty/JSON-Schema-Test-Suite/tests/draft3/disallow.json old mode 100755 new mode 100644 diff --git a/thirdparty/JSON-Schema-Test-Suite/tests/draft3/divisibleBy.json b/thirdparty/JSON-Schema-Test-Suite/tests/draft3/divisibleBy.json old mode 100755 new mode 100644 diff --git a/thirdparty/JSON-Schema-Test-Suite/tests/draft3/enum.json b/thirdparty/JSON-Schema-Test-Suite/tests/draft3/enum.json old mode 100755 new mode 100644 index a539edb..0c83f08 --- a/thirdparty/JSON-Schema-Test-Suite/tests/draft3/enum.json +++ b/thirdparty/JSON-Schema-Test-Suite/tests/draft3/enum.json @@ -35,5 +35,37 @@ "valid": false } ] + }, + { + "description": "enums in properties", + "schema": { + "type":"object", + "properties": { + "foo": {"enum":["foo"]}, + "bar": {"enum":["bar"], "required":true} + } + }, + "tests": [ + { + "description": "both properties are valid", + "data": {"foo":"foo", "bar":"bar"}, + "valid": true + }, + { + "description": "missing optional property is valid", + "data": {"bar":"bar"}, + "valid": true + }, + { + "description": "missing required property is invalid", + "data": {"foo":"foo"}, + "valid": false + }, + { + "description": "missing all properties is invalid", + "data": {}, + "valid": false + } + ] } ] diff --git a/thirdparty/JSON-Schema-Test-Suite/tests/draft3/extends.json b/thirdparty/JSON-Schema-Test-Suite/tests/draft3/extends.json old mode 100755 new mode 100644 diff --git a/thirdparty/JSON-Schema-Test-Suite/tests/draft3/items.json b/thirdparty/JSON-Schema-Test-Suite/tests/draft3/items.json old mode 100755 new mode 100644 diff --git a/thirdparty/JSON-Schema-Test-Suite/tests/draft3/maxItems.json b/thirdparty/JSON-Schema-Test-Suite/tests/draft3/maxItems.json old mode 100755 new mode 100644 diff --git a/thirdparty/JSON-Schema-Test-Suite/tests/draft3/maxLength.json b/thirdparty/JSON-Schema-Test-Suite/tests/draft3/maxLength.json old mode 100755 new mode 100644 index 561767b..4de42bc --- a/thirdparty/JSON-Schema-Test-Suite/tests/draft3/maxLength.json +++ b/thirdparty/JSON-Schema-Test-Suite/tests/draft3/maxLength.json @@ -22,6 +22,11 @@ "description": "ignores non-strings", "data": 10, "valid": true + }, + { + "description": "two supplementary Unicode code points is long enough", + "data": "\uD83D\uDCA9\uD83D\uDCA9", + "valid": true } ] } diff --git a/thirdparty/JSON-Schema-Test-Suite/tests/draft3/maximum.json b/thirdparty/JSON-Schema-Test-Suite/tests/draft3/maximum.json old mode 100755 new mode 100644 diff --git a/thirdparty/JSON-Schema-Test-Suite/tests/draft3/minItems.json b/thirdparty/JSON-Schema-Test-Suite/tests/draft3/minItems.json old mode 100755 new mode 100644 diff --git a/thirdparty/JSON-Schema-Test-Suite/tests/draft3/minLength.json b/thirdparty/JSON-Schema-Test-Suite/tests/draft3/minLength.json old mode 100755 new mode 100644 index e9c14b1..3f09158 --- a/thirdparty/JSON-Schema-Test-Suite/tests/draft3/minLength.json +++ b/thirdparty/JSON-Schema-Test-Suite/tests/draft3/minLength.json @@ -22,6 +22,11 @@ "description": "ignores non-strings", "data": 1, "valid": true + }, + { + "description": "one supplementary Unicode code point is not long enough", + "data": "\uD83D\uDCA9", + "valid": false } ] } diff --git a/thirdparty/JSON-Schema-Test-Suite/tests/draft3/minimum.json b/thirdparty/JSON-Schema-Test-Suite/tests/draft3/minimum.json old mode 100755 new mode 100644 diff --git a/thirdparty/JSON-Schema-Test-Suite/tests/draft3/optional/bignum.json b/thirdparty/JSON-Schema-Test-Suite/tests/draft3/optional/bignum.json old mode 100755 new mode 100644 index 7b4755c..cd47994 --- a/thirdparty/JSON-Schema-Test-Suite/tests/draft3/optional/bignum.json +++ b/thirdparty/JSON-Schema-Test-Suite/tests/draft3/optional/bignum.json @@ -32,6 +32,17 @@ } ] }, + { + "description": "integer comparison", + "schema": {"maximum": 18446744073709551615}, + "tests": [ + { + "description": "comparison works for high numbers", + "data": 18446744073709551600, + "valid": true + } + ] + }, { "description": "float comparison with high precision", "schema": { diff --git a/thirdparty/JSON-Schema-Test-Suite/tests/draft3/optional/format.json b/thirdparty/JSON-Schema-Test-Suite/tests/draft3/optional/format.json old mode 100755 new mode 100644 index 1ff461a..fc86b03 --- a/thirdparty/JSON-Schema-Test-Suite/tests/draft3/optional/format.json +++ b/thirdparty/JSON-Schema-Test-Suite/tests/draft3/optional/format.json @@ -81,6 +81,11 @@ "description": "an invalid URI", "data": "\\\\WINDOWS\\fileshare", "valid": false + }, + { + "description": "an invalid URI though valid URI reference", + "data": "abc", + "valid": false } ] }, diff --git a/thirdparty/JSON-Schema-Test-Suite/tests/draft3/optional/jsregex.json b/thirdparty/JSON-Schema-Test-Suite/tests/draft3/optional/jsregex.json old mode 100755 new mode 100644 diff --git a/thirdparty/JSON-Schema-Test-Suite/tests/draft3/optional/zeroTerminatedFloats.json b/thirdparty/JSON-Schema-Test-Suite/tests/draft3/optional/zeroTerminatedFloats.json old mode 100755 new mode 100644 diff --git a/thirdparty/JSON-Schema-Test-Suite/tests/draft3/pattern.json b/thirdparty/JSON-Schema-Test-Suite/tests/draft3/pattern.json old mode 100755 new mode 100644 diff --git a/thirdparty/JSON-Schema-Test-Suite/tests/draft3/patternProperties.json b/thirdparty/JSON-Schema-Test-Suite/tests/draft3/patternProperties.json old mode 100755 new mode 100644 diff --git a/thirdparty/JSON-Schema-Test-Suite/tests/draft3/properties.json b/thirdparty/JSON-Schema-Test-Suite/tests/draft3/properties.json old mode 100755 new mode 100644 diff --git a/thirdparty/JSON-Schema-Test-Suite/tests/draft3/ref.json b/thirdparty/JSON-Schema-Test-Suite/tests/draft3/ref.json old mode 100755 new mode 100644 diff --git a/thirdparty/JSON-Schema-Test-Suite/tests/draft3/refRemote.json b/thirdparty/JSON-Schema-Test-Suite/tests/draft3/refRemote.json old mode 100755 new mode 100644 diff --git a/thirdparty/JSON-Schema-Test-Suite/tests/draft3/required.json b/thirdparty/JSON-Schema-Test-Suite/tests/draft3/required.json old mode 100755 new mode 100644 diff --git a/thirdparty/JSON-Schema-Test-Suite/tests/draft3/type.json b/thirdparty/JSON-Schema-Test-Suite/tests/draft3/type.json old mode 100755 new mode 100644 diff --git a/thirdparty/JSON-Schema-Test-Suite/tests/draft3/uniqueItems.json b/thirdparty/JSON-Schema-Test-Suite/tests/draft3/uniqueItems.json old mode 100755 new mode 100644 diff --git a/thirdparty/JSON-Schema-Test-Suite/tests/draft4/additionalItems.json b/thirdparty/JSON-Schema-Test-Suite/tests/draft4/additionalItems.json old mode 100755 new mode 100644 diff --git a/thirdparty/JSON-Schema-Test-Suite/tests/draft4/additionalProperties.json b/thirdparty/JSON-Schema-Test-Suite/tests/draft4/additionalProperties.json old mode 100755 new mode 100644 index c997f75..eb334c9 --- a/thirdparty/JSON-Schema-Test-Suite/tests/draft4/additionalProperties.json +++ b/thirdparty/JSON-Schema-Test-Suite/tests/draft4/additionalProperties.json @@ -4,6 +4,7 @@ "additionalProperties being false does not allow other properties", "schema": { "properties": {"foo": {}, "bar": {}}, + "patternProperties": { "^v": {} }, "additionalProperties": false }, "tests": [ @@ -21,6 +22,11 @@ "description": "ignores non-objects", "data": [1, 2, 3], "valid": true + }, + { + "description": "patternProperties are not additional properties", + "data": {"foo":1, "vroom": 2}, + "valid": true } ] }, diff --git a/thirdparty/JSON-Schema-Test-Suite/tests/draft4/allOf.json b/thirdparty/JSON-Schema-Test-Suite/tests/draft4/allOf.json old mode 100755 new mode 100644 diff --git a/thirdparty/JSON-Schema-Test-Suite/tests/draft4/anyOf.json b/thirdparty/JSON-Schema-Test-Suite/tests/draft4/anyOf.json old mode 100755 new mode 100644 diff --git a/thirdparty/JSON-Schema-Test-Suite/tests/draft4/definitions.json b/thirdparty/JSON-Schema-Test-Suite/tests/draft4/definitions.json old mode 100755 new mode 100644 diff --git a/thirdparty/JSON-Schema-Test-Suite/tests/draft4/dependencies.json b/thirdparty/JSON-Schema-Test-Suite/tests/draft4/dependencies.json old mode 100755 new mode 100644 diff --git a/thirdparty/JSON-Schema-Test-Suite/tests/draft4/enum.json b/thirdparty/JSON-Schema-Test-Suite/tests/draft4/enum.json old mode 100755 new mode 100644 index a539edb..f124436 --- a/thirdparty/JSON-Schema-Test-Suite/tests/draft4/enum.json +++ b/thirdparty/JSON-Schema-Test-Suite/tests/draft4/enum.json @@ -35,5 +35,38 @@ "valid": false } ] + }, + { + "description": "enums in properties", + "schema": { + "type":"object", + "properties": { + "foo": {"enum":["foo"]}, + "bar": {"enum":["bar"]} + }, + "required": ["bar"] + }, + "tests": [ + { + "description": "both properties are valid", + "data": {"foo":"foo", "bar":"bar"}, + "valid": true + }, + { + "description": "missing optional property is valid", + "data": {"bar":"bar"}, + "valid": true + }, + { + "description": "missing required property is invalid", + "data": {"foo":"foo"}, + "valid": false + }, + { + "description": "missing all properties is invalid", + "data": {}, + "valid": false + } + ] } ] diff --git a/thirdparty/JSON-Schema-Test-Suite/tests/draft4/items.json b/thirdparty/JSON-Schema-Test-Suite/tests/draft4/items.json old mode 100755 new mode 100644 diff --git a/thirdparty/JSON-Schema-Test-Suite/tests/draft4/maxItems.json b/thirdparty/JSON-Schema-Test-Suite/tests/draft4/maxItems.json old mode 100755 new mode 100644 diff --git a/thirdparty/JSON-Schema-Test-Suite/tests/draft4/maxLength.json b/thirdparty/JSON-Schema-Test-Suite/tests/draft4/maxLength.json old mode 100755 new mode 100644 index 561767b..811d35b --- a/thirdparty/JSON-Schema-Test-Suite/tests/draft4/maxLength.json +++ b/thirdparty/JSON-Schema-Test-Suite/tests/draft4/maxLength.json @@ -20,7 +20,12 @@ }, { "description": "ignores non-strings", - "data": 10, + "data": 100, + "valid": true + }, + { + "description": "two supplementary Unicode code points is long enough", + "data": "\uD83D\uDCA9\uD83D\uDCA9", "valid": true } ] diff --git a/thirdparty/JSON-Schema-Test-Suite/tests/draft4/maxProperties.json b/thirdparty/JSON-Schema-Test-Suite/tests/draft4/maxProperties.json old mode 100755 new mode 100644 diff --git a/thirdparty/JSON-Schema-Test-Suite/tests/draft4/maximum.json b/thirdparty/JSON-Schema-Test-Suite/tests/draft4/maximum.json old mode 100755 new mode 100644 diff --git a/thirdparty/JSON-Schema-Test-Suite/tests/draft4/minItems.json b/thirdparty/JSON-Schema-Test-Suite/tests/draft4/minItems.json old mode 100755 new mode 100644 diff --git a/thirdparty/JSON-Schema-Test-Suite/tests/draft4/minLength.json b/thirdparty/JSON-Schema-Test-Suite/tests/draft4/minLength.json old mode 100755 new mode 100644 index e9c14b1..3f09158 --- a/thirdparty/JSON-Schema-Test-Suite/tests/draft4/minLength.json +++ b/thirdparty/JSON-Schema-Test-Suite/tests/draft4/minLength.json @@ -22,6 +22,11 @@ "description": "ignores non-strings", "data": 1, "valid": true + }, + { + "description": "one supplementary Unicode code point is not long enough", + "data": "\uD83D\uDCA9", + "valid": false } ] } diff --git a/thirdparty/JSON-Schema-Test-Suite/tests/draft4/minProperties.json b/thirdparty/JSON-Schema-Test-Suite/tests/draft4/minProperties.json old mode 100755 new mode 100644 diff --git a/thirdparty/JSON-Schema-Test-Suite/tests/draft4/minimum.json b/thirdparty/JSON-Schema-Test-Suite/tests/draft4/minimum.json old mode 100755 new mode 100644 diff --git a/thirdparty/JSON-Schema-Test-Suite/tests/draft4/multipleOf.json b/thirdparty/JSON-Schema-Test-Suite/tests/draft4/multipleOf.json old mode 100755 new mode 100644 diff --git a/thirdparty/JSON-Schema-Test-Suite/tests/draft4/not.json b/thirdparty/JSON-Schema-Test-Suite/tests/draft4/not.json old mode 100755 new mode 100644 index 2cdc979..cbb7f46 --- a/thirdparty/JSON-Schema-Test-Suite/tests/draft4/not.json +++ b/thirdparty/JSON-Schema-Test-Suite/tests/draft4/not.json @@ -69,5 +69,28 @@ "valid": false } ] + }, + { + "description": "forbidden property", + "schema": { + "properties": { + "foo": { + "not": {} + } + } + }, + "tests": [ + { + "description": "property present", + "data": {"foo": 1, "bar": 2}, + "valid": false + }, + { + "description": "property absent", + "data": {"bar": 1, "baz": 2}, + "valid": true + } + ] } + ] diff --git a/thirdparty/JSON-Schema-Test-Suite/tests/draft4/oneOf.json b/thirdparty/JSON-Schema-Test-Suite/tests/draft4/oneOf.json old mode 100755 new mode 100644 diff --git a/thirdparty/JSON-Schema-Test-Suite/tests/draft4/optional/bignum.json b/thirdparty/JSON-Schema-Test-Suite/tests/draft4/optional/bignum.json old mode 100755 new mode 100644 index 7b4755c..cd47994 --- a/thirdparty/JSON-Schema-Test-Suite/tests/draft4/optional/bignum.json +++ b/thirdparty/JSON-Schema-Test-Suite/tests/draft4/optional/bignum.json @@ -32,6 +32,17 @@ } ] }, + { + "description": "integer comparison", + "schema": {"maximum": 18446744073709551615}, + "tests": [ + { + "description": "comparison works for high numbers", + "data": 18446744073709551600, + "valid": true + } + ] + }, { "description": "float comparison with high precision", "schema": { diff --git a/thirdparty/JSON-Schema-Test-Suite/tests/draft4/optional/format.json b/thirdparty/JSON-Schema-Test-Suite/tests/draft4/optional/format.json old mode 100755 new mode 100644 index cba8fc3..53c5d25 --- a/thirdparty/JSON-Schema-Test-Suite/tests/draft4/optional/format.json +++ b/thirdparty/JSON-Schema-Test-Suite/tests/draft4/optional/format.json @@ -33,6 +33,11 @@ "description": "an invalid URI", "data": "\\\\WINDOWS\\fileshare", "valid": false + }, + { + "description": "an invalid URI though valid URI reference", + "data": "abc", + "valid": false } ] }, @@ -70,6 +75,16 @@ "description": "an IP address with out-of-range values", "data": "256.256.256.256", "valid": false + }, + { + "description": "an IP address without 4 components", + "data": "127.0", + "valid": false + }, + { + "description": "an IP address as an integer", + "data": "0x7f000001", + "valid": false } ] }, diff --git a/thirdparty/JSON-Schema-Test-Suite/tests/draft4/optional/zeroTerminatedFloats.json b/thirdparty/JSON-Schema-Test-Suite/tests/draft4/optional/zeroTerminatedFloats.json old mode 100755 new mode 100644 diff --git a/thirdparty/JSON-Schema-Test-Suite/tests/draft4/pattern.json b/thirdparty/JSON-Schema-Test-Suite/tests/draft4/pattern.json old mode 100755 new mode 100644 diff --git a/thirdparty/JSON-Schema-Test-Suite/tests/draft4/patternProperties.json b/thirdparty/JSON-Schema-Test-Suite/tests/draft4/patternProperties.json old mode 100755 new mode 100644 diff --git a/thirdparty/JSON-Schema-Test-Suite/tests/draft4/properties.json b/thirdparty/JSON-Schema-Test-Suite/tests/draft4/properties.json old mode 100755 new mode 100644 diff --git a/thirdparty/JSON-Schema-Test-Suite/tests/draft4/ref.json b/thirdparty/JSON-Schema-Test-Suite/tests/draft4/ref.json old mode 100755 new mode 100644 diff --git a/thirdparty/JSON-Schema-Test-Suite/tests/draft4/refRemote.json b/thirdparty/JSON-Schema-Test-Suite/tests/draft4/refRemote.json old mode 100755 new mode 100644 diff --git a/thirdparty/JSON-Schema-Test-Suite/tests/draft4/required.json b/thirdparty/JSON-Schema-Test-Suite/tests/draft4/required.json old mode 100755 new mode 100644 diff --git a/thirdparty/JSON-Schema-Test-Suite/tests/draft4/type.json b/thirdparty/JSON-Schema-Test-Suite/tests/draft4/type.json old mode 100755 new mode 100644 diff --git a/thirdparty/JSON-Schema-Test-Suite/tests/draft4/uniqueItems.json b/thirdparty/JSON-Schema-Test-Suite/tests/draft4/uniqueItems.json old mode 100755 new mode 100644 diff --git a/xcode/valijson.xcodeproj/project.pbxproj b/xcode/valijson.xcodeproj/project.pbxproj index de2e05c..77fac5d 100644 --- a/xcode/valijson.xcodeproj/project.pbxproj +++ b/xcode/valijson.xcodeproj/project.pbxproj @@ -121,6 +121,7 @@ 6A869A2517CD8641006864FA /* type.json */ = {isa = PBXFileReference; lastKnownFileType = text.json; path = type.json; sourceTree = ""; }; 6A869A2617CD8641006864FA /* uniqueItems.json */ = {isa = PBXFileReference; lastKnownFileType = text.json; path = uniqueItems.json; sourceTree = ""; }; 6A869A3017CD8A92006864FA /* rapidjson_utils.hpp */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.h; path = rapidjson_utils.hpp; sourceTree = ""; }; + 6A9E1855194D486C003F1C4C /* utf8_utils.hpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; path = utf8_utils.hpp; sourceTree = ""; }; 6A9F49F117D344DE005EBA4F /* README.md */ = {isa = PBXFileReference; lastKnownFileType = text; name = README.md; path = ../README.md; sourceTree = ""; }; 6AA8A5DA17F8BDCA002728A0 /* test_dereference_callback.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = test_dereference_callback.cpp; sourceTree = ""; }; 6AB8FE8617E6A56F0028E147 /* external_schema.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = external_schema.cpp; sourceTree = ""; }; @@ -151,39 +152,6 @@ 6AC18C1517C861D600FE0EC9 /* validation_visitor.hpp */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.h; path = validation_visitor.hpp; sourceTree = ""; }; 6AC18C1717CC1BE100FE0EC9 /* frozen_value.hpp */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.h; path = frozen_value.hpp; sourceTree = ""; }; 6AC18C1917CC2DDC00FE0EC9 /* adapter.hpp */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.h; lineEnding = 0; path = adapter.hpp; sourceTree = ""; xcLanguageSpecificationIdentifier = xcode.lang.cpp; }; - 6AC18C3E17CC850F00FE0EC9 /* gtest-death-test.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = "gtest-death-test.h"; sourceTree = ""; }; - 6AC18C3F17CC850F00FE0EC9 /* gtest-message.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = "gtest-message.h"; sourceTree = ""; }; - 6AC18C4017CC850F00FE0EC9 /* gtest-param-test.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = "gtest-param-test.h"; sourceTree = ""; }; - 6AC18C4117CC850F00FE0EC9 /* gtest-param-test.h.pump */ = {isa = PBXFileReference; lastKnownFileType = text; path = "gtest-param-test.h.pump"; sourceTree = ""; }; - 6AC18C4217CC850F00FE0EC9 /* gtest-printers.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = "gtest-printers.h"; sourceTree = ""; }; - 6AC18C4317CC850F00FE0EC9 /* gtest-spi.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = "gtest-spi.h"; sourceTree = ""; }; - 6AC18C4417CC850F00FE0EC9 /* gtest-test-part.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = "gtest-test-part.h"; sourceTree = ""; }; - 6AC18C4517CC850F00FE0EC9 /* gtest-typed-test.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = "gtest-typed-test.h"; sourceTree = ""; }; - 6AC18C4617CC850F00FE0EC9 /* gtest.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = gtest.h; sourceTree = ""; }; - 6AC18C4717CC850F00FE0EC9 /* gtest_pred_impl.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = gtest_pred_impl.h; sourceTree = ""; }; - 6AC18C4817CC850F00FE0EC9 /* gtest_prod.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = gtest_prod.h; sourceTree = ""; }; - 6AC18C4A17CC850F00FE0EC9 /* gtest-death-test-internal.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = "gtest-death-test-internal.h"; sourceTree = ""; }; - 6AC18C4B17CC850F00FE0EC9 /* gtest-filepath.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = "gtest-filepath.h"; sourceTree = ""; }; - 6AC18C4C17CC850F00FE0EC9 /* gtest-internal.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = "gtest-internal.h"; sourceTree = ""; }; - 6AC18C4D17CC850F00FE0EC9 /* gtest-linked_ptr.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = "gtest-linked_ptr.h"; sourceTree = ""; }; - 6AC18C4E17CC850F00FE0EC9 /* gtest-param-util-generated.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = "gtest-param-util-generated.h"; sourceTree = ""; }; - 6AC18C4F17CC850F00FE0EC9 /* gtest-param-util-generated.h.pump */ = {isa = PBXFileReference; lastKnownFileType = text; path = "gtest-param-util-generated.h.pump"; sourceTree = ""; }; - 6AC18C5017CC850F00FE0EC9 /* gtest-param-util.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = "gtest-param-util.h"; sourceTree = ""; }; - 6AC18C5117CC850F00FE0EC9 /* gtest-port.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = "gtest-port.h"; sourceTree = ""; }; - 6AC18C5217CC850F00FE0EC9 /* gtest-string.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = "gtest-string.h"; sourceTree = ""; }; - 6AC18C5317CC850F00FE0EC9 /* gtest-tuple.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = "gtest-tuple.h"; sourceTree = ""; }; - 6AC18C5417CC850F00FE0EC9 /* gtest-tuple.h.pump */ = {isa = PBXFileReference; lastKnownFileType = text; path = "gtest-tuple.h.pump"; sourceTree = ""; }; - 6AC18C5517CC850F00FE0EC9 /* gtest-type-util.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = "gtest-type-util.h"; sourceTree = ""; }; - 6AC18C5617CC850F00FE0EC9 /* gtest-type-util.h.pump */ = {isa = PBXFileReference; lastKnownFileType = text; path = "gtest-type-util.h.pump"; sourceTree = ""; }; - 6AC18C8B17CC850F00FE0EC9 /* gtest-death-test.cc */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.cpp; path = "gtest-death-test.cc"; sourceTree = ""; }; - 6AC18C8C17CC850F00FE0EC9 /* gtest-filepath.cc */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.cpp; path = "gtest-filepath.cc"; sourceTree = ""; }; - 6AC18C8D17CC850F00FE0EC9 /* gtest-internal-inl.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = "gtest-internal-inl.h"; sourceTree = ""; }; - 6AC18C8E17CC850F00FE0EC9 /* gtest-port.cc */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.cpp; path = "gtest-port.cc"; sourceTree = ""; }; - 6AC18C8F17CC850F00FE0EC9 /* gtest-printers.cc */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.cpp; path = "gtest-printers.cc"; sourceTree = ""; }; - 6AC18C9017CC850F00FE0EC9 /* gtest-test-part.cc */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.cpp; path = "gtest-test-part.cc"; sourceTree = ""; }; - 6AC18C9117CC850F00FE0EC9 /* gtest-typed-test.cc */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.cpp; path = "gtest-typed-test.cc"; sourceTree = ""; }; - 6AC18C9217CC850F00FE0EC9 /* gtest.cc */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.cpp; path = gtest.cc; sourceTree = ""; }; - 6AC18C9317CC850F00FE0EC9 /* gtest_main.cc */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.cpp; path = gtest_main.cc; sourceTree = ""; }; 6AC18CEF17CC851000FE0EC9 /* allocators.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = allocators.h; sourceTree = ""; }; 6AC18CF017CC851000FE0EC9 /* document.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = document.h; sourceTree = ""; }; 6AC18CF117CC851000FE0EC9 /* encodedstream.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = encodedstream.h; sourceTree = ""; }; @@ -492,6 +460,7 @@ 6AB8FEBC17E6EF9A0028E147 /* jsoncpp_utils.hpp */, 6AB8FEBD17E77C360028E147 /* property_tree_utils.hpp */, 6A869A3017CD8A92006864FA /* rapidjson_utils.hpp */, + 6A9E1855194D486C003F1C4C /* utf8_utils.hpp */, ); path = utils; sourceTree = ""; @@ -564,7 +533,6 @@ isa = PBXGroup; children = ( 6AF70AC218FE71F600342325 /* gtest-1.7.0 */, - 6AC18C1E17CC850F00FE0EC9 /* gtest-1.6.0 */, 6AB8FE9417E6C08D0028E147 /* jsoncpp-0.5.0 */, 6A8699E517CD8641006864FA /* JSON-Schema-Test-Suite */, 6AC18CEC17CC851000FE0EC9 /* rapidjson-0.1 */, @@ -574,78 +542,6 @@ path = ../thirdparty; sourceTree = ""; }; - 6AC18C1E17CC850F00FE0EC9 /* gtest-1.6.0 */ = { - isa = PBXGroup; - children = ( - 6AC18C3C17CC850F00FE0EC9 /* include */, - 6AC18C8917CC850F00FE0EC9 /* src */, - ); - path = "gtest-1.6.0"; - sourceTree = ""; - }; - 6AC18C3C17CC850F00FE0EC9 /* include */ = { - isa = PBXGroup; - children = ( - 6AC18C3D17CC850F00FE0EC9 /* gtest */, - ); - path = include; - sourceTree = ""; - }; - 6AC18C3D17CC850F00FE0EC9 /* gtest */ = { - isa = PBXGroup; - children = ( - 6AC18C3E17CC850F00FE0EC9 /* gtest-death-test.h */, - 6AC18C3F17CC850F00FE0EC9 /* gtest-message.h */, - 6AC18C4017CC850F00FE0EC9 /* gtest-param-test.h */, - 6AC18C4117CC850F00FE0EC9 /* gtest-param-test.h.pump */, - 6AC18C4217CC850F00FE0EC9 /* gtest-printers.h */, - 6AC18C4317CC850F00FE0EC9 /* gtest-spi.h */, - 6AC18C4417CC850F00FE0EC9 /* gtest-test-part.h */, - 6AC18C4517CC850F00FE0EC9 /* gtest-typed-test.h */, - 6AC18C4617CC850F00FE0EC9 /* gtest.h */, - 6AC18C4717CC850F00FE0EC9 /* gtest_pred_impl.h */, - 6AC18C4817CC850F00FE0EC9 /* gtest_prod.h */, - 6AC18C4917CC850F00FE0EC9 /* internal */, - ); - path = gtest; - sourceTree = ""; - }; - 6AC18C4917CC850F00FE0EC9 /* internal */ = { - isa = PBXGroup; - children = ( - 6AC18C4A17CC850F00FE0EC9 /* gtest-death-test-internal.h */, - 6AC18C4B17CC850F00FE0EC9 /* gtest-filepath.h */, - 6AC18C4C17CC850F00FE0EC9 /* gtest-internal.h */, - 6AC18C4D17CC850F00FE0EC9 /* gtest-linked_ptr.h */, - 6AC18C4E17CC850F00FE0EC9 /* gtest-param-util-generated.h */, - 6AC18C4F17CC850F00FE0EC9 /* gtest-param-util-generated.h.pump */, - 6AC18C5017CC850F00FE0EC9 /* gtest-param-util.h */, - 6AC18C5117CC850F00FE0EC9 /* gtest-port.h */, - 6AC18C5217CC850F00FE0EC9 /* gtest-string.h */, - 6AC18C5317CC850F00FE0EC9 /* gtest-tuple.h */, - 6AC18C5417CC850F00FE0EC9 /* gtest-tuple.h.pump */, - 6AC18C5517CC850F00FE0EC9 /* gtest-type-util.h */, - 6AC18C5617CC850F00FE0EC9 /* gtest-type-util.h.pump */, - ); - path = internal; - sourceTree = ""; - }; - 6AC18C8917CC850F00FE0EC9 /* src */ = { - isa = PBXGroup; - children = ( - 6AC18C8B17CC850F00FE0EC9 /* gtest-death-test.cc */, - 6AC18C8C17CC850F00FE0EC9 /* gtest-filepath.cc */, - 6AC18C8D17CC850F00FE0EC9 /* gtest-internal-inl.h */, - 6AC18C8E17CC850F00FE0EC9 /* gtest-port.cc */, - 6AC18C8F17CC850F00FE0EC9 /* gtest-printers.cc */, - 6AC18C9017CC850F00FE0EC9 /* gtest-test-part.cc */, - 6AC18C9117CC850F00FE0EC9 /* gtest-typed-test.cc */, - 6AC18C9217CC850F00FE0EC9 /* gtest.cc */, - 6AC18C9317CC850F00FE0EC9 /* gtest_main.cc */, - ); - path = src; - sourceTree = ""; - }; 6AC18CEC17CC851000FE0EC9 /* rapidjson-0.1 */ = { isa = PBXGroup; children = (