| 348 | friend class GenericSchemaDocument<ValueType, AllocatorType>; |
| 349 | |
| 350 | Schema(SchemaDocumentType* schemaDocument, const PointerType& p, const ValueType& value, const ValueType& document, AllocatorType* allocator) : |
| 351 | allocator_(allocator), |
| 352 | enum_(), |
| 353 | enumCount_(), |
| 354 | not_(), |
| 355 | type_((1 << kTotalSchemaType) - 1), // typeless |
| 356 | validatorCount_(), |
| 357 | properties_(), |
| 358 | additionalPropertiesSchema_(), |
| 359 | patternProperties_(), |
| 360 | patternPropertyCount_(), |
| 361 | propertyCount_(), |
| 362 | minProperties_(), |
| 363 | maxProperties_(SizeType(~0)), |
| 364 | additionalProperties_(true), |
| 365 | hasDependencies_(), |
| 366 | hasRequired_(), |
| 367 | hasSchemaDependencies_(), |
| 368 | additionalItemsSchema_(), |
| 369 | itemsList_(), |
| 370 | itemsTuple_(), |
| 371 | itemsTupleCount_(), |
| 372 | minItems_(), |
| 373 | maxItems_(SizeType(~0)), |
| 374 | additionalItems_(true), |
| 375 | uniqueItems_(false), |
| 376 | pattern_(), |
| 377 | minLength_(0), |
| 378 | maxLength_(~SizeType(0)), |
| 379 | exclusiveMinimum_(false), |
| 380 | exclusiveMaximum_(false) |
| 381 | { |
| 382 | typedef typename SchemaDocumentType::ValueType ValueType; |
| 383 | typedef typename ValueType::ConstValueIterator ConstValueIterator; |
| 384 | typedef typename ValueType::ConstMemberIterator ConstMemberIterator; |
| 385 | |
| 386 | if (!value.IsObject()) |
| 387 | return; |
| 388 | |
| 389 | if (const ValueType* v = GetMember(value, GetTypeString())) { |
| 390 | type_ = 0; |
| 391 | if (v->IsString()) |
| 392 | AddType(*v); |
| 393 | else if (v->IsArray()) |
| 394 | for (ConstValueIterator itr = v->Begin(); itr != v->End(); ++itr) |
| 395 | AddType(*itr); |
| 396 | } |
| 397 | |
| 398 | if (const ValueType* v = GetMember(value, GetEnumString())) |
| 399 | if (v->IsArray() && v->Size() > 0) { |
| 400 | enum_ = static_cast<uint64_t*>(allocator_->Malloc(sizeof(uint64_t) * v->Size())); |
| 401 | for (ConstValueIterator itr = v->Begin(); itr != v->End(); ++itr) { |
| 402 | typedef Hasher<EncodingType, MemoryPoolAllocator<> > EnumHasherType; |
| 403 | char buffer[256 + 24]; |
| 404 | MemoryPoolAllocator<> hasherAllocator(buffer, sizeof(buffer)); |
| 405 | EnumHasherType h(&hasherAllocator, 256); |
| 406 | itr->Accept(h); |
| 407 | enum_[enumCount_++] = h.GetHashCode(); |
nothing calls this directly
no test coverage detected