Torque3D Documentation / _generateds / GenericSchemaValidator

GenericSchemaValidator

Engine/source/persistence/rapidjson/schema.h

JSON Schema Validator.

More...

Public Types

EncodingType::Ch
Ch 
SchemaType::EncodingType
EncodingType 
SchemaDocumentType::PointerType
PointerType 
SchemaDocumentType::SchemaType
SchemaType 
StringRefType 
SchemaType::SValue
SValue 
GenericValue< EncodingType, StateAllocator >
ValueType 

Private Types

SchemaType::Context
Context 
GenericValue< UTF8<>, StateAllocator >
HashCodeArray 
internal::Hasher< EncodingType, StateAllocator >
HasherType 

Private Attributes

internal::Stack< StateAllocator >

stack to store the current path of validating document (Ch)

OutputHandler *
StateAllocator *
const SchemaDocumentType *
internal::Stack< StateAllocator >

stack to store the current path of schema (BaseSchemaType *)

StateAllocator *
bool

Public Functions

GenericSchemaValidator(const SchemaDocumentType & schemaDocument, OutputHandler & outputHandler, StateAllocator * allocator, size_t schemaStackCapacity, size_t documentStackCapacity)

Constructor with output handler.

GenericSchemaValidator(const SchemaDocumentType & schemaDocument, StateAllocator * allocator, size_t schemaStackCapacity, size_t documentStackCapacity)

Constructor without output handler.

AboveMaximum(double actual, const SValue & expected, bool exclusive)
AboveMaximum(int64_t actual, const SValue & expected, bool exclusive)
AboveMaximum(uint64_t actual, const SValue & expected, bool exclusive)
AddDependencySchemaError(const SValue & sourceName, ISchemaValidator * subvalidator)
AddExpectedType(const typename SchemaType::ValueType & expectedType)
BelowMinimum(double actual, const SValue & expected, bool exclusive)
BelowMinimum(int64_t actual, const SValue & expected, bool exclusive)
BelowMinimum(uint64_t actual, const SValue & expected, bool exclusive)
bool
Bool(bool b)
ISchemaValidator *
DestroySchemaValidator(ISchemaValidator * validator)
bool
Double(double d)
bool
EndArray(SizeType elementCount)
EndDisallowedType(const typename SchemaType::ValueType & actualType)
bool
EndObject(SizeType memberCount)

Gets the error object.

Gets the JSON pointer pointed to the invalid value.

Gets the keyword of invalid schema.

Gets the JSON pointer pointed to the invalid schema.

bool
Int(int i)
bool
bool

Checks whether the current state is valid.

bool
Key(const Ch * str, SizeType len, bool copy)
void *
MallocState(size_t size)
NoneOf(ISchemaValidator ** subvalidators, SizeType count)
NotAllOf(ISchemaValidator ** subvalidators, SizeType count)
NotMultipleOf(double actual, const SValue & expected)
NotMultipleOf(int64_t actual, const SValue & expected)
NotMultipleOf(uint64_t actual, const SValue & expected)
NotOneOf(ISchemaValidator ** subvalidators, SizeType count)
bool
Null()
PropertyViolations(ISchemaValidator ** subvalidators, SizeType count)
bool
RawNumber(const Ch * str, SizeType length, bool copy)

Reset the internal states.

bool
bool
bool
String(const Ch * str, SizeType length, bool copy)
TooFewItems(SizeType actualCount, SizeType expectedCount)
TooFewProperties(SizeType actualCount, SizeType expectedCount)
TooLong(const Ch * str, SizeType length, SizeType expected)
TooManyItems(SizeType actualCount, SizeType expectedCount)
TooManyProperties(SizeType actualCount, SizeType expectedCount)
TooShort(const Ch * str, SizeType length, SizeType expected)
bool
Uint(unsigned u)
bool

Private Functions

GenericSchemaValidator(const SchemaDocumentType & schemaDocument, const SchemaType & root, const char * basePath, size_t basePathSize, StateAllocator * allocator, size_t schemaStackCapacity, size_t documentStackCapacity)
AddCurrentError(const typename SchemaType::ValueType & keyword, bool parent)
AddError(ValueType & keyword, ValueType & error)
AddErrorArray(const typename SchemaType::ValueType & keyword, ISchemaValidator ** subvalidators, SizeType count)
AddErrorLocation(ValueType & result, bool parent)
AddNumberError(const typename SchemaType::ValueType & keyword, ValueType & actual, const SValue & expected, const typename SchemaType::ValueType &(*)() exclusive)
bool
Context &
const Context &
bool
StateAllocator &
RAPIDJSON_FORCEINLINE void
RAPIDJSON_FORCEINLINE void

Detailed Description

JSON Schema Validator.

A SAX style JSON schema validator. It uses a

GenericSchemaDocument
to validate SAX events. It delegates the incoming SAX events to an output handler. The default output handler does nothing. It can be reused multiple times by calling
Reset()
.

Parameters:

SchemaDocumentType

Type of schema document.

OutputHandler

Type of output handler. Default handler does nothing.

StateAllocator

Allocator for storing the internal validation states.

Public Types

typedef EncodingType::Ch Ch 
typedef SchemaType::EncodingType EncodingType 
typedef SchemaDocumentType::PointerType PointerType 
typedef SchemaDocumentType::SchemaType SchemaType 
typedef GenericStringRef< Ch > StringRefType 
typedef SchemaType::SValue SValue 
typedef GenericValue< EncodingType, StateAllocator > ValueType 

Private Types

typedef SchemaType::Context Context 
typedef GenericValue< UTF8<>, StateAllocator > HashCodeArray 
typedef internal::Hasher< EncodingType, StateAllocator > HasherType 

Private Static Attributes

const size_t kDefaultDocumentStackCapacity 
const size_t kDefaultSchemaStackCapacity 

Private Attributes

ValueType currentError_ 
internal::Stack< StateAllocator > documentStack_ 

stack to store the current path of validating document (Ch)

ValueType error_ 
ValueType missingDependents_ 
OutputHandler * outputHandler_ 
StateAllocator * ownStateAllocator_ 
const SchemaType & root_ 
const SchemaDocumentType * schemaDocument_ 
internal::Stack< StateAllocator > schemaStack_ 

stack to store the current path of schema (BaseSchemaType *)

StateAllocator * stateAllocator_ 
bool valid_ 

Public Functions

GenericSchemaValidator(const SchemaDocumentType & schemaDocument, OutputHandler & outputHandler, StateAllocator * allocator, size_t schemaStackCapacity, size_t documentStackCapacity)

Constructor with output handler.

Parameters:

schemaDocument

The schema document to conform to.

allocator

Optional allocator for storing internal validation states.

schemaStackCapacity

Optional initial capacity of schema path stack.

documentStackCapacity

Optional initial capacity of document path stack.

GenericSchemaValidator(const SchemaDocumentType & schemaDocument, StateAllocator * allocator, size_t schemaStackCapacity, size_t documentStackCapacity)

Constructor without output handler.

Parameters:

schemaDocument

The schema document to conform to.

allocator

Optional allocator for storing internal validation states.

schemaStackCapacity

Optional initial capacity of schema path stack.

documentStackCapacity

Optional initial capacity of document path stack.

~GenericSchemaValidator()

Destructor.

AboveMaximum(double actual, const SValue & expected, bool exclusive)

Reimplemented from: internal::IValidationErrorHandler

AboveMaximum(int64_t actual, const SValue & expected, bool exclusive)

Reimplemented from: internal::IValidationErrorHandler

AboveMaximum(uint64_t actual, const SValue & expected, bool exclusive)

Reimplemented from: internal::IValidationErrorHandler

AddDependencySchemaError(const SValue & sourceName, ISchemaValidator * subvalidator)

AddExpectedType(const typename SchemaType::ValueType & expectedType)

Reimplemented from: internal::IValidationErrorHandler

AddMissingDependentProperty(const SValue & targetName)

Reimplemented from: internal::IValidationErrorHandler

AddMissingProperty(const SValue & name)

Reimplemented from: internal::IValidationErrorHandler

BelowMinimum(double actual, const SValue & expected, bool exclusive)

Reimplemented from: internal::IValidationErrorHandler

BelowMinimum(int64_t actual, const SValue & expected, bool exclusive)

Reimplemented from: internal::IValidationErrorHandler

BelowMinimum(uint64_t actual, const SValue & expected, bool exclusive)

Reimplemented from: internal::IValidationErrorHandler

Bool(bool b)

CreateHasher()

Reimplemented from: internal::ISchemaStateFactory

CreateSchemaValidator(const SchemaType & root)

Reimplemented from: internal::ISchemaStateFactory

DestroryHasher(void * hasher)

Reimplemented from: internal::ISchemaStateFactory

DestroySchemaValidator(ISchemaValidator * validator)

Disallowed()

Reimplemented from: internal::IValidationErrorHandler

DisallowedItem(SizeType index)

Reimplemented from: internal::IValidationErrorHandler

DisallowedProperty(const Ch * name, SizeType length)

DisallowedValue()

Reimplemented from: internal::IValidationErrorHandler

DoesNotMatch(const Ch * str, SizeType length)

Double(double d)

DuplicateItems(SizeType index1, SizeType index2)

Reimplemented from: internal::IValidationErrorHandler

EndArray(SizeType elementCount)

EndDependencyErrors()

Reimplemented from: internal::IValidationErrorHandler

EndDisallowedType(const typename SchemaType::ValueType & actualType)

Reimplemented from: internal::IValidationErrorHandler

EndMissingDependentProperties(const SValue & sourceName)

Reimplemented from: internal::IValidationErrorHandler

EndMissingProperties()

Reimplemented from: internal::IValidationErrorHandler

EndObject(SizeType memberCount)

FreeState(void * p)

Reimplemented from: internal::ISchemaStateFactory

GetError()

Gets the error object.

GetError()

GetHashCode(void * hasher)

Reimplemented from: internal::ISchemaStateFactory

GetInvalidDocumentPointer()

Gets the JSON pointer pointed to the invalid value.

GetInvalidSchemaKeyword()

Gets the keyword of invalid schema.

GetInvalidSchemaPointer()

Gets the JSON pointer pointed to the invalid schema.

Int(int i)

Int64(int64_t i)

IsValid()

Reimplemented from: internal::ISchemaValidator

Key(const Ch * str, SizeType len, bool copy)

MallocState(size_t size)

Reimplemented from: internal::ISchemaStateFactory

NoneOf(ISchemaValidator ** subvalidators, SizeType count)

NotAllOf(ISchemaValidator ** subvalidators, SizeType count)

NotMultipleOf(double actual, const SValue & expected)

Reimplemented from: internal::IValidationErrorHandler

NotMultipleOf(int64_t actual, const SValue & expected)

Reimplemented from: internal::IValidationErrorHandler

NotMultipleOf(uint64_t actual, const SValue & expected)

Reimplemented from: internal::IValidationErrorHandler

NotOneOf(ISchemaValidator ** subvalidators, SizeType count)

Null()

PropertyViolations(ISchemaValidator ** subvalidators, SizeType count)

RawNumber(const Ch * str, SizeType length, bool copy)

Reset()

Reset the internal states.

StartArray()

StartDependencyErrors()

Reimplemented from: internal::IValidationErrorHandler

StartDisallowedType()

Reimplemented from: internal::IValidationErrorHandler

StartMissingDependentProperties()

Reimplemented from: internal::IValidationErrorHandler

StartMissingProperties()

Reimplemented from: internal::IValidationErrorHandler

StartObject()

String(const Ch * str, SizeType length, bool copy)

TooFewItems(SizeType actualCount, SizeType expectedCount)

Reimplemented from: internal::IValidationErrorHandler

TooFewProperties(SizeType actualCount, SizeType expectedCount)

Reimplemented from: internal::IValidationErrorHandler

TooLong(const Ch * str, SizeType length, SizeType expected)

TooManyItems(SizeType actualCount, SizeType expectedCount)

Reimplemented from: internal::IValidationErrorHandler

TooManyProperties(SizeType actualCount, SizeType expectedCount)

Reimplemented from: internal::IValidationErrorHandler

TooShort(const Ch * str, SizeType length, SizeType expected)

Uint(unsigned u)

Uint64(uint64_t u)

Private Functions

GenericSchemaValidator(const SchemaDocumentType & schemaDocument, const SchemaType & root, const char * basePath, size_t basePathSize, StateAllocator * allocator, size_t schemaStackCapacity, size_t documentStackCapacity)

AddCurrentError(const typename SchemaType::ValueType & keyword, bool parent)

AddError(ValueType & keyword, ValueType & error)

AddErrorArray(const typename SchemaType::ValueType & keyword, ISchemaValidator ** subvalidators, SizeType count)

AddErrorLocation(ValueType & result, bool parent)

AddNumberError(const typename SchemaType::ValueType & keyword, ValueType & actual, const SValue & expected, const typename SchemaType::ValueType &(*)() exclusive)

AppendToken(const Ch * str, SizeType len)

BeginValue()

CurrentContext()

CurrentContext()

CurrentSchema()

EndValue()

GetStateAllocator()

MergeError(ValueType & other)

PopSchema()

PushSchema(const SchemaType & schema)