DeepCover Embedded Security in IoT: Public-key Secured Data Paths

Dependencies:   MaximInterface

Embed: (wiki syntax)

« Back to documentation index

GenericSchemaValidator< SchemaDocumentType, OutputHandler, StateAllocator > Class Template Reference

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:
SchemaDocumentTypeType of schema document.
OutputHandlerType of output handler. Default handler does nothing.
StateAllocatorAllocator 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:
schemaDocumentThe schema document to conform to.
allocatorOptional allocator for storing internal validation states.
schemaStackCapacityOptional initial capacity of schema path stack.
documentStackCapacityOptional initial capacity of document path stack.

Definition at line 1571 of file schema.h.

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

Constructor with output handler.

Parameters:
schemaDocumentThe schema document to conform to.
allocatorOptional allocator for storing internal validation states.
schemaStackCapacityOptional initial capacity of schema path stack.
documentStackCapacityOptional initial capacity of document path stack.

Definition at line 1598 of file schema.h.

Destructor.

Definition at line 1620 of file schema.h.


Member Function Documentation

PointerType GetInvalidDocumentPointer (  ) const

Gets the JSON pointer pointed to the invalid value.

Definition at line 1648 of file schema.h.

const Ch* GetInvalidSchemaKeyword (  ) const

Gets the keyword of invalid schema.

Definition at line 1643 of file schema.h.

PointerType GetInvalidSchemaPointer (  ) const

Gets the JSON pointer pointed to the invalid schema.

Definition at line 1638 of file schema.h.

virtual bool IsValid (  ) const [virtual]

Checks whether the current state is valid.

Definition at line 1635 of file schema.h.

void Reset (  )

Reset the internal states.

Definition at line 1626 of file schema.h.