Lines Matching refs:context
162 context.invalidCode = code;\
163 context.invalidKeyword = SchemaType::GetValidateErrorKeyword(code).GetString();\
164 RAPIDJSON_SCHEMA_PRINT(InvalidKeyword, context.invalidKeyword);\
871 bool BeginValue(Context& context) const { in BeginValue() argument
873 if (context.inArray) { in BeginValue()
875 context.valueUniqueness = true; in BeginValue()
878 context.valueSchema = itemsList_; in BeginValue()
880 if (context.arrayElementIndex < itemsTupleCount_) in BeginValue()
881 context.valueSchema = itemsTuple_[context.arrayElementIndex]; in BeginValue()
883 context.valueSchema = additionalItemsSchema_; in BeginValue()
885 context.valueSchema = typeless_; in BeginValue()
887 context.error_handler.DisallowedItem(context.arrayElementIndex); in BeginValue()
889 context.valueSchema = typeless_; in BeginValue()
891 context.arrayElementIndex++; in BeginValue()
896 context.valueSchema = typeless_; in BeginValue()
898 context.arrayElementIndex++; in BeginValue()
903 RAPIDJSON_FORCEINLINE bool EndValue(Context& context) const { in EndValue() argument
906 if (context.patternPropertiesValidatorCount > 0) { in EndValue()
908 SizeType count = context.patternPropertiesValidatorCount; in EndValue()
909 if (context.objectPatternValidatorType != Context::kPatternValidatorOnly) in EndValue()
910 otherValid = context.patternPropertiesValidators[--count]->IsValid(); in EndValue()
914 if (!context.patternPropertiesValidators[i]->IsValid()) { in EndValue()
919 if (context.objectPatternValidatorType == Context::kPatternValidatorOnly) { in EndValue()
921 … context.error_handler.PropertyViolations(context.patternPropertiesValidators, count); in EndValue()
925 else if (context.objectPatternValidatorType == Context::kPatternValidatorWithProperty) { in EndValue()
927 … context.error_handler.PropertyViolations(context.patternPropertiesValidators, count + 1); in EndValue()
932 … context.error_handler.PropertyViolations(context.patternPropertiesValidators, count + 1); in EndValue()
938 if (enum_ && context.hasher) { in EndValue()
939 const uint64_t h = context.factory.GetHashCode(context.hasher); in EndValue()
943 context.error_handler.DisallowedValue(kValidateErrorEnum); in EndValue()
949 if (context.validatorCount > 0) { in EndValue()
952 if (!context.validators[i]->IsValid()) { in EndValue()
953 … context.error_handler.NotAllOf(&context.validators[allOf_.begin], allOf_.count); in EndValue()
959 if (context.validators[i]->IsValid()) in EndValue()
961 context.error_handler.NoneOf(&context.validators[anyOf_.begin], anyOf_.count); in EndValue()
970 if (context.validators[i]->IsValid()) { in EndValue()
972 context.error_handler.MultipleOneOf(firstMatch, i - oneOf_.begin); in EndValue()
980 context.error_handler.NotOneOf(&context.validators[oneOf_.begin], oneOf_.count); in EndValue()
985 if (not_ && context.validators[notValidatorIndex_]->IsValid()) { in EndValue()
986 context.error_handler.Disallowed(); in EndValue()
994 bool Null(Context& context) const { in Null() argument
997 DisallowedType(context, GetNullString()); in Null()
1000 return CreateParallelValidator(context); in Null()
1003 bool Bool(Context& context, bool b) const { in Bool() argument
1005 if (!CheckBool(context, b)) in Bool()
1007 return CreateParallelValidator(context); in Bool()
1010 bool Int(Context& context, int i) const { in Int() argument
1012 if (!CheckInt(context, i)) in Int()
1014 return CreateParallelValidator(context); in Int()
1017 bool Uint(Context& context, unsigned u) const { in Uint() argument
1019 if (!CheckUint(context, u)) in Uint()
1021 return CreateParallelValidator(context); in Uint()
1024 bool Int64(Context& context, int64_t i) const { in Int64() argument
1026 if (!CheckInt(context, i)) in Int64()
1028 return CreateParallelValidator(context); in Int64()
1031 bool Uint64(Context& context, uint64_t u) const { in Uint64() argument
1033 if (!CheckUint(context, u)) in Uint64()
1035 return CreateParallelValidator(context); in Uint64()
1038 bool Double(Context& context, double d) const { in Double() argument
1041 DisallowedType(context, GetNumberString()); in Double()
1045 if (!minimum_.IsNull() && !CheckDoubleMinimum(context, d)) in Double()
1048 if (!maximum_.IsNull() && !CheckDoubleMaximum(context, d)) in Double()
1051 if (!multipleOf_.IsNull() && !CheckDoubleMultipleOf(context, d)) in Double()
1054 return CreateParallelValidator(context); in Double()
1057 bool String(Context& context, const Ch* str, SizeType length, bool) const { in String() argument
1060 DisallowedType(context, GetStringString()); in String()
1068 context.error_handler.TooShort(str, length, minLength_); in String()
1072 context.error_handler.TooLong(str, length, maxLength_); in String()
1079 context.error_handler.DoesNotMatch(str, length); in String()
1083 return CreateParallelValidator(context); in String()
1086 bool StartObject(Context& context) const { in StartObject() argument
1089 DisallowedType(context, GetObjectString()); in StartObject()
1094 …context.propertyExist = static_cast<bool*>(context.factory.MallocState(sizeof(bool) * propertyCoun… in StartObject()
1095 std::memset(context.propertyExist, 0, sizeof(bool) * propertyCount_); in StartObject()
1100 …context.patternPropertiesSchemas = static_cast<const SchemaType**>(context.factory.MallocState(siz… in StartObject()
1101 context.patternPropertiesSchemaCount = 0; in StartObject()
1102 std::memset(context.patternPropertiesSchemas, 0, sizeof(SchemaType*) * count); in StartObject()
1105 return CreateParallelValidator(context); in StartObject()
1108 bool Key(Context& context, const Ch* str, SizeType len, bool) const { in Key() argument
1112 context.patternPropertiesSchemaCount = 0; in Key()
1115 …context.patternPropertiesSchemas[context.patternPropertiesSchemaCount++] = patternProperties_[i].s… in Key()
1116 context.valueSchema = typeless_; in Key()
1122 if (context.patternPropertiesSchemaCount > 0) { in Key()
1123 …context.patternPropertiesSchemas[context.patternPropertiesSchemaCount++] = properties_[index].sche… in Key()
1124 context.valueSchema = typeless_; in Key()
1125 context.valuePatternValidatorType = Context::kPatternValidatorWithProperty; in Key()
1128 context.valueSchema = properties_[index].schema; in Key()
1130 if (context.propertyExist) in Key()
1131 context.propertyExist[index] = true; in Key()
1137 if (context.patternPropertiesSchemaCount > 0) { in Key()
1138 …context.patternPropertiesSchemas[context.patternPropertiesSchemaCount++] = additionalPropertiesSch… in Key()
1139 context.valueSchema = typeless_; in Key()
1140 … context.valuePatternValidatorType = Context::kPatternValidatorWithAdditionalProperty; in Key()
1143 context.valueSchema = additionalPropertiesSchema_; in Key()
1147 context.valueSchema = typeless_; in Key()
1151 …if (context.patternPropertiesSchemaCount == 0) { // patternProperties are not additional properties in Key()
1153 context.valueSchema = typeless_; in Key()
1154 context.error_handler.DisallowedProperty(str, len); in Key()
1161 bool EndObject(Context& context, SizeType memberCount) const { in EndObject() argument
1164 context.error_handler.StartMissingProperties(); in EndObject()
1166 if (properties_[index].required && !context.propertyExist[index]) in EndObject()
1168 context.error_handler.AddMissingProperty(properties_[index].name); in EndObject()
1169 if (context.error_handler.EndMissingProperties()) in EndObject()
1174 context.error_handler.TooFewProperties(memberCount, minProperties_); in EndObject()
1179 context.error_handler.TooManyProperties(memberCount, maxProperties_); in EndObject()
1184 context.error_handler.StartDependencyErrors(); in EndObject()
1187 if (context.propertyExist[sourceIndex]) { in EndObject()
1189 context.error_handler.StartMissingDependentProperties(); in EndObject()
1191 … if (source.dependencies[targetIndex] && !context.propertyExist[targetIndex]) in EndObject()
1192 … context.error_handler.AddMissingDependentProperty(properties_[targetIndex].name); in EndObject()
1193 context.error_handler.EndMissingDependentProperties(source.name); in EndObject()
1196 … ISchemaValidator* dependenciesValidator = context.validators[source.dependenciesValidatorIndex]; in EndObject()
1198 … context.error_handler.AddDependencySchemaError(source.name, dependenciesValidator); in EndObject()
1202 if (context.error_handler.EndDependencyErrors()) in EndObject()
1209 bool StartArray(Context& context) const { in StartArray() argument
1211 context.arrayElementIndex = 0; in StartArray()
1212 context.inArray = true; // Ensure we note that we are in an array in StartArray()
1215 DisallowedType(context, GetArrayString()); in StartArray()
1219 return CreateParallelValidator(context); in StartArray()
1222 bool EndArray(Context& context, SizeType elementCount) const { in EndArray() argument
1224 context.inArray = false; in EndArray()
1227 context.error_handler.TooFewItems(elementCount, minItems_); in EndArray()
1232 context.error_handler.TooManyItems(elementCount, maxItems_); in EndArray()
1464 bool CreateParallelValidator(Context& context) const { in CreateParallelValidator() argument
1465 if (enum_ || context.arrayUniqueness) in CreateParallelValidator()
1466 context.hasher = context.factory.CreateHasher(); in CreateParallelValidator()
1469 RAPIDJSON_ASSERT(context.validators == 0); in CreateParallelValidator()
1470 …context.validators = static_cast<ISchemaValidator**>(context.factory.MallocState(sizeof(ISchemaVal… in CreateParallelValidator()
1471 std::memset(context.validators, 0, sizeof(ISchemaValidator*) * validatorCount_); in CreateParallelValidator()
1472 context.validatorCount = validatorCount_; in CreateParallelValidator()
1476 CreateSchemaValidators(context, allOf_, false); in CreateParallelValidator()
1479 CreateSchemaValidators(context, anyOf_, false); in CreateParallelValidator()
1482 CreateSchemaValidators(context, oneOf_, false); in CreateParallelValidator()
1485 … context.validators[notValidatorIndex_] = context.factory.CreateSchemaValidator(*not_, false); in CreateParallelValidator()
1490 …context.validators[properties_[i].dependenciesValidatorIndex] = context.factory.CreateSchemaValida… in CreateParallelValidator()
1495 if (readOnly_ && (context.flags & kValidateWriteFlag)) { in CreateParallelValidator()
1496 context.error_handler.DisallowedWhenWriting(); in CreateParallelValidator()
1499 if (writeOnly_ && (context.flags & kValidateReadFlag)) { in CreateParallelValidator()
1500 context.error_handler.DisallowedWhenReading(); in CreateParallelValidator()
1507 …void CreateSchemaValidators(Context& context, const SchemaArray& schemas, const bool inheritContin… in CreateSchemaValidators() argument
1509 …context.validators[schemas.begin + i] = context.factory.CreateSchemaValidator(*schemas.schemas[i],… in CreateSchemaValidators()
1526 bool CheckBool(Context& context, bool) const { in CheckBool() argument
1528 DisallowedType(context, GetBooleanString()); in CheckBool()
1534 bool CheckInt(Context& context, int64_t i) const { in CheckInt() argument
1536 DisallowedType(context, GetIntegerString()); in CheckInt()
1543 context.error_handler.BelowMinimum(i, minimum_, exclusiveMinimum_); in CheckInt()
1548 context.error_handler.BelowMinimum(i, minimum_, exclusiveMinimum_); in CheckInt()
1551 else if (!CheckDoubleMinimum(context, static_cast<double>(i))) in CheckInt()
1558 context.error_handler.AboveMaximum(i, maximum_, exclusiveMaximum_); in CheckInt()
1564 else if (!CheckDoubleMaximum(context, static_cast<double>(i))) in CheckInt()
1571 context.error_handler.NotMultipleOf(i, multipleOf_); in CheckInt()
1575 else if (!CheckDoubleMultipleOf(context, static_cast<double>(i))) in CheckInt()
1582 bool CheckUint(Context& context, uint64_t i) const { in CheckUint() argument
1584 DisallowedType(context, GetIntegerString()); in CheckUint()
1591 context.error_handler.BelowMinimum(i, minimum_, exclusiveMinimum_); in CheckUint()
1597 else if (!CheckDoubleMinimum(context, static_cast<double>(i))) in CheckUint()
1604 context.error_handler.AboveMaximum(i, maximum_, exclusiveMaximum_); in CheckUint()
1609 context.error_handler.AboveMaximum(i, maximum_, exclusiveMaximum_); in CheckUint()
1612 else if (!CheckDoubleMaximum(context, static_cast<double>(i))) in CheckUint()
1619 context.error_handler.NotMultipleOf(i, multipleOf_); in CheckUint()
1623 else if (!CheckDoubleMultipleOf(context, static_cast<double>(i))) in CheckUint()
1630 bool CheckDoubleMinimum(Context& context, double d) const { in CheckDoubleMinimum() argument
1632 context.error_handler.BelowMinimum(d, minimum_, exclusiveMinimum_); in CheckDoubleMinimum()
1638 bool CheckDoubleMaximum(Context& context, double d) const { in CheckDoubleMaximum() argument
1640 context.error_handler.AboveMaximum(d, maximum_, exclusiveMaximum_); in CheckDoubleMaximum()
1646 bool CheckDoubleMultipleOf(Context& context, double d) const { in CheckDoubleMultipleOf() argument
1651 context.error_handler.NotMultipleOf(d, multipleOf_); in CheckDoubleMultipleOf()
1657 void DisallowedType(Context& context, const ValueType& actualType) const { in DisallowedType() argument
1658 ErrorHandler& eh = context.error_handler; in DisallowedType()
2811 …for (Context* context = schemaStack_.template Bottom<Context>(); context != schemaStack_.template …
2812 if (context->hasher)\
2813 static_cast<HasherType*>(context->hasher)->method arg2;\
2814 if (context->validators)\
2815 for (SizeType i_ = 0; i_ < context->validatorCount; i_++)\
2816 static_cast<GenericSchemaValidator*>(context->validators[i_])->method arg2;\
2817 if (context->patternPropertiesValidators)\
2818 for (SizeType i_ = 0; i_ < context->patternPropertiesValidatorCount; i_++)\
2819 … static_cast<GenericSchemaValidator*>(context->patternPropertiesValidators[i_])->method arg2;\
3030 Context& context = CurrentContext();
3032 if (hasher && context.valueUniqueness) {
3033 HashCodeArray* a = static_cast<HashCodeArray*>(context.arrayElementHashCodes);