Skip to content

Commit 2bfd0cc

Browse files
committed
internal::Schema: Keep pointer for future use
1 parent 379b337 commit 2bfd0cc

File tree

1 file changed

+7
-1
lines changed

1 file changed

+7
-1
lines changed

include/rapidjson/schema.h

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -349,6 +349,7 @@ class Schema {
349349

350350
Schema(SchemaDocumentType* schemaDocument, const PointerType& p, const ValueType& value, const ValueType& document, AllocatorType* allocator) :
351351
allocator_(allocator),
352+
pointer_(p),
352353
typeless_(schemaDocument->GetTypeless()),
353354
enum_(),
354355
enumCount_(),
@@ -596,6 +597,10 @@ class Schema {
596597
#endif
597598
}
598599

600+
const PointerType& GetPointer() const {
601+
return pointer_;
602+
}
603+
599604
bool BeginValue(Context& context) const {
600605
if (context.inArray) {
601606
if (uniqueItems_)
@@ -1215,6 +1220,7 @@ class Schema {
12151220
};
12161221

12171222
AllocatorType* allocator_;
1223+
PointerType pointer_;
12181224
const SchemaType* typeless_;
12191225
uint64_t* enum_;
12201226
SizeType enumCount_;
@@ -1650,7 +1656,7 @@ class GenericSchemaValidator :
16501656

16511657
//! Gets the JSON pointer pointed to the invalid schema.
16521658
PointerType GetInvalidSchemaPointer() const {
1653-
return schemaStack_.Empty() ? PointerType() : schemaDocument_->GetPointer(&CurrentSchema());
1659+
return schemaStack_.Empty() ? PointerType() : CurrentSchema().GetPointer();
16541660
}
16551661

16561662
//! Gets the keyword of invalid schema.

0 commit comments

Comments
 (0)