409 :
414 enum_(),
415 enumCount_(),
416 not_(),
417 type_((1 << kTotalSchemaType) - 1),
418 validatorCount_(),
419 notValidatorIndex_(),
420 properties_(),
421 additionalPropertiesSchema_(),
422 patternProperties_(),
423 patternPropertyCount_(),
424 propertyCount_(),
425 minProperties_(),
427 additionalProperties_(true),
428 hasDependencies_(),
429 hasRequired_(),
430 hasSchemaDependencies_(),
431 additionalItemsSchema_(),
432 itemsList_(),
433 itemsTuple_(),
434 itemsTupleCount_(),
435 minItems_(),
437 additionalItems_(true),
438 uniqueItems_(false),
439 pattern_(),
440 minLength_(0),
442 exclusiveMinimum_(false),
443 exclusiveMaximum_(false),
444 defaultValueLength_(0)
445 {
449
450 if (!
value.IsObject())
451 return;
452
454 type_ = 0;
457 else if (
v->IsArray())
460 }
461
463 if (
v->IsArray() &&
v->Size() > 0) {
464 enum_ =
static_cast<uint64_t*
>(allocator_->Malloc(
sizeof(
uint64_t) *
v->Size()));
471 enum_[enumCount_++] =
h.GetHashCode();
472 }
473 }
474
479 }
480
483 notValidatorIndex_ = validatorCount_;
484 validatorCount_++;
485 }
486
487
488
492 {
493
495
499
504
508 if (
itr->value.IsArray())
512 }
513
516 properties_ = static_cast<Property*>(allocator_->Malloc(sizeof(Property) * propertyCount_));
518 new (&properties_[
i]) Property();
520 properties_[
i].schema = typeless_;
521 }
522 }
523 }
524
529 if (FindPropertyIndex(
itr->name, &
index))
531 }
532 }
533
536 patternProperties_ =
static_cast<PatternProperty*
>(allocator_->Malloc(
sizeof(PatternProperty) *
v->MemberCount()));
537 patternPropertyCount_ = 0;
538
540 new (&patternProperties_[patternPropertyCount_]) PatternProperty();
541 patternProperties_[patternPropertyCount_].pattern = CreatePattern(
itr->name);
543 patternPropertyCount_++;
544 }
545 }
546
549 if (
itr->IsString()) {
551 if (FindPropertyIndex(*
itr, &
index)) {
552 properties_[
index].required =
true;
553 hasRequired_ = true;
554 }
555 }
556
559 hasDependencies_ = true;
563 if (
itr->value.IsArray()) {
564 properties_[
sourceIndex].dependencies =
static_cast<bool*
>(allocator_->Malloc(
sizeof(
bool) * propertyCount_));
570 }
571 }
572 else if (
itr->value.IsObject()) {
573 hasSchemaDependencies_ = true;
575 properties_[
sourceIndex].dependenciesValidatorIndex = validatorCount_;
576 validatorCount_++;
577 }
578 }
579 }
580 }
581
584 additionalProperties_ =
v->GetBool();
585 else if (
v->IsObject())
587 }
588
591
592
597 else if (
v->IsArray()) {
598 itemsTuple_ =
static_cast<const Schema**
>(allocator_->Malloc(
sizeof(
const Schema*) *
v->Size()));
602 }
603 }
604
607
610 additionalItems_ =
v->GetBool();
611 else if (
v->IsObject())
613 }
614
616
617
620
622 pattern_ = CreatePattern(*
v);
623
624
627 minimum_.CopyFrom(*
v, *allocator_);
628
631 maximum_.CopyFrom(*
v, *allocator_);
632
635
637 if (
v->IsNumber() &&
v->GetDouble() > 0.0)
638 multipleOf_.CopyFrom(*
v, *allocator_);
639
640
643 defaultValueLength_ =
v->GetStringLength();
644
645 }
SchemaDocumentType::PointerType PointerType
Schema(SchemaDocumentType *schemaDocument, const PointerType &p, const ValueType &value, const ValueType &document, AllocatorType *allocator)
SchemaDocumentType::ValueType ValueType
GenericValue< EncodingType, AllocatorType > SValue
const SValue & GetURI() const
RAPIDJSON_NAMESPACE_BEGIN typedef unsigned SizeType
Size type (for string lengths, array sizes, etc.).