GenericSchemaDocument< ValueT, Allocator > Class Template Reference#
Classes |
Public Types |
Public Member Functions |
Static Public Member Functions |
Friends |
List of all members
GenericSchemaDocument< ValueT, Allocator > Class Template Reference
JSON schema document. More...
#include <schema.h>
Public Types | |
typedef ValueT | ValueType |
typedef IGenericRemoteSchemaDocumentProvider< GenericSchemaDocument > | IRemoteSchemaDocumentProviderType |
typedef Allocator | AllocatorType |
typedef ValueType::EncodingType | EncodingType |
typedef EncodingType::Ch | Ch |
typedef internal::Schema< GenericSchemaDocument > | SchemaType |
typedef GenericPointer< ValueType, Allocator > | PointerType |
typedef GenericValue< EncodingType, AllocatorType > | GValue |
typedef GenericUri< ValueType, Allocator > | UriType |
typedef GenericStringRef< Ch > | StringRefType |
Public Member Functions | |
GenericSchemaDocument (const ValueType &document, const Ch *uri=0, SizeType uriLength=0, IRemoteSchemaDocumentProviderType *remoteProvider=0, Allocator *allocator=0, const PointerType &pointer=PointerType(), const Specification &spec=Specification(kDraft04)) | |
Constructor. More... | |
~GenericSchemaDocument () | |
Destructor. More... | |
const GValue & | GetURI () const |
const Specification & | GetSpecification () const |
bool | IsSupportedSpecification () const |
const SchemaType & | GetRoot () const |
Get the root schema. More... | |
GValue & | GetError () |
Gets the error object. More... | |
const GValue & | GetError () const |
void | SchemaError (const SchemaErrorCode code, const PointerType &location) |
Default error method. More... | |
void | SchemaErrorValue (const SchemaErrorCode code, const PointerType &location, const Ch *value, SizeType length) |
Method for error with single string value insert. More... | |
void | SchemaErrorPointer (const SchemaErrorCode code, const PointerType &location, const Ch *value, SizeType length, const PointerType &pointer) |
Method for error with invalid pointer. More... | |
Static Public Member Functions | |
static const Specification | GetSpecification (const ValueType &document) |
Static method to get the specification of any schema document. More... | |
static const StringRefType & | GetSchemaErrorKeyword (SchemaErrorCode schemaErrorCode) |
Friends | |
class | internal::Schema< GenericSchemaDocument > |
template<typename , typename , typename > | |
class | GenericSchemaValidator |
Detailed Description
template<typename ValueT, typename Allocator = CrtAllocator>
class GenericSchemaDocument< ValueT, Allocator >
JSON schema document.
A JSON schema document is a compiled version of a JSON schema. It is basically a tree of internal::Schema.
- Note
- This is an immutable class (i.e. its instance cannot be modified after construction).
- Template Parameters
-
ValueT Type of JSON value (e.g. Value
), which also determine the encoding.Allocator Allocator type for allocating memory of this document.
Member Typedef Documentation
◆ AllocatorType
template<typename ValueT , typename Allocator = CrtAllocator>
typedef Allocator GenericSchemaDocument< ValueT, Allocator >::AllocatorType |
◆ Ch
template<typename ValueT , typename Allocator = CrtAllocator>
typedef EncodingType::Ch GenericSchemaDocument< ValueT, Allocator >::Ch |
◆ EncodingType
template<typename ValueT , typename Allocator = CrtAllocator>
typedef ValueType::EncodingType GenericSchemaDocument< ValueT, Allocator >::EncodingType |
◆ GValue
template<typename ValueT , typename Allocator = CrtAllocator>
typedef GenericValue<EncodingType, AllocatorType> GenericSchemaDocument< ValueT, Allocator >::GValue |
◆ IRemoteSchemaDocumentProviderType
template<typename ValueT , typename Allocator = CrtAllocator>
typedef IGenericRemoteSchemaDocumentProvider<GenericSchemaDocument> GenericSchemaDocument< ValueT, Allocator >::IRemoteSchemaDocumentProviderType |
◆ PointerType
template<typename ValueT , typename Allocator = CrtAllocator>
typedef GenericPointer<ValueType, Allocator> GenericSchemaDocument< ValueT, Allocator >::PointerType |
◆ SchemaType
template<typename ValueT , typename Allocator = CrtAllocator>
typedef internal::Schema<GenericSchemaDocument> GenericSchemaDocument< ValueT, Allocator >::SchemaType |
◆ StringRefType
template<typename ValueT , typename Allocator = CrtAllocator>
typedef GenericStringRef<Ch> GenericSchemaDocument< ValueT, Allocator >::StringRefType |
◆ UriType
template<typename ValueT , typename Allocator = CrtAllocator>
typedef GenericUri<ValueType, Allocator> GenericSchemaDocument< ValueT, Allocator >::UriType |
◆ ValueType
template<typename ValueT , typename Allocator = CrtAllocator>
typedef ValueT GenericSchemaDocument< ValueT, Allocator >::ValueType |
Constructor & Destructor Documentation
◆ GenericSchemaDocument()
template<typename ValueT , typename Allocator = CrtAllocator>
|
inlineexplicit |
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. pointer An optional JSON pointer to the start of the schema document spec Optional schema draft or OpenAPI version. Used if no specification in document. Defaults to draft-04.
◆ ~GenericSchemaDocument()
template<typename ValueT , typename Allocator = CrtAllocator>
|
inline |
Destructor.
Member Function Documentation
◆ GetError() [1/2]
template<typename ValueT , typename Allocator = CrtAllocator>
|
inline |
Gets the error object.
◆ GetError() [2/2]
template<typename ValueT , typename Allocator = CrtAllocator>
|
inline |
◆ GetRoot()
template<typename ValueT , typename Allocator = CrtAllocator>
|
inline |
Get the root schema.
◆ GetSchemaErrorKeyword()
template<typename ValueT , typename Allocator = CrtAllocator>
|
inlinestatic |
◆ GetSpecification() [1/2]
template<typename ValueT , typename Allocator = CrtAllocator>
|
inline |
◆ GetSpecification() [2/2]
template<typename ValueT , typename Allocator = CrtAllocator>
|
inlinestatic |
Static method to get the specification of any schema document.
◆ GetURI()
template<typename ValueT , typename Allocator = CrtAllocator>
|
inline |
◆ IsSupportedSpecification()
template<typename ValueT , typename Allocator = CrtAllocator>
|
inline |
◆ SchemaError()
template<typename ValueT , typename Allocator = CrtAllocator>
|
inline |
Default error method.
◆ SchemaErrorPointer()
template<typename ValueT , typename Allocator = CrtAllocator>
|
inline |
Method for error with invalid pointer.
◆ SchemaErrorValue()
template<typename ValueT , typename Allocator = CrtAllocator>
|
inline |
Method for error with single string value insert.
Friends And Related Function Documentation
◆ GenericSchemaValidator
template<typename ValueT , typename Allocator = CrtAllocator>
template<typename , typename , typename >
|
friend |
◆ internal::Schema< GenericSchemaDocument >
template<typename ValueT , typename Allocator = CrtAllocator>
|
friend |
The documentation for this class was generated from the following files: