Commit 2bfd0cc6 authored by Yuri Khan's avatar Yuri Khan

internal::Schema: Keep pointer for future use

parent 379b3374
...@@ -349,6 +349,7 @@ public: ...@@ -349,6 +349,7 @@ public:
Schema(SchemaDocumentType* schemaDocument, const PointerType& p, const ValueType& value, const ValueType& document, AllocatorType* allocator) : Schema(SchemaDocumentType* schemaDocument, const PointerType& p, const ValueType& value, const ValueType& document, AllocatorType* allocator) :
allocator_(allocator), allocator_(allocator),
pointer_(p),
typeless_(schemaDocument->GetTypeless()), typeless_(schemaDocument->GetTypeless()),
enum_(), enum_(),
enumCount_(), enumCount_(),
...@@ -596,6 +597,10 @@ public: ...@@ -596,6 +597,10 @@ public:
#endif #endif
} }
const PointerType& GetPointer() const {
return pointer_;
}
bool BeginValue(Context& context) const { bool BeginValue(Context& context) const {
if (context.inArray) { if (context.inArray) {
if (uniqueItems_) if (uniqueItems_)
...@@ -1215,6 +1220,7 @@ private: ...@@ -1215,6 +1220,7 @@ private:
}; };
AllocatorType* allocator_; AllocatorType* allocator_;
PointerType pointer_;
const SchemaType* typeless_; const SchemaType* typeless_;
uint64_t* enum_; uint64_t* enum_;
SizeType enumCount_; SizeType enumCount_;
...@@ -1650,7 +1656,7 @@ public: ...@@ -1650,7 +1656,7 @@ public:
//! Gets the JSON pointer pointed to the invalid schema. //! Gets the JSON pointer pointed to the invalid schema.
PointerType GetInvalidSchemaPointer() const { PointerType GetInvalidSchemaPointer() const {
return schemaStack_.Empty() ? PointerType() : schemaDocument_->GetPointer(&CurrentSchema()); return schemaStack_.Empty() ? PointerType() : CurrentSchema().GetPointer();
} }
//! Gets the keyword of invalid schema. //! Gets the keyword of invalid schema.
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment