Wire Sysio Wire Sysion 1.0.0
Loading...
Searching...
No Matches
SchemaValidatingReader< parseFlags, InputStream, SourceEncoding, SchemaDocumentType, StackAllocator > Class Template Reference

A helper class for parsing with validation. More...

#include <schema.h>

Public Types

typedef SchemaDocumentType::PointerType PointerType
 
typedef InputStream::Ch Ch
 
typedef GenericValue< SourceEncoding, StackAllocator > ValueType
 

Public Member Functions

 SchemaValidatingReader (InputStream &is, const SchemaDocumentType &sd)
 Constructor.
 
template<typename Handler >
bool operator() (Handler &handler)
 
const ParseResultGetParseResult () const
 
bool IsValid () const
 
const PointerTypeGetInvalidSchemaPointer () const
 
const ChGetInvalidSchemaKeyword () const
 
const PointerTypeGetInvalidDocumentPointer () const
 
const ValueTypeGetError () const
 

Detailed Description

template<unsigned parseFlags, typename InputStream, typename SourceEncoding, typename SchemaDocumentType = SchemaDocument, typename StackAllocator = CrtAllocator>
class SchemaValidatingReader< parseFlags, InputStream, SourceEncoding, SchemaDocumentType, StackAllocator >

This helper class is a functor, designed as a parameter of GenericDocument::Populate().

Template Parameters
parseFlagsCombination of ParseFlag.
InputStreamType of input stream, implementing Stream concept.
SourceEncodingEncoding of the input stream.
SchemaDocumentTypeType of schema document.
StackAllocatorAllocator type for stack.

Definition at line 2437 of file schema.h.

Member Typedef Documentation

◆ Ch

template<unsigned parseFlags, typename InputStream , typename SourceEncoding , typename SchemaDocumentType = SchemaDocument, typename StackAllocator = CrtAllocator>
InputStream::Ch SchemaValidatingReader< parseFlags, InputStream, SourceEncoding, SchemaDocumentType, StackAllocator >::Ch

Definition at line 2440 of file schema.h.

◆ PointerType

template<unsigned parseFlags, typename InputStream , typename SourceEncoding , typename SchemaDocumentType = SchemaDocument, typename StackAllocator = CrtAllocator>
SchemaDocumentType::PointerType SchemaValidatingReader< parseFlags, InputStream, SourceEncoding, SchemaDocumentType, StackAllocator >::PointerType

Definition at line 2439 of file schema.h.

◆ ValueType

template<unsigned parseFlags, typename InputStream , typename SourceEncoding , typename SchemaDocumentType = SchemaDocument, typename StackAllocator = CrtAllocator>
GenericValue<SourceEncoding, StackAllocator> SchemaValidatingReader< parseFlags, InputStream, SourceEncoding, SchemaDocumentType, StackAllocator >::ValueType

Definition at line 2441 of file schema.h.

Constructor & Destructor Documentation

◆ SchemaValidatingReader()

template<unsigned parseFlags, typename InputStream , typename SourceEncoding , typename SchemaDocumentType = SchemaDocument, typename StackAllocator = CrtAllocator>
SchemaValidatingReader< parseFlags, InputStream, SourceEncoding, SchemaDocumentType, StackAllocator >::SchemaValidatingReader ( InputStream & is,
const SchemaDocumentType & sd )
inline
Parameters
isInput stream.
sdSchema document.

Definition at line 2448 of file schema.h.

2448: is_(is), sd_(sd), invalidSchemaKeyword_(), error_(kObjectType), isValid_(true) {}
@ kObjectType
object
Definition rapidjson.h:648

Member Function Documentation

◆ GetError()

template<unsigned parseFlags, typename InputStream , typename SourceEncoding , typename SchemaDocumentType = SchemaDocument, typename StackAllocator = CrtAllocator>
const ValueType & SchemaValidatingReader< parseFlags, InputStream, SourceEncoding, SchemaDocumentType, StackAllocator >::GetError ( ) const
inline

Definition at line 2478 of file schema.h.

2478{ return error_; }
Here is the caller graph for this function:

◆ GetInvalidDocumentPointer()

template<unsigned parseFlags, typename InputStream , typename SourceEncoding , typename SchemaDocumentType = SchemaDocument, typename StackAllocator = CrtAllocator>
const PointerType & SchemaValidatingReader< parseFlags, InputStream, SourceEncoding, SchemaDocumentType, StackAllocator >::GetInvalidDocumentPointer ( ) const
inline

Definition at line 2477 of file schema.h.

2477{ return invalidDocumentPointer_; }
Here is the caller graph for this function:

◆ GetInvalidSchemaKeyword()

template<unsigned parseFlags, typename InputStream , typename SourceEncoding , typename SchemaDocumentType = SchemaDocument, typename StackAllocator = CrtAllocator>
const Ch * SchemaValidatingReader< parseFlags, InputStream, SourceEncoding, SchemaDocumentType, StackAllocator >::GetInvalidSchemaKeyword ( ) const
inline

Definition at line 2476 of file schema.h.

2476{ return invalidSchemaKeyword_; }
Here is the caller graph for this function:

◆ GetInvalidSchemaPointer()

template<unsigned parseFlags, typename InputStream , typename SourceEncoding , typename SchemaDocumentType = SchemaDocument, typename StackAllocator = CrtAllocator>
const PointerType & SchemaValidatingReader< parseFlags, InputStream, SourceEncoding, SchemaDocumentType, StackAllocator >::GetInvalidSchemaPointer ( ) const
inline

Definition at line 2475 of file schema.h.

2475{ return invalidSchemaPointer_; }
Here is the caller graph for this function:

◆ GetParseResult()

template<unsigned parseFlags, typename InputStream , typename SourceEncoding , typename SchemaDocumentType = SchemaDocument, typename StackAllocator = CrtAllocator>
const ParseResult & SchemaValidatingReader< parseFlags, InputStream, SourceEncoding, SchemaDocumentType, StackAllocator >::GetParseResult ( ) const
inline

Definition at line 2473 of file schema.h.

2473{ return parseResult_; }
Here is the caller graph for this function:

◆ IsValid()

template<unsigned parseFlags, typename InputStream , typename SourceEncoding , typename SchemaDocumentType = SchemaDocument, typename StackAllocator = CrtAllocator>
bool SchemaValidatingReader< parseFlags, InputStream, SourceEncoding, SchemaDocumentType, StackAllocator >::IsValid ( ) const
inline

Definition at line 2474 of file schema.h.

2474{ return isValid_; }
Here is the caller graph for this function:

◆ operator()()

template<unsigned parseFlags, typename InputStream , typename SourceEncoding , typename SchemaDocumentType = SchemaDocument, typename StackAllocator = CrtAllocator>
template<typename Handler >
bool SchemaValidatingReader< parseFlags, InputStream, SourceEncoding, SchemaDocumentType, StackAllocator >::operator() ( Handler & handler)
inline

Definition at line 2451 of file schema.h.

2451 {
2454 parseResult_ = reader.template Parse<parseFlags>(is_, validator);
2455
2456 isValid_ = validator.IsValid();
2457 if (isValid_) {
2458 invalidSchemaPointer_ = PointerType();
2459 invalidSchemaKeyword_ = 0;
2460 invalidDocumentPointer_ = PointerType();
2461 error_.SetObject();
2462 }
2463 else {
2464 invalidSchemaPointer_ = validator.GetInvalidSchemaPointer();
2465 invalidSchemaKeyword_ = validator.GetInvalidSchemaKeyword();
2466 invalidDocumentPointer_ = validator.GetInvalidDocumentPointer();
2467 error_.CopyFrom(validator.GetError(), allocator_);
2468 }
2469
2470 return parseResult_;
2471 }
SAX-style JSON parser. Use Reader for UTF8 encoding and default allocator.
Definition reader.h:537
JSON Schema Validator.
Definition schema.h:1767
SchemaDocumentType::PointerType PointerType
Definition schema.h:2439
Here is the call graph for this function:

The documentation for this class was generated from the following file: