IN2OSM  1.0.1
GenericSchemaValidator< SchemaDocumentType, OutputHandler, StateAllocator >abstract

JSON Schema Validator. More...

#include <fwd.h>

Inheritance diagram for GenericSchemaValidator< SchemaDocumentType, OutputHandler, StateAllocator >:
Inheritance graph
Collaboration diagram for GenericSchemaValidator< SchemaDocumentType, OutputHandler, StateAllocator >:
Collaboration graph

Public Types

typedef SchemaDocumentType::SchemaType SchemaType
 
typedef SchemaDocumentType::PointerType PointerType
 
typedef SchemaType::EncodingType EncodingType
 
typedef SchemaType::SValue SValue
 
typedef EncodingType::Ch Ch
 
typedef GenericStringRef< ChStringRefType
 
typedef GenericValue< EncodingType, StateAllocator > ValueType
 

Public Member Functions

 GenericSchemaValidator (const SchemaDocumentType &schemaDocument, StateAllocator *allocator=0, size_t schemaStackCapacity=kDefaultSchemaStackCapacity, size_t documentStackCapacity=kDefaultDocumentStackCapacity)
 Constructor without output handler. More...
 
 GenericSchemaValidator (const SchemaDocumentType &schemaDocument, OutputHandler &outputHandler, StateAllocator *allocator=0, size_t schemaStackCapacity=kDefaultSchemaStackCapacity, size_t documentStackCapacity=kDefaultDocumentStackCapacity)
 Constructor with output handler. More...
 
 ~GenericSchemaValidator ()
 Destructor. More...
 
void Reset ()
 Reset the internal states. More...
 
virtual bool IsValid () const
 Checks whether the current state is valid. More...
 
ValueTypeGetError ()
 Gets the error object. More...
 
const ValueTypeGetError () const
 
PointerType GetInvalidSchemaPointer () const
 Gets the JSON pointer pointed to the invalid schema. More...
 
const ChGetInvalidSchemaKeyword () const
 Gets the keyword of invalid schema. More...
 
PointerType GetInvalidDocumentPointer () const
 Gets the JSON pointer pointed to the invalid value. More...
 
void NotMultipleOf (int64_t actual, const SValue &expected)
 
void NotMultipleOf (uint64_t actual, const SValue &expected)
 
void NotMultipleOf (double actual, const SValue &expected)
 
void AboveMaximum (int64_t actual, const SValue &expected, bool exclusive)
 
void AboveMaximum (uint64_t actual, const SValue &expected, bool exclusive)
 
void AboveMaximum (double actual, const SValue &expected, bool exclusive)
 
void BelowMinimum (int64_t actual, const SValue &expected, bool exclusive)
 
void BelowMinimum (uint64_t actual, const SValue &expected, bool exclusive)
 
void BelowMinimum (double actual, const SValue &expected, bool exclusive)
 
void TooLong (const Ch *str, SizeType length, SizeType expected)
 
void TooShort (const Ch *str, SizeType length, SizeType expected)
 
void DoesNotMatch (const Ch *str, SizeType length)
 
void DisallowedItem (SizeType index)
 
void TooFewItems (SizeType actualCount, SizeType expectedCount)
 
void TooManyItems (SizeType actualCount, SizeType expectedCount)
 
void DuplicateItems (SizeType index1, SizeType index2)
 
void TooManyProperties (SizeType actualCount, SizeType expectedCount)
 
void TooFewProperties (SizeType actualCount, SizeType expectedCount)
 
void StartMissingProperties ()
 
void AddMissingProperty (const SValue &name)
 
bool EndMissingProperties ()
 
void PropertyViolations (ISchemaValidator **subvalidators, SizeType count)
 
void DisallowedProperty (const Ch *name, SizeType length)
 
void StartDependencyErrors ()
 
void StartMissingDependentProperties ()
 
void AddMissingDependentProperty (const SValue &targetName)
 
void EndMissingDependentProperties (const SValue &sourceName)
 
void AddDependencySchemaError (const SValue &sourceName, ISchemaValidator *subvalidator)
 
bool EndDependencyErrors ()
 
void DisallowedValue ()
 
void StartDisallowedType ()
 
void AddExpectedType (const typename SchemaType::ValueType &expectedType)
 
void EndDisallowedType (const typename SchemaType::ValueType &actualType)
 
void NotAllOf (ISchemaValidator **subvalidators, SizeType count)
 
void NoneOf (ISchemaValidator **subvalidators, SizeType count)
 
void NotOneOf (ISchemaValidator **subvalidators, SizeType count)
 
void Disallowed ()
 
bool Null ()
 
bool Bool (bool b)
 
bool Int (int i)
 
bool Uint (unsigned u)
 
bool Int64 (int64_t i)
 
bool Uint64 (uint64_t u)
 
bool Double (double d)
 
bool RawNumber (const Ch *str, SizeType length, bool copy)
 
bool String (const Ch *str, SizeType length, bool copy)
 
bool StartObject ()
 
bool Key (const Ch *str, SizeType len, bool copy)
 
bool EndObject (SizeType memberCount)
 
bool StartArray ()
 
bool EndArray (SizeType elementCount)
 
virtual ISchemaValidator * CreateSchemaValidator (const SchemaType &root)
 
virtual void DestroySchemaValidator (ISchemaValidator *validator)
 
virtual void * CreateHasher ()
 
virtual uint64_t GetHashCode (void *hasher)
 
virtual void DestroryHasher (void *hasher)
 
virtual void * MallocState (size_t size)
 
virtual void FreeState (void *p)
 
virtual void DestroySchemaValidator (ISchemaValidator *validator)=0
 
virtual void NotMultipleOf (int64_t actual, const SValue &expected)=0
 
virtual void NotMultipleOf (uint64_t actual, const SValue &expected)=0
 
virtual void NotMultipleOf (double actual, const SValue &expected)=0
 
virtual void AboveMaximum (int64_t actual, const SValue &expected, bool exclusive)=0
 
virtual void AboveMaximum (uint64_t actual, const SValue &expected, bool exclusive)=0
 
virtual void AboveMaximum (double actual, const SValue &expected, bool exclusive)=0
 
virtual void BelowMinimum (int64_t actual, const SValue &expected, bool exclusive)=0
 
virtual void BelowMinimum (uint64_t actual, const SValue &expected, bool exclusive)=0
 
virtual void BelowMinimum (double actual, const SValue &expected, bool exclusive)=0
 
virtual void TooLong (const Ch *str, SizeType length, SizeType expected)=0
 
virtual void TooShort (const Ch *str, SizeType length, SizeType expected)=0
 
virtual void DoesNotMatch (const Ch *str, SizeType length)=0
 
virtual void AddMissingProperty (const SValue &name)=0
 
virtual void PropertyViolations (ISchemaValidator **subvalidators, SizeType count)=0
 
virtual void DisallowedProperty (const Ch *name, SizeType length)=0
 
virtual void AddMissingDependentProperty (const SValue &targetName)=0
 
virtual void EndMissingDependentProperties (const SValue &sourceName)=0
 
virtual void AddDependencySchemaError (const SValue &souceName, ISchemaValidator *subvalidator)=0
 
virtual void AddExpectedType (const typename SchemaDocumentType::SchemaType ::ValueType &expectedType)=0
 
virtual void EndDisallowedType (const typename SchemaDocumentType::SchemaType ::ValueType &actualType)=0
 
virtual void NotAllOf (ISchemaValidator **subvalidators, SizeType count)=0
 
virtual void NoneOf (ISchemaValidator **subvalidators, SizeType count)=0
 
virtual void NotOneOf (ISchemaValidator **subvalidators, SizeType count)=0
 

Private Types

typedef SchemaType::Context Context
 
typedef GenericValue< UTF8<>, StateAllocator > HashCodeArray
 
typedef internal::Hasher< EncodingType, StateAllocator > HasherType
 

Private Member Functions

 GenericSchemaValidator (const SchemaDocumentType &schemaDocument, const SchemaType &root, const char *basePath, size_t basePathSize, StateAllocator *allocator=0, size_t schemaStackCapacity=kDefaultSchemaStackCapacity, size_t documentStackCapacity=kDefaultDocumentStackCapacity)
 
StateAllocator & GetStateAllocator ()
 
bool BeginValue ()
 
bool EndValue ()
 
void AppendToken (const Ch *str, SizeType len)
 
RAPIDJSON_FORCEINLINE void PushSchema (const SchemaType &schema)
 
RAPIDJSON_FORCEINLINE void PopSchema ()
 
void AddErrorLocation (ValueType &result, bool parent)
 
void AddError (ValueType &keyword, ValueType &error)
 
void AddCurrentError (const typename SchemaType::ValueType &keyword, bool parent=false)
 
void MergeError (ValueType &other)
 
void AddNumberError (const typename SchemaType::ValueType &keyword, ValueType &actual, const SValue &expected, const typename SchemaType::ValueType &(*exclusive)()=0)
 
void AddErrorArray (const typename SchemaType::ValueType &keyword, ISchemaValidator **subvalidators, SizeType count)
 
const SchemaTypeCurrentSchema () const
 
ContextCurrentContext ()
 
const ContextCurrentContext () const
 

Private Attributes

const SchemaDocumentType * schemaDocument_
 
const SchemaTyperoot_
 
StateAllocator * stateAllocator_
 
StateAllocator * ownStateAllocator_
 
internal::Stack< StateAllocator > schemaStack_
 stack to store the current path of schema (BaseSchemaType *) More...
 
internal::Stack< StateAllocator > documentStack_
 stack to store the current path of validating document (Ch) More...
 
OutputHandler * outputHandler_
 
ValueType error_
 
ValueType currentError_
 
ValueType missingDependents_
 
bool valid_
 

Static Private Attributes

static const size_t kDefaultSchemaStackCapacity = 1024
 
static const size_t kDefaultDocumentStackCapacity = 256
 

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 145 of file fwd.h.

Member Typedef Documentation

◆ Ch

typedef EncodingType::Ch Ch

Definition at line 1773 of file schema.h.

◆ Context

typedef SchemaType::Context Context
private

Definition at line 2192 of file schema.h.

◆ EncodingType

typedef SchemaType::EncodingType EncodingType

Definition at line 1771 of file schema.h.

◆ HashCodeArray

typedef GenericValue<UTF8<>, StateAllocator> HashCodeArray
private

Definition at line 2193 of file schema.h.

◆ HasherType

typedef internal::Hasher<EncodingType, StateAllocator> HasherType
private

Definition at line 2194 of file schema.h.

◆ PointerType

typedef SchemaDocumentType::PointerType PointerType

Definition at line 1770 of file schema.h.

◆ SchemaType

typedef SchemaDocumentType::SchemaType SchemaType

Definition at line 1769 of file schema.h.

◆ StringRefType

Definition at line 1774 of file schema.h.

◆ SValue

typedef SchemaType::SValue SValue

Definition at line 1772 of file schema.h.

◆ ValueType

typedef GenericValue<EncodingType, StateAllocator> ValueType

Definition at line 1775 of file schema.h.

Constructor & Destructor Documentation

◆ GenericSchemaValidator() [1/3]

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

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 1784 of file schema.h.

1789  :
1790  schemaDocument_(&schemaDocument),
1791  root_(schemaDocument.GetRoot()),
1792  stateAllocator_(allocator),
1793  ownStateAllocator_(0),
1794  schemaStack_(allocator, schemaStackCapacity),
1795  documentStack_(allocator, documentStackCapacity),
1796  outputHandler_(0),
1798  currentError_(),
1800  valid_(true)
1801 #if RAPIDJSON_SCHEMA_VERBOSE
1802  , depth_(0)
1803 #endif
1804  {
1805  }
object
Definition: rapidjson.h:646
StateAllocator * ownStateAllocator_
Definition: schema.h:2403
OutputHandler * outputHandler_
Definition: schema.h:2406
internal::Stack< StateAllocator > documentStack_
stack to store the current path of validating document (Ch)
Definition: schema.h:2405
ValueType currentError_
Definition: schema.h:2408
internal::Stack< StateAllocator > schemaStack_
stack to store the current path of schema (BaseSchemaType *)
Definition: schema.h:2404
const SchemaDocumentType * schemaDocument_
Definition: schema.h:2400
ValueType missingDependents_
Definition: schema.h:2409
const SchemaType & root_
Definition: schema.h:2401
StateAllocator * stateAllocator_
Definition: schema.h:2402

◆ GenericSchemaValidator() [2/3]

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

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 1814 of file schema.h.

1820  :
1821  schemaDocument_(&schemaDocument),
1822  root_(schemaDocument.GetRoot()),
1823  stateAllocator_(allocator),
1824  ownStateAllocator_(0),
1825  schemaStack_(allocator, schemaStackCapacity),
1826  documentStack_(allocator, documentStackCapacity),
1827  outputHandler_(&outputHandler),
1829  currentError_(),
1831  valid_(true)
1832 #if RAPIDJSON_SCHEMA_VERBOSE
1833  , depth_(0)
1834 #endif
1835  {
1836  }
object
Definition: rapidjson.h:646
StateAllocator * ownStateAllocator_
Definition: schema.h:2403
OutputHandler * outputHandler_
Definition: schema.h:2406
internal::Stack< StateAllocator > documentStack_
stack to store the current path of validating document (Ch)
Definition: schema.h:2405
ValueType currentError_
Definition: schema.h:2408
internal::Stack< StateAllocator > schemaStack_
stack to store the current path of schema (BaseSchemaType *)
Definition: schema.h:2404
const SchemaDocumentType * schemaDocument_
Definition: schema.h:2400
ValueType missingDependents_
Definition: schema.h:2409
const SchemaType & root_
Definition: schema.h:2401
StateAllocator * stateAllocator_
Definition: schema.h:2402

◆ ~GenericSchemaValidator()

Destructor.

Definition at line 1839 of file schema.h.

1839  {
1840  Reset();
1842  }
StateAllocator * ownStateAllocator_
Definition: schema.h:2403
void Reset()
Reset the internal states.
Definition: schema.h:1845
#define RAPIDJSON_DELETE(x)
! customization point for global delete
Definition: rapidjson.h:629
Here is the caller graph for this function:

◆ GenericSchemaValidator() [3/3]

GenericSchemaValidator ( const SchemaDocumentType &  schemaDocument,
const SchemaType root,
const char *  basePath,
size_t  basePathSize,
StateAllocator *  allocator = 0,
size_t  schemaStackCapacity = kDefaultSchemaStackCapacity,
size_t  documentStackCapacity = kDefaultDocumentStackCapacity 
)
inlineprivate

Definition at line 2196 of file schema.h.

2206  :
2207  schemaDocument_(&schemaDocument),
2208  root_(root),
2209  stateAllocator_(allocator),
2210  ownStateAllocator_(0),
2211  schemaStack_(allocator, schemaStackCapacity),
2212  documentStack_(allocator, documentStackCapacity),
2213  outputHandler_(0),
2215  currentError_(),
2217  valid_(true)
2218 #if RAPIDJSON_SCHEMA_VERBOSE
2219  , depth_(depth)
2220 #endif
2221  {
2222  if (basePath && basePathSize)
2223  memcpy(documentStack_.template Push<char>(basePathSize), basePath, basePathSize);
2224  }
object
Definition: rapidjson.h:646
StateAllocator * ownStateAllocator_
Definition: schema.h:2403
OutputHandler * outputHandler_
Definition: schema.h:2406
internal::Stack< StateAllocator > documentStack_
stack to store the current path of validating document (Ch)
Definition: schema.h:2405
ValueType currentError_
Definition: schema.h:2408
internal::Stack< StateAllocator > schemaStack_
stack to store the current path of schema (BaseSchemaType *)
Definition: schema.h:2404
const SchemaDocumentType * schemaDocument_
Definition: schema.h:2400
ValueType missingDependents_
Definition: schema.h:2409
const SchemaType & root_
Definition: schema.h:2401
StateAllocator * stateAllocator_
Definition: schema.h:2402

Member Function Documentation

◆ AboveMaximum() [1/6]

virtual void AboveMaximum ( int64_t  actual,
const SValue expected,
bool  exclusive 
)
pure virtualinherited

◆ AboveMaximum() [2/6]

virtual void AboveMaximum ( uint64_t  actual,
const SValue expected,
bool  exclusive 
)
pure virtualinherited

◆ AboveMaximum() [3/6]

virtual void AboveMaximum ( double  actual,
const SValue expected,
bool  exclusive 
)
pure virtualinherited

◆ AboveMaximum() [4/6]

void AboveMaximum ( int64_t  actual,
const SValue expected,
bool  exclusive 
)
inline

Definition at line 1892 of file schema.h.

1892  {
1893  AddNumberError(SchemaType::GetMaximumString(), ValueType(actual).Move(), expected,
1894  exclusive ? &SchemaType::GetExclusiveMaximumString : 0);
1895  }
GenericValue< EncodingType, StateAllocator > ValueType
Definition: schema.h:1775
void AddNumberError(const typename SchemaType::ValueType &keyword, ValueType &actual, const SValue &expected, const typename SchemaType::ValueType &(*exclusive)()=0)
Definition: schema.h:2374

◆ AboveMaximum() [5/6]

void AboveMaximum ( uint64_t  actual,
const SValue expected,
bool  exclusive 
)
inline

Definition at line 1896 of file schema.h.

1896  {
1897  AddNumberError(SchemaType::GetMaximumString(), ValueType(actual).Move(), expected,
1898  exclusive ? &SchemaType::GetExclusiveMaximumString : 0);
1899  }
GenericValue< EncodingType, StateAllocator > ValueType
Definition: schema.h:1775
void AddNumberError(const typename SchemaType::ValueType &keyword, ValueType &actual, const SValue &expected, const typename SchemaType::ValueType &(*exclusive)()=0)
Definition: schema.h:2374

◆ AboveMaximum() [6/6]

void AboveMaximum ( double  actual,
const SValue expected,
bool  exclusive 
)
inline

Definition at line 1900 of file schema.h.

1900  {
1901  AddNumberError(SchemaType::GetMaximumString(), ValueType(actual).Move(), expected,
1902  exclusive ? &SchemaType::GetExclusiveMaximumString : 0);
1903  }
GenericValue< EncodingType, StateAllocator > ValueType
Definition: schema.h:1775
void AddNumberError(const typename SchemaType::ValueType &keyword, ValueType &actual, const SValue &expected, const typename SchemaType::ValueType &(*exclusive)()=0)
Definition: schema.h:2374

◆ AddCurrentError()

void AddCurrentError ( const typename SchemaType::ValueType &  keyword,
bool  parent = false 
)
inlineprivate

Definition at line 2363 of file schema.h.

2363  {
2365  AddError(ValueType(keyword, GetStateAllocator(), false).Move(), currentError_);
2366  }
StateAllocator & GetStateAllocator()
Definition: schema.h:2226
ValueType currentError_
Definition: schema.h:2408
GenericValue< EncodingType, StateAllocator > ValueType
Definition: schema.h:1775
void AddErrorLocation(ValueType &result, bool parent)
Definition: schema.h:2330
void AddError(ValueType &keyword, ValueType &error)
Definition: schema.h:2349

◆ AddDependencySchemaError() [1/2]

virtual void AddDependencySchemaError ( const SValue souceName,
ISchemaValidator subvalidator 
)
pure virtualinherited

◆ AddDependencySchemaError() [2/2]

void AddDependencySchemaError ( const SValue sourceName,
ISchemaValidator *  subvalidator 
)
inline

Definition at line 2000 of file schema.h.

2000  {
2001  currentError_.AddMember(ValueType(sourceName, GetStateAllocator()).Move(),
2002  static_cast<GenericSchemaValidator*>(subvalidator)->GetError(), GetStateAllocator());
2003  }
StateAllocator & GetStateAllocator()
Definition: schema.h:2226
ValueType currentError_
Definition: schema.h:2408
ValueType & GetError()
Gets the error object.
Definition: schema.h:1860
GenericValue< EncodingType, StateAllocator > ValueType
Definition: schema.h:1775

◆ AddError()

void AddError ( ValueType keyword,
ValueType error 
)
inlineprivate

Definition at line 2349 of file schema.h.

2349  {
2350  typename ValueType::MemberIterator member = error_.FindMember(keyword);
2351  if (member == error_.MemberEnd())
2352  error_.AddMember(keyword, error, GetStateAllocator());
2353  else {
2354  if (member->value.IsObject()) {
2355  ValueType errors(kArrayType);
2356  errors.PushBack(member->value, GetStateAllocator());
2357  member->value = errors;
2358  }
2359  member->value.PushBack(error, GetStateAllocator());
2360  }
2361  }
StateAllocator & GetStateAllocator()
Definition: schema.h:2226
array
Definition: rapidjson.h:647
GenericValue< EncodingType, StateAllocator > ValueType
Definition: schema.h:1775
GenericMemberIterator< false, EncodingType, StateAllocator >::Iterator MemberIterator
Member iterator for iterating in object.
Definition: document.h:586

◆ AddErrorArray()

void AddErrorArray ( const typename SchemaType::ValueType &  keyword,
ISchemaValidator **  subvalidators,
SizeType  count 
)
inlineprivate

Definition at line 2384 of file schema.h.

2385  {
2386  ValueType errors(kArrayType);
2387  for (SizeType i = 0; i < count; ++i)
2388  errors.PushBack(static_cast<GenericSchemaValidator*>(subvalidators[i])->GetError(), GetStateAllocator());
2389  currentError_.SetObject();
2390  currentError_.AddMember(GetErrorsString(), errors, GetStateAllocator());
2391  AddCurrentError(keyword);
2392  }
StateAllocator & GetStateAllocator()
Definition: schema.h:2226
RAPIDJSON_NAMESPACE_BEGIN typedef unsigned SizeType
Size type (for string lengths, array sizes, etc.)
Definition: rapidjson.h:384
array
Definition: rapidjson.h:647
ValueType currentError_
Definition: schema.h:2408
GenericValue< EncodingType, StateAllocator > ValueType
Definition: schema.h:1775
void AddCurrentError(const typename SchemaType::ValueType &keyword, bool parent=false)
Definition: schema.h:2363

◆ AddErrorLocation()

void AddErrorLocation ( ValueType result,
bool  parent 
)
inlineprivate

Definition at line 2330 of file schema.h.

2330  {
2332  PointerType instancePointer = GetInvalidDocumentPointer();
2333  ((parent && instancePointer.GetTokenCount() > 0)
2334  ? PointerType(instancePointer.GetTokens(), instancePointer.GetTokenCount() - 1)
2335  : instancePointer).StringifyUriFragment(sb);
2336  ValueType instanceRef(sb.GetString(), static_cast<SizeType>(sb.GetSize() / sizeof(Ch)),
2337  GetStateAllocator());
2338  result.AddMember(GetInstanceRefString(), instanceRef, GetStateAllocator());
2339  sb.Clear();
2340  memcpy(sb.Push(CurrentSchema().GetURI().GetStringLength()),
2341  CurrentSchema().GetURI().GetString(),
2342  CurrentSchema().GetURI().GetStringLength() * sizeof(Ch));
2343  GetInvalidSchemaPointer().StringifyUriFragment(sb);
2344  ValueType schemaRef(sb.GetString(), static_cast<SizeType>(sb.GetSize() / sizeof(Ch)),
2345  GetStateAllocator());
2346  result.AddMember(GetSchemaRefString(), schemaRef, GetStateAllocator());
2347  }
StateAllocator & GetStateAllocator()
Definition: schema.h:2226
RAPIDJSON_NAMESPACE_BEGIN typedef unsigned SizeType
Size type (for string lengths, array sizes, etc.)
Definition: rapidjson.h:384
Represents an in-memory output stream.
Definition: fwd.h:59
Ch * Push(size_t count)
Definition: stringbuffer.h:69
const Ch * GetString() const
Definition: stringbuffer.h:73
size_t GetSize() const
Get the size of string in bytes in the string buffer.
Definition: stringbuffer.h:82
GenericValue< EncodingType, StateAllocator > ValueType
Definition: schema.h:1775
PointerType GetInvalidSchemaPointer() const
Gets the JSON pointer pointed to the invalid schema.
Definition: schema.h:1864
const SchemaType & CurrentSchema() const
Definition: schema.h:2394
PointerType GetInvalidDocumentPointer() const
Gets the JSON pointer pointed to the invalid value.
Definition: schema.h:1874
EncodingType::Ch Ch
Definition: schema.h:1773
SchemaDocumentType::PointerType PointerType
Definition: schema.h:1770
Here is the call graph for this function:

◆ AddExpectedType() [1/2]

virtual void AddExpectedType ( const typename SchemaDocumentType::SchemaType ::ValueType &  expectedType)
pure virtualinherited

◆ AddExpectedType() [2/2]

void AddExpectedType ( const typename SchemaType::ValueType &  expectedType)
inline

Definition at line 2021 of file schema.h.

2021  {
2022  currentError_.PushBack(ValueType(expectedType, GetStateAllocator()).Move(), GetStateAllocator());
2023  }
StateAllocator & GetStateAllocator()
Definition: schema.h:2226
ValueType currentError_
Definition: schema.h:2408
GenericValue< EncodingType, StateAllocator > ValueType
Definition: schema.h:1775

◆ AddMissingDependentProperty() [1/2]

virtual void AddMissingDependentProperty ( const SValue targetName)
pure virtualinherited

◆ AddMissingDependentProperty() [2/2]

void AddMissingDependentProperty ( const SValue targetName)
inline

Definition at line 1992 of file schema.h.

1992  {
1993  missingDependents_.PushBack(ValueType(targetName, GetStateAllocator()).Move(), GetStateAllocator());
1994  }
StateAllocator & GetStateAllocator()
Definition: schema.h:2226
GenericValue< EncodingType, StateAllocator > ValueType
Definition: schema.h:1775
ValueType missingDependents_
Definition: schema.h:2409

◆ AddMissingProperty() [1/2]

virtual void AddMissingProperty ( const SValue name)
pure virtualinherited

◆ AddMissingProperty() [2/2]

void AddMissingProperty ( const SValue name)
inline

Definition at line 1964 of file schema.h.

1964  {
1965  currentError_.PushBack(ValueType(name, GetStateAllocator()).Move(), GetStateAllocator());
1966  }
StateAllocator & GetStateAllocator()
Definition: schema.h:2226
ValueType currentError_
Definition: schema.h:2408
GenericValue< EncodingType, StateAllocator > ValueType
Definition: schema.h:1775

◆ AddNumberError()

void AddNumberError ( const typename SchemaType::ValueType &  keyword,
ValueType actual,
const SValue expected,
const typename SchemaType::ValueType &(*)()  exclusive = 0 
)
inlineprivate

Definition at line 2374 of file schema.h.

2375  {
2376  currentError_.SetObject();
2377  currentError_.AddMember(GetActualString(), actual, GetStateAllocator());
2378  currentError_.AddMember(GetExpectedString(), ValueType(expected, GetStateAllocator()).Move(), GetStateAllocator());
2379  if (exclusive)
2380  currentError_.AddMember(ValueType(exclusive(), GetStateAllocator()).Move(), true, GetStateAllocator());
2381  AddCurrentError(keyword);
2382  }
StateAllocator & GetStateAllocator()
Definition: schema.h:2226
ValueType currentError_
Definition: schema.h:2408
GenericValue< EncodingType, StateAllocator > ValueType
Definition: schema.h:1775
void AddCurrentError(const typename SchemaType::ValueType &keyword, bool parent=false)
Definition: schema.h:2363

◆ AppendToken()

void AppendToken ( const Ch str,
SizeType  len 
)
inlineprivate

Definition at line 2302 of file schema.h.

2302  {
2303  documentStack_.template Reserve<Ch>(1 + len * 2); // worst case all characters are escaped as two characters
2304  *documentStack_.template PushUnsafe<Ch>() = '/';
2305  for (SizeType i = 0; i < len; i++) {
2306  if (str[i] == '~') {
2307  *documentStack_.template PushUnsafe<Ch>() = '~';
2308  *documentStack_.template PushUnsafe<Ch>() = '0';
2309  }
2310  else if (str[i] == '/') {
2311  *documentStack_.template PushUnsafe<Ch>() = '~';
2312  *documentStack_.template PushUnsafe<Ch>() = '1';
2313  }
2314  else
2315  *documentStack_.template PushUnsafe<Ch>() = str[i];
2316  }
2317  }
RAPIDJSON_NAMESPACE_BEGIN typedef unsigned SizeType
Size type (for string lengths, array sizes, etc.)
Definition: rapidjson.h:384
internal::Stack< StateAllocator > documentStack_
stack to store the current path of validating document (Ch)
Definition: schema.h:2405

◆ BeginValue()

bool BeginValue ( )
inlineprivate

Definition at line 2232 of file schema.h.

2232  {
2233  if (schemaStack_.Empty())
2234  PushSchema(root_);
2235  else {
2236  if (CurrentContext().inArray)
2237  internal::TokenHelper<internal::Stack<StateAllocator>, Ch>::AppendIndexToken(documentStack_, CurrentContext().arrayElementIndex);
2238 
2239  if (!CurrentSchema().BeginValue(CurrentContext()))
2240  return false;
2241 
2242  SizeType count = CurrentContext().patternPropertiesSchemaCount;
2243  const SchemaType** sa = CurrentContext().patternPropertiesSchemas;
2244  typename Context::PatternValidatorType patternValidatorType = CurrentContext().valuePatternValidatorType;
2245  bool valueUniqueness = CurrentContext().valueUniqueness;
2246  RAPIDJSON_ASSERT(CurrentContext().valueSchema);
2247  PushSchema(*CurrentContext().valueSchema);
2248 
2249  if (count > 0) {
2250  CurrentContext().objectPatternValidatorType = patternValidatorType;
2251  ISchemaValidator**& va = CurrentContext().patternPropertiesValidators;
2252  SizeType& validatorCount = CurrentContext().patternPropertiesValidatorCount;
2253  va = static_cast<ISchemaValidator**>(MallocState(sizeof(ISchemaValidator*) * count));
2254  for (SizeType i = 0; i < count; i++)
2255  va[validatorCount++] = CreateSchemaValidator(*sa[i]);
2256  }
2257 
2258  CurrentContext().arrayUniqueness = valueUniqueness;
2259  }
2260  return true;
2261  }
Context & CurrentContext()
Definition: schema.h:2395
RAPIDJSON_NAMESPACE_BEGIN typedef unsigned SizeType
Size type (for string lengths, array sizes, etc.)
Definition: rapidjson.h:384
virtual void * MallocState(size_t size)
Definition: schema.h:2183
RAPIDJSON_FORCEINLINE void PushSchema(const SchemaType &schema)
Definition: schema.h:2319
virtual ISchemaValidator * CreateSchemaValidator(const SchemaType &root)
Definition: schema.h:2155
internal::Stack< StateAllocator > documentStack_
stack to store the current path of validating document (Ch)
Definition: schema.h:2405
SchemaDocumentType::SchemaType SchemaType
Definition: schema.h:1769
internal::Stack< StateAllocator > schemaStack_
stack to store the current path of schema (BaseSchemaType *)
Definition: schema.h:2404
bool Empty() const
Definition: stack.h:176
const SchemaType & CurrentSchema() const
Definition: schema.h:2394
const SchemaType & root_
Definition: schema.h:2401
EncodingType::Ch Ch
Definition: schema.h:1773
#define RAPIDJSON_ASSERT(x)
Assertion.
Definition: rapidjson.h:406

◆ BelowMinimum() [1/6]

virtual void BelowMinimum ( int64_t  actual,
const SValue expected,
bool  exclusive 
)
pure virtualinherited

◆ BelowMinimum() [2/6]

virtual void BelowMinimum ( uint64_t  actual,
const SValue expected,
bool  exclusive 
)
pure virtualinherited

◆ BelowMinimum() [3/6]

virtual void BelowMinimum ( double  actual,
const SValue expected,
bool  exclusive 
)
pure virtualinherited

◆ BelowMinimum() [4/6]

void BelowMinimum ( int64_t  actual,
const SValue expected,
bool  exclusive 
)
inline

Definition at line 1904 of file schema.h.

1904  {
1905  AddNumberError(SchemaType::GetMinimumString(), ValueType(actual).Move(), expected,
1906  exclusive ? &SchemaType::GetExclusiveMinimumString : 0);
1907  }
GenericValue< EncodingType, StateAllocator > ValueType
Definition: schema.h:1775
void AddNumberError(const typename SchemaType::ValueType &keyword, ValueType &actual, const SValue &expected, const typename SchemaType::ValueType &(*exclusive)()=0)
Definition: schema.h:2374

◆ BelowMinimum() [5/6]

void BelowMinimum ( uint64_t  actual,
const SValue expected,
bool  exclusive 
)
inline

Definition at line 1908 of file schema.h.

1908  {
1909  AddNumberError(SchemaType::GetMinimumString(), ValueType(actual).Move(), expected,
1910  exclusive ? &SchemaType::GetExclusiveMinimumString : 0);
1911  }
GenericValue< EncodingType, StateAllocator > ValueType
Definition: schema.h:1775
void AddNumberError(const typename SchemaType::ValueType &keyword, ValueType &actual, const SValue &expected, const typename SchemaType::ValueType &(*exclusive)()=0)
Definition: schema.h:2374

◆ BelowMinimum() [6/6]

void BelowMinimum ( double  actual,
const SValue expected,
bool  exclusive 
)
inline

Definition at line 1912 of file schema.h.

1912  {
1913  AddNumberError(SchemaType::GetMinimumString(), ValueType(actual).Move(), expected,
1914  exclusive ? &SchemaType::GetExclusiveMinimumString : 0);
1915  }
GenericValue< EncodingType, StateAllocator > ValueType
Definition: schema.h:1775
void AddNumberError(const typename SchemaType::ValueType &keyword, ValueType &actual, const SValue &expected, const typename SchemaType::ValueType &(*exclusive)()=0)
Definition: schema.h:2374

◆ Bool()

bool Bool ( bool  b)
inline

Definition at line 2104 of file schema.h.

Context & CurrentContext()
Definition: schema.h:2395
#define RAPIDJSON_SCHEMA_HANDLE_VALUE_(method, arg1, arg2)
Definition: schema.h:2098
bool Bool(bool b)
Definition: schema.h:2104

◆ CreateHasher()

virtual void* CreateHasher ( )
inlinevirtual

Implements ISchemaStateFactory< SchemaDocumentType::SchemaType >.

Definition at line 2169 of file schema.h.

2169  {
2170  return new (GetStateAllocator().Malloc(sizeof(HasherType))) HasherType(&GetStateAllocator());
2171  }
StateAllocator & GetStateAllocator()
Definition: schema.h:2226
internal::Hasher< EncodingType, StateAllocator > HasherType
Definition: schema.h:2194

◆ CreateSchemaValidator()

virtual ISchemaValidator* CreateSchemaValidator ( const SchemaType root)
inlinevirtual

Implements ISchemaStateFactory< SchemaDocumentType::SchemaType >.

Definition at line 2155 of file schema.h.

2155  {
2156  return new (GetStateAllocator().Malloc(sizeof(GenericSchemaValidator))) GenericSchemaValidator(*schemaDocument_, root, documentStack_.template Bottom<char>(), documentStack_.GetSize(),
2157 #if RAPIDJSON_SCHEMA_VERBOSE
2158  depth_ + 1,
2159 #endif
2160  &GetStateAllocator());
2161  }
StateAllocator & GetStateAllocator()
Definition: schema.h:2226
internal::Stack< StateAllocator > documentStack_
stack to store the current path of validating document (Ch)
Definition: schema.h:2405
JSON Schema Validator.
Definition: fwd.h:145
size_t GetSize() const
Definition: stack.h:177
const SchemaDocumentType * schemaDocument_
Definition: schema.h:2400
GenericSchemaValidator(const SchemaDocumentType &schemaDocument, StateAllocator *allocator=0, size_t schemaStackCapacity=kDefaultSchemaStackCapacity, size_t documentStackCapacity=kDefaultDocumentStackCapacity)
Constructor without output handler.
Definition: schema.h:1784

◆ CurrentContext() [1/2]

Context& CurrentContext ( )
inlineprivate

Definition at line 2395 of file schema.h.

2395 { return *schemaStack_.template Top<Context>(); }
internal::Stack< StateAllocator > schemaStack_
stack to store the current path of schema (BaseSchemaType *)
Definition: schema.h:2404

◆ CurrentContext() [2/2]

const Context& CurrentContext ( ) const
inlineprivate

Definition at line 2396 of file schema.h.

2396 { return *schemaStack_.template Top<Context>(); }
internal::Stack< StateAllocator > schemaStack_
stack to store the current path of schema (BaseSchemaType *)
Definition: schema.h:2404

◆ CurrentSchema()

const SchemaType& CurrentSchema ( ) const
inlineprivate

Definition at line 2394 of file schema.h.

2394 { return *schemaStack_.template Top<Context>()->schema; }
internal::Stack< StateAllocator > schemaStack_
stack to store the current path of schema (BaseSchemaType *)
Definition: schema.h:2404

◆ DestroryHasher()

virtual void DestroryHasher ( void *  hasher)
inlinevirtual

Implements ISchemaStateFactory< SchemaDocumentType::SchemaType >.

Definition at line 2177 of file schema.h.

2177  {
2178  HasherType* h = static_cast<HasherType*>(hasher);
2179  h->~HasherType();
2180  StateAllocator::Free(h);
2181  }
internal::Hasher< EncodingType, StateAllocator > HasherType
Definition: schema.h:2194

◆ DestroySchemaValidator() [1/2]

virtual void DestroySchemaValidator ( ISchemaValidator validator)
pure virtualinherited

◆ DestroySchemaValidator() [2/2]

virtual void DestroySchemaValidator ( ISchemaValidator *  validator)
inlinevirtual

Definition at line 2163 of file schema.h.

2163  {
2164  GenericSchemaValidator* v = static_cast<GenericSchemaValidator*>(validator);
2166  StateAllocator::Free(v);
2167  }
JSON Schema Validator.
Definition: fwd.h:145
~GenericSchemaValidator()
Destructor.
Definition: schema.h:1839
Here is the call graph for this function:

◆ Disallowed()

void Disallowed ( )
inlinevirtual

Implements IValidationErrorHandler< SchemaDocumentType::SchemaType >.

Definition at line 2042 of file schema.h.

2042  {
2043  currentError_.SetObject();
2044  AddCurrentError(SchemaType::GetNotString());
2045  }
ValueType currentError_
Definition: schema.h:2408
void AddCurrentError(const typename SchemaType::ValueType &keyword, bool parent=false)
Definition: schema.h:2363

◆ DisallowedItem()

void DisallowedItem ( SizeType  index)
inlinevirtual

Implements IValidationErrorHandler< SchemaDocumentType::SchemaType >.

Definition at line 1931 of file schema.h.

1931  {
1932  currentError_.SetObject();
1933  currentError_.AddMember(GetDisallowedString(), ValueType(index).Move(), GetStateAllocator());
1934  AddCurrentError(SchemaType::GetAdditionalItemsString(), true);
1935  }
StateAllocator & GetStateAllocator()
Definition: schema.h:2226
ValueType currentError_
Definition: schema.h:2408
GenericValue< EncodingType, StateAllocator > ValueType
Definition: schema.h:1775
void AddCurrentError(const typename SchemaType::ValueType &keyword, bool parent=false)
Definition: schema.h:2363

◆ DisallowedProperty() [1/2]

virtual void DisallowedProperty ( const Ch name,
SizeType  length 
)
pure virtualinherited

◆ DisallowedProperty() [2/2]

void DisallowedProperty ( const Ch name,
SizeType  length 
)
inline

Definition at line 1980 of file schema.h.

1980  {
1981  currentError_.SetObject();
1982  currentError_.AddMember(GetDisallowedString(), ValueType(name, length, GetStateAllocator()).Move(), GetStateAllocator());
1983  AddCurrentError(SchemaType::GetAdditionalPropertiesString(), true);
1984  }
StateAllocator & GetStateAllocator()
Definition: schema.h:2226
ValueType currentError_
Definition: schema.h:2408
GenericValue< EncodingType, StateAllocator > ValueType
Definition: schema.h:1775
void AddCurrentError(const typename SchemaType::ValueType &keyword, bool parent=false)
Definition: schema.h:2363

◆ DisallowedValue()

void DisallowedValue ( )
inlinevirtual

Implements IValidationErrorHandler< SchemaDocumentType::SchemaType >.

Definition at line 2014 of file schema.h.

2014  {
2015  currentError_.SetObject();
2016  AddCurrentError(SchemaType::GetEnumString());
2017  }
ValueType currentError_
Definition: schema.h:2408
void AddCurrentError(const typename SchemaType::ValueType &keyword, bool parent=false)
Definition: schema.h:2363

◆ DoesNotMatch() [1/2]

virtual void DoesNotMatch ( const Ch str,
SizeType  length 
)
pure virtualinherited

◆ DoesNotMatch() [2/2]

void DoesNotMatch ( const Ch str,
SizeType  length 
)
inline

Definition at line 1925 of file schema.h.

1925  {
1926  currentError_.SetObject();
1927  currentError_.AddMember(GetActualString(), ValueType(str, length, GetStateAllocator()).Move(), GetStateAllocator());
1928  AddCurrentError(SchemaType::GetPatternString());
1929  }
StateAllocator & GetStateAllocator()
Definition: schema.h:2226
ValueType currentError_
Definition: schema.h:2408
GenericValue< EncodingType, StateAllocator > ValueType
Definition: schema.h:1775
void AddCurrentError(const typename SchemaType::ValueType &keyword, bool parent=false)
Definition: schema.h:2363

◆ Double()

bool Double ( double  d)
inline

Definition at line 2109 of file schema.h.

Context & CurrentContext()
Definition: schema.h:2395
bool Double(double d)
Definition: schema.h:2109
#define RAPIDJSON_SCHEMA_HANDLE_VALUE_(method, arg1, arg2)
Definition: schema.h:2098

◆ DuplicateItems()

void DuplicateItems ( SizeType  index1,
SizeType  index2 
)
inlinevirtual

Implements IValidationErrorHandler< SchemaDocumentType::SchemaType >.

Definition at line 1944 of file schema.h.

1944  {
1945  ValueType duplicates(kArrayType);
1946  duplicates.PushBack(index1, GetStateAllocator());
1947  duplicates.PushBack(index2, GetStateAllocator());
1948  currentError_.SetObject();
1949  currentError_.AddMember(GetDuplicatesString(), duplicates, GetStateAllocator());
1950  AddCurrentError(SchemaType::GetUniqueItemsString(), true);
1951  }
StateAllocator & GetStateAllocator()
Definition: schema.h:2226
array
Definition: rapidjson.h:647
ValueType currentError_
Definition: schema.h:2408
GenericValue< EncodingType, StateAllocator > ValueType
Definition: schema.h:1775
void AddCurrentError(const typename SchemaType::ValueType &keyword, bool parent=false)
Definition: schema.h:2363

◆ EndArray()

bool EndArray ( SizeType  elementCount)
inline

Definition at line 2142 of file schema.h.

2142  {
2143  if (!valid_) return false;
2145  if (!CurrentSchema().EndArray(CurrentContext(), elementCount)) return valid_ = false;
2146  RAPIDJSON_SCHEMA_HANDLE_END_(EndArray, (elementCount));
2147  }
Context & CurrentContext()
Definition: schema.h:2395
bool EndArray(SizeType elementCount)
Definition: schema.h:2142
#define RAPIDJSON_SCHEMA_HANDLE_PARALLEL_(method, arg2)
Definition: schema.h:2083
const SchemaType & CurrentSchema() const
Definition: schema.h:2394
#define RAPIDJSON_SCHEMA_HANDLE_END_(method, arg2)
Definition: schema.h:2095

◆ EndDependencyErrors()

bool EndDependencyErrors ( )
inlinevirtual

Implements IValidationErrorHandler< SchemaDocumentType::SchemaType >.

Definition at line 2004 of file schema.h.

2004  {
2005  if (currentError_.ObjectEmpty())
2006  return false;
2007  ValueType error(kObjectType);
2008  error.AddMember(GetErrorsString(), currentError_, GetStateAllocator());
2009  currentError_ = error;
2010  AddCurrentError(SchemaType::GetDependenciesString());
2011  return true;
2012  }
StateAllocator & GetStateAllocator()
Definition: schema.h:2226
object
Definition: rapidjson.h:646
ValueType currentError_
Definition: schema.h:2408
GenericValue< EncodingType, StateAllocator > ValueType
Definition: schema.h:1775
void AddCurrentError(const typename SchemaType::ValueType &keyword, bool parent=false)
Definition: schema.h:2363

◆ EndDisallowedType() [1/2]

virtual void EndDisallowedType ( const typename SchemaDocumentType::SchemaType ::ValueType &  actualType)
pure virtualinherited

◆ EndDisallowedType() [2/2]

void EndDisallowedType ( const typename SchemaType::ValueType &  actualType)
inline

Definition at line 2024 of file schema.h.

2024  {
2025  ValueType error(kObjectType);
2026  error.AddMember(GetExpectedString(), currentError_, GetStateAllocator());
2027  error.AddMember(GetActualString(), ValueType(actualType, GetStateAllocator()).Move(), GetStateAllocator());
2028  currentError_ = error;
2029  AddCurrentError(SchemaType::GetTypeString());
2030  }
StateAllocator & GetStateAllocator()
Definition: schema.h:2226
object
Definition: rapidjson.h:646
ValueType currentError_
Definition: schema.h:2408
GenericValue< EncodingType, StateAllocator > ValueType
Definition: schema.h:1775
void AddCurrentError(const typename SchemaType::ValueType &keyword, bool parent=false)
Definition: schema.h:2363

◆ EndMissingDependentProperties() [1/2]

virtual void EndMissingDependentProperties ( const SValue sourceName)
pure virtualinherited

◆ EndMissingDependentProperties() [2/2]

void EndMissingDependentProperties ( const SValue sourceName)
inline

Definition at line 1995 of file schema.h.

1995  {
1996  if (!missingDependents_.Empty())
1997  currentError_.AddMember(ValueType(sourceName, GetStateAllocator()).Move(),
1999  }
StateAllocator & GetStateAllocator()
Definition: schema.h:2226
ValueType currentError_
Definition: schema.h:2408
GenericValue< EncodingType, StateAllocator > ValueType
Definition: schema.h:1775
ValueType missingDependents_
Definition: schema.h:2409

◆ EndMissingProperties()

bool EndMissingProperties ( )
inlinevirtual

Implements IValidationErrorHandler< SchemaDocumentType::SchemaType >.

Definition at line 1967 of file schema.h.

1967  {
1968  if (currentError_.Empty())
1969  return false;
1970  ValueType error(kObjectType);
1971  error.AddMember(GetMissingString(), currentError_, GetStateAllocator());
1972  currentError_ = error;
1973  AddCurrentError(SchemaType::GetRequiredString());
1974  return true;
1975  }
StateAllocator & GetStateAllocator()
Definition: schema.h:2226
object
Definition: rapidjson.h:646
ValueType currentError_
Definition: schema.h:2408
GenericValue< EncodingType, StateAllocator > ValueType
Definition: schema.h:1775
void AddCurrentError(const typename SchemaType::ValueType &keyword, bool parent=false)
Definition: schema.h:2363

◆ EndObject()

bool EndObject ( SizeType  memberCount)
inline

Definition at line 2129 of file schema.h.

2129  {
2130  if (!valid_) return false;
2132  if (!CurrentSchema().EndObject(CurrentContext(), memberCount)) return valid_ = false;
2133  RAPIDJSON_SCHEMA_HANDLE_END_(EndObject, (memberCount));
2134  }
Context & CurrentContext()
Definition: schema.h:2395
bool EndObject(SizeType memberCount)
Definition: schema.h:2129
#define RAPIDJSON_SCHEMA_HANDLE_PARALLEL_(method, arg2)
Definition: schema.h:2083
const SchemaType & CurrentSchema() const
Definition: schema.h:2394
#define RAPIDJSON_SCHEMA_HANDLE_END_(method, arg2)
Definition: schema.h:2095

◆ EndValue()

bool EndValue ( )
inlineprivate

Definition at line 2263 of file schema.h.

2263  {
2265  return false;
2266 
2267 #if RAPIDJSON_SCHEMA_VERBOSE
2269  schemaDocument_->GetPointer(&CurrentSchema()).Stringify(sb);
2270 
2271  *documentStack_.template Push<Ch>() = '\0';
2272  documentStack_.template Pop<Ch>(1);
2273  internal::PrintValidatorPointers(depth_, sb.GetString(), documentStack_.template Bottom<Ch>());
2274 #endif
2275 
2276  uint64_t h = CurrentContext().arrayUniqueness ? static_cast<HasherType*>(CurrentContext().hasher)->GetHashCode() : 0;
2277 
2278  PopSchema();
2279 
2280  if (!schemaStack_.Empty()) {
2281  Context& context = CurrentContext();
2282  if (context.valueUniqueness) {
2283  HashCodeArray* a = static_cast<HashCodeArray*>(context.arrayElementHashCodes);
2284  if (!a)
2285  CurrentContext().arrayElementHashCodes = a = new (GetStateAllocator().Malloc(sizeof(HashCodeArray))) HashCodeArray(kArrayType);
2286  for (typename HashCodeArray::ConstValueIterator itr = a->Begin(); itr != a->End(); ++itr)
2287  if (itr->GetUint64() == h) {
2288  DuplicateItems(static_cast<SizeType>(itr - a->Begin()), a->Size());
2289  RAPIDJSON_INVALID_KEYWORD_RETURN(SchemaType::GetUniqueItemsString());
2290  }
2291  a->PushBack(h, GetStateAllocator());
2292  }
2293  }
2294 
2295  // Remove the last token of document pointer
2296  while (!documentStack_.Empty() && *documentStack_.template Pop<Ch>(1) != '/')
2297  ;
2298 
2299  return true;
2300  }
StateAllocator & GetStateAllocator()
Definition: schema.h:2226
Context & CurrentContext()
Definition: schema.h:2395
RAPIDJSON_FORCEINLINE void PopSchema()
Definition: schema.h:2321
Represents an in-memory output stream.
Definition: fwd.h:59
array
Definition: rapidjson.h:647
const Ch * GetString() const
Definition: stringbuffer.h:73
internal::Stack< StateAllocator > documentStack_
stack to store the current path of validating document (Ch)
Definition: schema.h:2405
virtual uint64_t GetHashCode(void *hasher)
Definition: schema.h:2173
void DuplicateItems(SizeType index1, SizeType index2)
Definition: schema.h:1944
internal::Stack< StateAllocator > schemaStack_
stack to store the current path of schema (BaseSchemaType *)
Definition: schema.h:2404
bool Empty() const
Definition: stack.h:176
unsigned __int64 uint64_t
Definition: stdint.h:136
GenericValue< UTF8<>, StateAllocator > HashCodeArray
Definition: schema.h:2193
#define RAPIDJSON_INVALID_KEYWORD_RETURN(keyword)
Definition: schema.h:116
const SchemaDocumentType * schemaDocument_
Definition: schema.h:2400
const GenericPointer< typename T::ValueType > T2 T::AllocatorType & a
Definition: pointer.h:1181
const GenericValue * ConstValueIterator
Constant value iterator for iterating in array.
Definition: document.h:589
internal::Hasher< EncodingType, StateAllocator > HasherType
Definition: schema.h:2194
const SchemaType & CurrentSchema() const
Definition: schema.h:2394
SchemaType::Context Context
Definition: schema.h:2192
Here is the call graph for this function:

◆ FreeState()

virtual void FreeState ( void *  p)
inlinevirtual

Implements ISchemaStateFactory< SchemaDocumentType::SchemaType >.

Definition at line 2187 of file schema.h.

2187  {
2188  StateAllocator::Free(p);
2189  }

◆ GetError() [1/2]

ValueType& GetError ( )
inline

Gets the error object.

Definition at line 1860 of file schema.h.

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

◆ GetError() [2/2]

const ValueType& GetError ( ) const
inline

Definition at line 1861 of file schema.h.

1861 { return error_; }

◆ GetHashCode()

virtual uint64_t GetHashCode ( void *  hasher)
inlinevirtual

Implements ISchemaStateFactory< SchemaDocumentType::SchemaType >.

Definition at line 2173 of file schema.h.

2173  {
2174  return static_cast<HasherType*>(hasher)->GetHashCode();
2175  }
virtual uint64_t GetHashCode(void *hasher)
Definition: schema.h:2173
internal::Hasher< EncodingType, StateAllocator > HasherType
Definition: schema.h:2194

◆ GetInvalidDocumentPointer()

PointerType GetInvalidDocumentPointer ( ) const
inline

Gets the JSON pointer pointed to the invalid value.

Definition at line 1874 of file schema.h.

1874  {
1875  if (documentStack_.Empty()) {
1876  return PointerType();
1877  }
1878  else {
1879  return PointerType(documentStack_.template Bottom<Ch>(), documentStack_.GetSize() / sizeof(Ch));
1880  }
1881  }
internal::Stack< StateAllocator > documentStack_
stack to store the current path of validating document (Ch)
Definition: schema.h:2405
bool Empty() const
Definition: stack.h:176
size_t GetSize() const
Definition: stack.h:177
EncodingType::Ch Ch
Definition: schema.h:1773
SchemaDocumentType::PointerType PointerType
Definition: schema.h:1770
Here is the caller graph for this function:

◆ GetInvalidSchemaKeyword()

const Ch* GetInvalidSchemaKeyword ( ) const
inline

Gets the keyword of invalid schema.

Definition at line 1869 of file schema.h.

1869  {
1870  return schemaStack_.Empty() ? 0 : CurrentContext().invalidKeyword;
1871  }
Context & CurrentContext()
Definition: schema.h:2395
internal::Stack< StateAllocator > schemaStack_
stack to store the current path of schema (BaseSchemaType *)
Definition: schema.h:2404
bool Empty() const
Definition: stack.h:176
Here is the caller graph for this function:

◆ GetInvalidSchemaPointer()

PointerType GetInvalidSchemaPointer ( ) const
inline

Gets the JSON pointer pointed to the invalid schema.

Definition at line 1864 of file schema.h.

1864  {
1865  return schemaStack_.Empty() ? PointerType() : CurrentSchema().GetPointer();
1866  }
internal::Stack< StateAllocator > schemaStack_
stack to store the current path of schema (BaseSchemaType *)
Definition: schema.h:2404
bool Empty() const
Definition: stack.h:176
const SchemaType & CurrentSchema() const
Definition: schema.h:2394
SchemaDocumentType::PointerType PointerType
Definition: schema.h:1770
Here is the caller graph for this function:

◆ GetStateAllocator()

StateAllocator& GetStateAllocator ( )
inlineprivate

Definition at line 2226 of file schema.h.

2226  {
2227  if (!stateAllocator_)
2228  stateAllocator_ = ownStateAllocator_ = RAPIDJSON_NEW(StateAllocator)();
2229  return *stateAllocator_;
2230  }
StateAllocator * ownStateAllocator_
Definition: schema.h:2403
#define RAPIDJSON_NEW(TypeName)
! customization point for global new
Definition: rapidjson.h:625
StateAllocator * stateAllocator_
Definition: schema.h:2402

◆ Int()

bool Int ( int  i)
inline

Definition at line 2105 of file schema.h.

Context & CurrentContext()
Definition: schema.h:2395
#define RAPIDJSON_SCHEMA_HANDLE_VALUE_(method, arg1, arg2)
Definition: schema.h:2098
bool Int(int i)
Definition: schema.h:2105

◆ Int64()

bool Int64 ( int64_t  i)
inline

Definition at line 2107 of file schema.h.

Context & CurrentContext()
Definition: schema.h:2395
#define RAPIDJSON_SCHEMA_HANDLE_VALUE_(method, arg1, arg2)
Definition: schema.h:2098
bool Int64(int64_t i)
Definition: schema.h:2107

◆ IsValid()

virtual bool IsValid ( ) const
inlinevirtual

Checks whether the current state is valid.

Implements ISchemaValidator.

Definition at line 1857 of file schema.h.

1857 { return valid_; }
Here is the caller graph for this function:

◆ Key()

bool Key ( const Ch str,
SizeType  len,
bool  copy 
)
inline

Definition at line 2121 of file schema.h.

2121  {
2122  if (!valid_) return false;
2123  AppendToken(str, len);
2124  if (!CurrentSchema().Key(CurrentContext(), str, len, copy)) return valid_ = false;
2125  RAPIDJSON_SCHEMA_HANDLE_PARALLEL_(Key, (str, len, copy));
2126  return valid_ = !outputHandler_ || outputHandler_->Key(str, len, copy);
2127  }
Context & CurrentContext()
Definition: schema.h:2395
OutputHandler * outputHandler_
Definition: schema.h:2406
#define RAPIDJSON_SCHEMA_HANDLE_PARALLEL_(method, arg2)
Definition: schema.h:2083
const SchemaType & CurrentSchema() const
Definition: schema.h:2394
bool Key(const Ch *str, SizeType len, bool copy)
Definition: schema.h:2121
void AppendToken(const Ch *str, SizeType len)
Definition: schema.h:2302

◆ MallocState()

virtual void* MallocState ( size_t  size)
inlinevirtual

Implements ISchemaStateFactory< SchemaDocumentType::SchemaType >.

Definition at line 2183 of file schema.h.

2183  {
2184  return GetStateAllocator().Malloc(size);
2185  }
StateAllocator & GetStateAllocator()
Definition: schema.h:2226

◆ MergeError()

void MergeError ( ValueType other)
inlineprivate

Definition at line 2368 of file schema.h.

2368  {
2369  for (typename ValueType::MemberIterator it = other.MemberBegin(), end = other.MemberEnd(); it != end; ++it) {
2370  AddError(it->name, it->value);
2371  }
2372  }
GenericMemberIterator< false, EncodingType, StateAllocator >::Iterator MemberIterator
Member iterator for iterating in object.
Definition: document.h:586
void AddError(ValueType &keyword, ValueType &error)
Definition: schema.h:2349

◆ NoneOf() [1/2]

virtual void NoneOf ( ISchemaValidator **  subvalidators,
SizeType  count 
)
pure virtualinherited

◆ NoneOf() [2/2]

void NoneOf ( ISchemaValidator **  subvalidators,
SizeType  count 
)
inline

Definition at line 2036 of file schema.h.

2036  {
2037  AddErrorArray(SchemaType::GetAnyOfString(), subvalidators, count);
2038  }
void AddErrorArray(const typename SchemaType::ValueType &keyword, ISchemaValidator **subvalidators, SizeType count)
Definition: schema.h:2384

◆ NotAllOf() [1/2]

virtual void NotAllOf ( ISchemaValidator **  subvalidators,
SizeType  count 
)
pure virtualinherited

◆ NotAllOf() [2/2]

void NotAllOf ( ISchemaValidator **  subvalidators,
SizeType  count 
)
inline

Definition at line 2031 of file schema.h.

2031  {
2032  for (SizeType i = 0; i < count; ++i) {
2033  MergeError(static_cast<GenericSchemaValidator*>(subvalidators[i])->GetError());
2034  }
2035  }
void MergeError(ValueType &other)
Definition: schema.h:2368
RAPIDJSON_NAMESPACE_BEGIN typedef unsigned SizeType
Size type (for string lengths, array sizes, etc.)
Definition: rapidjson.h:384
ValueType & GetError()
Gets the error object.
Definition: schema.h:1860

◆ NotMultipleOf() [1/6]

virtual void NotMultipleOf ( int64_t  actual,
const SValue expected 
)
pure virtualinherited

◆ NotMultipleOf() [2/6]

virtual void NotMultipleOf ( uint64_t  actual,
const SValue expected 
)
pure virtualinherited

◆ NotMultipleOf() [3/6]

virtual void NotMultipleOf ( double  actual,
const SValue expected 
)
pure virtualinherited

◆ NotMultipleOf() [4/6]

void NotMultipleOf ( int64_t  actual,
const SValue expected 
)
inline

Definition at line 1883 of file schema.h.

1883  {
1884  AddNumberError(SchemaType::GetMultipleOfString(), ValueType(actual).Move(), expected);
1885  }
GenericValue< EncodingType, StateAllocator > ValueType
Definition: schema.h:1775
void AddNumberError(const typename SchemaType::ValueType &keyword, ValueType &actual, const SValue &expected, const typename SchemaType::ValueType &(*exclusive)()=0)
Definition: schema.h:2374

◆ NotMultipleOf() [5/6]

void NotMultipleOf ( uint64_t  actual,
const SValue expected 
)
inline

Definition at line 1886 of file schema.h.

1886  {
1887  AddNumberError(SchemaType::GetMultipleOfString(), ValueType(actual).Move(), expected);
1888  }
GenericValue< EncodingType, StateAllocator > ValueType
Definition: schema.h:1775
void AddNumberError(const typename SchemaType::ValueType &keyword, ValueType &actual, const SValue &expected, const typename SchemaType::ValueType &(*exclusive)()=0)
Definition: schema.h:2374

◆ NotMultipleOf() [6/6]

void NotMultipleOf ( double  actual,
const SValue expected 
)
inline

Definition at line 1889 of file schema.h.

1889  {
1890  AddNumberError(SchemaType::GetMultipleOfString(), ValueType(actual).Move(), expected);
1891  }
GenericValue< EncodingType, StateAllocator > ValueType
Definition: schema.h:1775
void AddNumberError(const typename SchemaType::ValueType &keyword, ValueType &actual, const SValue &expected, const typename SchemaType::ValueType &(*exclusive)()=0)
Definition: schema.h:2374

◆ NotOneOf() [1/2]

virtual void NotOneOf ( ISchemaValidator **  subvalidators,
SizeType  count 
)
pure virtualinherited

◆ NotOneOf() [2/2]

void NotOneOf ( ISchemaValidator **  subvalidators,
SizeType  count 
)
inline

Definition at line 2039 of file schema.h.

2039  {
2040  AddErrorArray(SchemaType::GetOneOfString(), subvalidators, count);
2041  }
void AddErrorArray(const typename SchemaType::ValueType &keyword, ISchemaValidator **subvalidators, SizeType count)
Definition: schema.h:2384

◆ Null()

bool Null ( )
inline

Definition at line 2103 of file schema.h.

Context & CurrentContext()
Definition: schema.h:2395
#define RAPIDJSON_SCHEMA_HANDLE_VALUE_(method, arg1, arg2)
Definition: schema.h:2098

◆ PopSchema()

RAPIDJSON_FORCEINLINE void PopSchema ( )
inlineprivate

Definition at line 2321 of file schema.h.

2321  {
2322  Context* c = schemaStack_.template Pop<Context>(1);
2323  if (HashCodeArray* a = static_cast<HashCodeArray*>(c->arrayElementHashCodes)) {
2324  a->~HashCodeArray();
2325  StateAllocator::Free(a);
2326  }
2327  c->~Context();
2328  }
internal::Stack< StateAllocator > schemaStack_
stack to store the current path of schema (BaseSchemaType *)
Definition: schema.h:2404
GenericValue< UTF8<>, StateAllocator > HashCodeArray
Definition: schema.h:2193
const GenericPointer< typename T::ValueType > T2 T::AllocatorType & a
Definition: pointer.h:1181
SchemaType::Context Context
Definition: schema.h:2192

◆ PropertyViolations() [1/2]

virtual void PropertyViolations ( ISchemaValidator **  subvalidators,
SizeType  count 
)
pure virtualinherited

◆ PropertyViolations() [2/2]

void PropertyViolations ( ISchemaValidator **  subvalidators,
SizeType  count 
)
inline

Definition at line 1976 of file schema.h.

1976  {
1977  for (SizeType i = 0; i < count; ++i)
1978  MergeError(static_cast<GenericSchemaValidator*>(subvalidators[i])->GetError());
1979  }
void MergeError(ValueType &other)
Definition: schema.h:2368
RAPIDJSON_NAMESPACE_BEGIN typedef unsigned SizeType
Size type (for string lengths, array sizes, etc.)
Definition: rapidjson.h:384
ValueType & GetError()
Gets the error object.
Definition: schema.h:1860

◆ PushSchema()

RAPIDJSON_FORCEINLINE void PushSchema ( const SchemaType schema)
inlineprivate

Definition at line 2319 of file schema.h.

2319 { new (schemaStack_.template Push<Context>()) Context(*this, *this, &schema); }
internal::Stack< StateAllocator > schemaStack_
stack to store the current path of schema (BaseSchemaType *)
Definition: schema.h:2404
SchemaType::Context Context
Definition: schema.h:2192

◆ RawNumber()

bool RawNumber ( const Ch str,
SizeType  length,
bool  copy 
)
inline

Definition at line 2110 of file schema.h.

2111  { RAPIDJSON_SCHEMA_HANDLE_VALUE_(String, (CurrentContext(), str, length, copy), (str, length, copy)); }
Context & CurrentContext()
Definition: schema.h:2395
#define RAPIDJSON_SCHEMA_HANDLE_VALUE_(method, arg1, arg2)
Definition: schema.h:2098
bool String(const Ch *str, SizeType length, bool copy)
Definition: schema.h:2112

◆ Reset()

void Reset ( )
inline

Reset the internal states.

Definition at line 1845 of file schema.h.

1845  {
1846  while (!schemaStack_.Empty())
1847  PopSchema();
1849  error_.SetObject();
1850  currentError_.SetNull();
1851  missingDependents_.SetNull();
1852  valid_ = true;
1853  }
RAPIDJSON_FORCEINLINE void PopSchema()
Definition: schema.h:2321
internal::Stack< StateAllocator > documentStack_
stack to store the current path of validating document (Ch)
Definition: schema.h:2405
ValueType currentError_
Definition: schema.h:2408
internal::Stack< StateAllocator > schemaStack_
stack to store the current path of schema (BaseSchemaType *)
Definition: schema.h:2404
void Clear()
Definition: stack.h:98
bool Empty() const
Definition: stack.h:176
ValueType missingDependents_
Definition: schema.h:2409

◆ StartArray()

bool StartArray ( )
inline

Definition at line 2136 of file schema.h.

2136  {
2139  return valid_ = !outputHandler_ || outputHandler_->StartArray();
2140  }
Context & CurrentContext()
Definition: schema.h:2395
OutputHandler * outputHandler_
Definition: schema.h:2406
#define RAPIDJSON_SCHEMA_HANDLE_BEGIN_(method, arg1)
Definition: schema.h:2076
#define RAPIDJSON_SCHEMA_HANDLE_PARALLEL_(method, arg2)
Definition: schema.h:2083

◆ StartDependencyErrors()

void StartDependencyErrors ( )
inlinevirtual

Implements IValidationErrorHandler< SchemaDocumentType::SchemaType >.

Definition at line 1986 of file schema.h.

1986  {
1987  currentError_.SetObject();
1988  }
ValueType currentError_
Definition: schema.h:2408

◆ StartDisallowedType()

void StartDisallowedType ( )
inlinevirtual

Implements IValidationErrorHandler< SchemaDocumentType::SchemaType >.

Definition at line 2018 of file schema.h.

2018  {
2019  currentError_.SetArray();
2020  }
ValueType currentError_
Definition: schema.h:2408

◆ StartMissingDependentProperties()

void StartMissingDependentProperties ( )
inlinevirtual

Implements IValidationErrorHandler< SchemaDocumentType::SchemaType >.

Definition at line 1989 of file schema.h.

1989  {
1990  missingDependents_.SetArray();
1991  }
ValueType missingDependents_
Definition: schema.h:2409

◆ StartMissingProperties()

void StartMissingProperties ( )
inlinevirtual

Implements IValidationErrorHandler< SchemaDocumentType::SchemaType >.

Definition at line 1961 of file schema.h.

1961  {
1962  currentError_.SetArray();
1963  }
ValueType currentError_
Definition: schema.h:2408

◆ StartObject()

bool StartObject ( )
inline

Definition at line 2115 of file schema.h.

2115  {
2118  return valid_ = !outputHandler_ || outputHandler_->StartObject();
2119  }
Context & CurrentContext()
Definition: schema.h:2395
OutputHandler * outputHandler_
Definition: schema.h:2406
#define RAPIDJSON_SCHEMA_HANDLE_BEGIN_(method, arg1)
Definition: schema.h:2076
#define RAPIDJSON_SCHEMA_HANDLE_PARALLEL_(method, arg2)
Definition: schema.h:2083

◆ String()

bool String ( const Ch str,
SizeType  length,
bool  copy 
)
inline

Definition at line 2112 of file schema.h.

2113  { RAPIDJSON_SCHEMA_HANDLE_VALUE_(String, (CurrentContext(), str, length, copy), (str, length, copy)); }
Context & CurrentContext()
Definition: schema.h:2395
#define RAPIDJSON_SCHEMA_HANDLE_VALUE_(method, arg1, arg2)
Definition: schema.h:2098
bool String(const Ch *str, SizeType length, bool copy)
Definition: schema.h:2112

◆ TooFewItems()

void TooFewItems ( SizeType  actualCount,
SizeType  expectedCount 
)
inlinevirtual

Implements IValidationErrorHandler< SchemaDocumentType::SchemaType >.

Definition at line 1936 of file schema.h.

1936  {
1937  AddNumberError(SchemaType::GetMinItemsString(),
1938  ValueType(actualCount).Move(), SValue(expectedCount).Move());
1939  }
GenericValue< EncodingType, StateAllocator > ValueType
Definition: schema.h:1775
SchemaType::SValue SValue
Definition: schema.h:1772
void AddNumberError(const typename SchemaType::ValueType &keyword, ValueType &actual, const SValue &expected, const typename SchemaType::ValueType &(*exclusive)()=0)
Definition: schema.h:2374

◆ TooFewProperties()

void TooFewProperties ( SizeType  actualCount,
SizeType  expectedCount 
)
inlinevirtual

Implements IValidationErrorHandler< SchemaDocumentType::SchemaType >.

Definition at line 1957 of file schema.h.

1957  {
1958  AddNumberError(SchemaType::GetMinPropertiesString(),
1959  ValueType(actualCount).Move(), SValue(expectedCount).Move());
1960  }
GenericValue< EncodingType, StateAllocator > ValueType
Definition: schema.h:1775
SchemaType::SValue SValue
Definition: schema.h:1772
void AddNumberError(const typename SchemaType::ValueType &keyword, ValueType &actual, const SValue &expected, const typename SchemaType::ValueType &(*exclusive)()=0)
Definition: schema.h:2374

◆ TooLong() [1/2]

virtual void TooLong ( const Ch str,
SizeType  length,
SizeType  expected 
)
pure virtualinherited

◆ TooLong() [2/2]

void TooLong ( const Ch str,
SizeType  length,
SizeType  expected 
)
inline

Definition at line 1917 of file schema.h.

1917  {
1918  AddNumberError(SchemaType::GetMaxLengthString(),
1919  ValueType(str, length, GetStateAllocator()).Move(), SValue(expected).Move());
1920  }
StateAllocator & GetStateAllocator()
Definition: schema.h:2226
GenericValue< EncodingType, StateAllocator > ValueType
Definition: schema.h:1775
SchemaType::SValue SValue
Definition: schema.h:1772
void AddNumberError(const typename SchemaType::ValueType &keyword, ValueType &actual, const SValue &expected, const typename SchemaType::ValueType &(*exclusive)()=0)
Definition: schema.h:2374

◆ TooManyItems()

void TooManyItems ( SizeType  actualCount,
SizeType  expectedCount 
)
inlinevirtual

Implements IValidationErrorHandler< SchemaDocumentType::SchemaType >.

Definition at line 1940 of file schema.h.

1940  {
1941  AddNumberError(SchemaType::GetMaxItemsString(),
1942  ValueType(actualCount).Move(), SValue(expectedCount).Move());
1943  }
GenericValue< EncodingType, StateAllocator > ValueType
Definition: schema.h:1775
SchemaType::SValue SValue
Definition: schema.h:1772
void AddNumberError(const typename SchemaType::ValueType &keyword, ValueType &actual, const SValue &expected, const typename SchemaType::ValueType &(*exclusive)()=0)
Definition: schema.h:2374

◆ TooManyProperties()

void TooManyProperties ( SizeType  actualCount,
SizeType  expectedCount 
)
inlinevirtual

Implements IValidationErrorHandler< SchemaDocumentType::SchemaType >.

Definition at line 1953 of file schema.h.

1953  {
1954  AddNumberError(SchemaType::GetMaxPropertiesString(),
1955  ValueType(actualCount).Move(), SValue(expectedCount).Move());
1956  }
GenericValue< EncodingType, StateAllocator > ValueType
Definition: schema.h:1775
SchemaType::SValue SValue
Definition: schema.h:1772
void AddNumberError(const typename SchemaType::ValueType &keyword, ValueType &actual, const SValue &expected, const typename SchemaType::ValueType &(*exclusive)()=0)
Definition: schema.h:2374

◆ TooShort() [1/2]

virtual void TooShort ( const Ch str,
SizeType  length,
SizeType  expected 
)
pure virtualinherited

◆ TooShort() [2/2]

void TooShort ( const Ch str,
SizeType  length,
SizeType  expected 
)
inline

Definition at line 1921 of file schema.h.

1921  {
1922  AddNumberError(SchemaType::GetMinLengthString(),
1923  ValueType(str, length, GetStateAllocator()).Move(), SValue(expected).Move());
1924  }
StateAllocator & GetStateAllocator()
Definition: schema.h:2226
GenericValue< EncodingType, StateAllocator > ValueType
Definition: schema.h:1775
SchemaType::SValue SValue
Definition: schema.h:1772
void AddNumberError(const typename SchemaType::ValueType &keyword, ValueType &actual, const SValue &expected, const typename SchemaType::ValueType &(*exclusive)()=0)
Definition: schema.h:2374

◆ Uint()

bool Uint ( unsigned  u)
inline

Definition at line 2106 of file schema.h.

Context & CurrentContext()
Definition: schema.h:2395
#define RAPIDJSON_SCHEMA_HANDLE_VALUE_(method, arg1, arg2)
Definition: schema.h:2098
bool Uint(unsigned u)
Definition: schema.h:2106

◆ Uint64()

bool Uint64 ( uint64_t  u)
inline

Definition at line 2108 of file schema.h.

Context & CurrentContext()
Definition: schema.h:2395
#define RAPIDJSON_SCHEMA_HANDLE_VALUE_(method, arg1, arg2)
Definition: schema.h:2098
bool Uint64(uint64_t u)
Definition: schema.h:2108

Member Data Documentation

◆ currentError_

ValueType currentError_
private

Definition at line 2408 of file schema.h.

◆ documentStack_

internal::Stack<StateAllocator> documentStack_
private

stack to store the current path of validating document (Ch)

Definition at line 2405 of file schema.h.

◆ error_

ValueType error_
private

Definition at line 2407 of file schema.h.

◆ kDefaultDocumentStackCapacity

const size_t kDefaultDocumentStackCapacity = 256
staticprivate

Definition at line 2399 of file schema.h.

◆ kDefaultSchemaStackCapacity

const size_t kDefaultSchemaStackCapacity = 1024
staticprivate

Definition at line 2398 of file schema.h.

◆ missingDependents_

ValueType missingDependents_
private

Definition at line 2409 of file schema.h.

◆ outputHandler_

OutputHandler* outputHandler_
private

Definition at line 2406 of file schema.h.

◆ ownStateAllocator_

StateAllocator* ownStateAllocator_
private

Definition at line 2403 of file schema.h.

◆ root_

const SchemaType& root_
private

Definition at line 2401 of file schema.h.

◆ schemaDocument_

const SchemaDocumentType* schemaDocument_
private

Definition at line 2400 of file schema.h.

◆ schemaStack_

internal::Stack<StateAllocator> schemaStack_
private

stack to store the current path of schema (BaseSchemaType *)

Definition at line 2404 of file schema.h.

◆ stateAllocator_

StateAllocator* stateAllocator_
private

Definition at line 2402 of file schema.h.

◆ valid_

bool valid_
private

Definition at line 2410 of file schema.h.


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