载入中...
搜索中...
未找到
rapidjson::GenericSchemaDocument< ValueT, Allocator > 模板类 参考

JSON schema document. 更多...

#include <schema.h>

Public 类型

typedef ValueT ValueType
typedef IGenericRemoteSchemaDocumentProvider< GenericSchemaDocumentIRemoteSchemaDocumentProviderType
typedef Allocator AllocatorType
typedef ValueType::EncodingType EncodingType
typedef EncodingType::Ch Ch
typedef internal::Schema< GenericSchemaDocumentSchemaType
typedef GenericPointer< ValueType, AllocatorPointerType
typedef GenericValue< EncodingType, AllocatorTypeGValue
typedef GenericUri< ValueType, AllocatorUriType
typedef GenericStringRef< Ch > StringRefType

Public 成员函数

 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.
 ~GenericSchemaDocument ()
 Destructor
const GValueGetURI () const
const SpecificationGetSpecification () const
bool IsSupportedSpecification () const
const SchemaType & GetRoot () const
 Get the root schema.
GValueGetError ()
 Gets the error object.
const GValueGetError () const
void SchemaError (const SchemaErrorCode code, const PointerType &location)
 Default error method
void SchemaErrorValue (const SchemaErrorCode code, const PointerType &location, const Ch *value, SizeType length)
 Method for error with single string value insert
void SchemaErrorPointer (const SchemaErrorCode code, const PointerType &location, const Ch *value, SizeType length, const PointerType &pointer)
 Method for error with invalid pointer

静态 Public 成员函数

static const Specification GetSpecification (const ValueType &document)
 Static method to get the specification of any schema document
static const StringRefTypeGetSchemaErrorKeyword (SchemaErrorCode schemaErrorCode)

友元

template<typename, typename, typename>
class GenericSchemaValidator

详细描述

template<typename ValueT, typename Allocator = CrtAllocator>
class rapidjson::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.

注解
This is an immutable class (i.e. its instance cannot be modified after construction).
模板参数
ValueTType of JSON value (e.g. Value ), which also determine the encoding.
AllocatorAllocator type for allocating memory of this document.

构造及析构函数说明

◆ GenericSchemaDocument()

template<typename ValueT, typename Allocator = CrtAllocator>
rapidjson::GenericSchemaDocument< ValueT, Allocator >::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) )
inlineexplicit

Constructor.

Compile a JSON document into schema document.

参数
documentA JSON document as source.
uriThe base URI of this schema document for purposes of violation reporting.
uriLengthLength of name, in code points.
remoteProviderAn optional remote schema document provider for resolving remote reference. Can be null.
allocatorAn optional allocator instance for allocating memory. Can be null.
pointerAn optional JSON pointer to the start of the schema document
specOptional schema draft or OpenAPI version. Used if no specification in document. Defaults to draft-04.

该类的文档由以下文件生成: