411 uri_(schemaDocument->GetURI(), *allocator),
413 typeless_(schemaDocument->GetTypeless()),
446 typedef typename SchemaDocumentType::ValueType
ValueType;
447 typedef typename ValueType::ConstValueIterator ConstValueIterator;
448 typedef typename ValueType::ConstMemberIterator ConstMemberIterator;
450 if (!
value.IsObject())
457 else if (v->IsArray())
458 for (ConstValueIterator itr = v->Begin(); itr != v->End(); ++itr)
463 if (v->IsArray() && v->Size() > 0) {
465 for (ConstValueIterator itr = v->Begin(); itr != v->End(); ++itr) {
466 typedef Hasher<EncodingType, MemoryPoolAllocator<> > EnumHasherType;
467 char buffer[256u + 24];
469 EnumHasherType
h(&hasherAllocator, 256);
475 if (schemaDocument) {
482 schemaDocument->CreateSchema(&
not_,
p.Append(GetNotString(),
allocator_), *v, document);
489 const ValueType* properties =
GetMember(
value, GetPropertiesString());
491 const ValueType* dependencies =
GetMember(
value, GetDependenciesString());
496 if (properties && properties->IsObject())
497 for (ConstMemberIterator itr = properties->MemberBegin(); itr != properties->MemberEnd(); ++itr)
500 if (required && required->IsArray())
501 for (ConstValueIterator itr = required->Begin(); itr != required->End(); ++itr)
505 if (dependencies && dependencies->IsObject())
506 for (ConstMemberIterator itr = dependencies->MemberBegin(); itr != dependencies->MemberEnd(); ++itr) {
508 if (itr->value.IsArray())
509 for (ConstValueIterator i = itr->value.Begin(); i != itr->value.End(); ++i)
514 if (allProperties.Size() > 0) {
525 if (properties && properties->IsObject()) {
527 for (ConstMemberIterator itr = properties->MemberBegin(); itr != properties->MemberEnd(); ++itr) {
534 if (
const ValueType* v =
GetMember(
value, GetPatternPropertiesString())) {
539 for (ConstMemberIterator itr = v->MemberBegin(); itr != v->MemberEnd(); ++itr) {
547 if (required && required->IsArray())
548 for (ConstValueIterator itr = required->Begin(); itr != required->End(); ++itr)
549 if (itr->IsString()) {
557 if (dependencies && dependencies->IsObject()) {
560 for (ConstMemberIterator itr = dependencies->MemberBegin(); itr != dependencies->MemberEnd(); ++itr) {
563 if (itr->value.IsArray()) {
565 std::memset(
properties_[sourceIndex].dependencies, 0,
sizeof(
bool)* propertyCount_);
566 for (ConstValueIterator targetItr = itr->value.Begin(); targetItr != itr->value.End(); ++targetItr) {
569 properties_[sourceIndex].dependencies[targetIndex] =
true;
572 else if (itr->value.IsObject()) {
574 schemaDocument->CreateSchema(&
properties_[sourceIndex].dependenciesSchema, q.Append(itr->name,
allocator_), itr->value, document);
582 if (
const ValueType* v =
GetMember(
value, GetAdditionalPropertiesString())) {
585 else if (v->IsObject())
596 schemaDocument->CreateSchema(&
itemsList_, q, *v, document);
597 else if (v->IsArray()) {
600 for (ConstValueIterator itr = v->Begin(); itr != v->End(); ++itr, index++)
608 if (
const ValueType* v =
GetMember(
value, GetAdditionalItemsString())) {
611 else if (v->IsObject())
637 if (v->IsNumber() && v->GetDouble() > 0.0)
641 if (
const ValueType* v =
GetMember(
value, GetDefaultValueString()))
SizeType patternPropertyCount_
SizeType defaultValueLength_
RAPIDJSON_NAMESPACE_BEGIN typedef unsigned SizeType
Size type (for string lengths, array sizes, etc.)
AllocatorType * allocator_
void AddUniqueElement(V1 &a, const V2 &v)
const SchemaType * typeless_
PatternProperty * patternProperties_
SchemaDocumentType::PointerType PointerType
const SchemaType * additionalItemsSchema_
SizeType notValidatorIndex_
static const ValueType * GetMember(const ValueType &value, const ValueType &name)
const SchemaType * itemsList_
const SchemaType ** itemsTuple_
SizeType itemsTupleCount_
GenericValue< EncodingType, AllocatorType > SValue
SizeType dependenciesValidatorIndex
const SchemaType * additionalPropertiesSchema_
unsigned __int64 uint64_t
const SchemaType * schema
const GenericPointer< typename T::ValueType > T2 value
SchemaDocumentType::ValueType ValueType
Schema(SchemaDocumentType *schemaDocument, const PointerType &p, const ValueType &value, const ValueType &document, AllocatorType *allocator)
bool additionalProperties_
bool FindPropertyIndex(const ValueType &name, SizeType *outIndex) const
bool hasSchemaDependencies_
Default memory allocator used by the parser and DOM.
RegexType * CreatePattern(const ValueType &value)
static void AssignIfExist(bool &out, const ValueType &value, const ValueType &name)
h
training ###############################
void AddType(const ValueType &type)