DeepCover Embedded Security in IoT: Public-key Secured Data Paths
Dependencies: MaximInterface
GenericSchemaValidator< SchemaDocumentType, OutputHandler, StateAllocator > Class Template Reference
JSON Schema Validator. More...
#include <schema.h>
Inherits internal::ISchemaStateFactory< SchemaDocumentType::SchemaType >, and internal::ISchemaValidator.
Public Member Functions | |
GenericSchemaValidator (const SchemaDocumentType &schemaDocument, StateAllocator *allocator=0, size_t schemaStackCapacity=kDefaultSchemaStackCapacity, size_t documentStackCapacity=kDefaultDocumentStackCapacity) | |
Constructor without output handler. | |
GenericSchemaValidator (const SchemaDocumentType &schemaDocument, OutputHandler &outputHandler, StateAllocator *allocator=0, size_t schemaStackCapacity=kDefaultSchemaStackCapacity, size_t documentStackCapacity=kDefaultDocumentStackCapacity) | |
Constructor with output handler. | |
~GenericSchemaValidator () | |
Destructor. | |
void | Reset () |
Reset the internal states. | |
virtual bool | IsValid () const |
Checks whether the current state is valid. | |
PointerType | GetInvalidSchemaPointer () const |
Gets the JSON pointer pointed to the invalid schema. | |
const Ch * | GetInvalidSchemaKeyword () const |
Gets the keyword of invalid schema. | |
PointerType | GetInvalidDocumentPointer () const |
Gets the JSON pointer pointed to the invalid value. |
Detailed Description
template<typename SchemaDocumentType, typename OutputHandler = BaseReaderHandler<typename SchemaDocumentType::SchemaType::EncodingType>, typename StateAllocator = CrtAllocator>
class GenericSchemaValidator< SchemaDocumentType, OutputHandler, StateAllocator >
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()
.
- Template Parameters:
-
SchemaDocumentType Type of schema document. OutputHandler Type of output handler. Default handler does nothing. StateAllocator Allocator for storing the internal validation states.
Definition at line 1554 of file schema.h.
Constructor & Destructor Documentation
GenericSchemaValidator | ( | const SchemaDocumentType & | schemaDocument, |
StateAllocator * | allocator = 0 , |
||
size_t | schemaStackCapacity = kDefaultSchemaStackCapacity , |
||
size_t | documentStackCapacity = kDefaultDocumentStackCapacity |
||
) |
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 | ( | const SchemaDocumentType & | schemaDocument, |
OutputHandler & | outputHandler, | ||
StateAllocator * | allocator = 0 , |
||
size_t | schemaStackCapacity = kDefaultSchemaStackCapacity , |
||
size_t | documentStackCapacity = kDefaultDocumentStackCapacity |
||
) |
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.
Member Function Documentation
PointerType GetInvalidDocumentPointer | ( | ) | const |
const Ch* GetInvalidSchemaKeyword | ( | ) | const |
PointerType GetInvalidSchemaPointer | ( | ) | const |
virtual bool IsValid | ( | ) | const [virtual] |
Generated on Tue Jul 12 2022 12:06:51 by 1.7.2