GenericSchemaDocument
Engine/source/persistence/rapidjson/schema.h
JSON schema document.
Classes:
Public Types
AllocatorType
EncodingType::Ch
Ch
ValueType::EncodingType
EncodingType
IRemoteSchemaDocumentProviderType
PointerType
SchemaType
URIType
ValueT
ValueType
Public Friends
Private Attributes
Public Functions
GenericSchemaDocument(const ValueType & document, const Ch * uri, SizeType uriLength, IRemoteSchemaDocumentProviderType * remoteProvider, Allocator * allocator)
Constructor.
Destructor.
GetRoot()
Get the root schema.
Private Functions
Prohibit copying.
CreateSchema(const SchemaType ** schema, const PointerType & pointer, const ValueType & v, const ValueType & document)
CreateSchemaRecursive(const SchemaType ** schema, const PointerType & pointer, const ValueType & v, const ValueType & document)
GetPointer(const SchemaType * schema)
GetSchema(const PointerType & pointer)
bool
HandleRefSchema(const PointerType & source, const SchemaType ** schema, const ValueType & v, const ValueType & document)
Prohibit assignment.
Detailed Description
JSON schema document.
A JSON schema document is a compiled version of a JSON schema. It is basically a tree of internal::Schema.
note:Parameters:This is an immutable class (i.e. its instance cannot be modified after construction).
ValueT | Type of JSON value (e.g. Value), which also determine the encoding. |
Allocator | Allocator type for allocating memory of this document. |
Public Types
typedef Allocator AllocatorType
typedef EncodingType::Ch Ch
typedef ValueType::EncodingType EncodingType
typedef IGenericRemoteSchemaDocumentProvider< GenericSchemaDocument > IRemoteSchemaDocumentProviderType
typedef GenericPointer< ValueType, Allocator > PointerType
typedef internal::Schema< GenericSchemaDocument > SchemaType
typedef GenericValue< EncodingType, Allocator > URIType
typedef ValueT ValueType
Public Friends
Private Static Attributes
const size_t kInitialSchemaMapSize
const size_t kInitialSchemaRefSize
Private Attributes
Allocator * allocator_
Allocator * ownAllocator_
IRemoteSchemaDocumentProviderType * remoteProvider_
const SchemaType * root_
Root schema.
internal::Stack< Allocator > schemaMap_
internal::Stack< Allocator > schemaRef_
SchemaType * typeless_
URIType uri_
Public Functions
GenericSchemaDocument(const ValueType & document, const Ch * uri, SizeType uriLength, IRemoteSchemaDocumentProviderType * remoteProvider, Allocator * allocator)
Constructor.
Compile a JSON document into schema document.
Parameters:
document | A JSON document as source. |
uri | The base URI of this schema document for purposes of violation reporting. |
uriLength | Length of name, in code points. |
remoteProvider | An optional remote schema document provider for resolving remote reference. Can be null. |
allocator | An optional allocator instance for allocating memory. Can be null. |
~GenericSchemaDocument()
Destructor.
GetRoot()
Get the root schema.
GetURI()
Private Functions
GenericSchemaDocument(const GenericSchemaDocument & )
Prohibit copying.
CreateSchema(const SchemaType ** schema, const PointerType & pointer, const ValueType & v, const ValueType & document)
CreateSchemaRecursive(const SchemaType ** schema, const PointerType & pointer, const ValueType & v, const ValueType & document)
GetPointer(const SchemaType * schema)
GetSchema(const PointerType & pointer)
GetTypeless()
HandleRefSchema(const PointerType & source, const SchemaType ** schema, const ValueType & v, const ValueType & document)
operator=(const GenericSchemaDocument & )
Prohibit assignment.