Compile a JSON document into schema document.
1526 :
1527 remoteProvider_(remoteProvider),
1528 allocator_(allocator),
1529 ownAllocator_(),
1530 root_(),
1531 typeless_(),
1532 schemaMap_(allocator, kInitialSchemaMapSize),
1533 schemaRef_(allocator, kInitialSchemaRefSize)
1534 {
1535 if (!allocator_)
1537
1539 uri_.SetString(uri ? uri : noUri, uriLength, *allocator_);
1540
1543
1544
1545
1546 CreateSchemaRecursive(&root_,
PointerType(), document, document);
1547
1548
1549 while (!schemaRef_.Empty()) {
1550 SchemaRefEntry* refEntry = schemaRef_.template Pop<SchemaRefEntry>(1);
1551 if (
const SchemaType*
s = GetSchema(refEntry->target)) {
1552 if (refEntry->schema)
1553 *refEntry->schema =
s;
1554
1555
1556 if (!GetSchema(refEntry->source)) {
1557 new (schemaMap_.template Push<SchemaEntry>()) SchemaEntry(refEntry->source,
const_cast<SchemaType*
>(
s),
false, allocator_);
1558 }
1559 }
1560 else if (refEntry->schema)
1561 *refEntry->schema = typeless_;
1562
1563 refEntry->~SchemaRefEntry();
1564 }
1565
1567
1568 schemaRef_.ShrinkToFit();
1569 }
internal::Schema< GenericSchemaDocument > SchemaType
GenericPointer< ValueType, Allocator > PointerType
Concept for allocating, resizing and freeing memory block.
#define RAPIDJSON_ASSERT(x)
Assertion.
#define RAPIDJSON_NEW(TypeName)
! customization point for global new