Added operators == and != for JsonDocument

This commit is contained in:
Benoit Blanchon
2019-07-19 10:10:16 +02:00
parent 815326d42e
commit aba42faf69
6 changed files with 107 additions and 4 deletions

View File

@@ -282,6 +282,14 @@ class JsonDocument : public Visitable {
return VariantConstRef(&_data);
}
bool operator==(VariantConstRef rhs) const {
return getVariant() == rhs;
}
bool operator!=(VariantConstRef rhs) const {
return getVariant() != rhs;
}
protected:
JsonDocument(MemoryPool pool) : _pool(pool) {
_data.setNull();