1
0
Fork 0
mirror of https://github.com/juce-framework/JUCE.git synced 2026-01-10 23:44:24 +00:00

DynamicObject: Add implementation of equals()

This commit is contained in:
reuk 2025-11-25 12:40:34 +00:00
parent 29396c22c9
commit 4488813de7
No known key found for this signature in database
2 changed files with 18 additions and 0 deletions

View file

@ -151,6 +151,11 @@ void DynamicObject::writeAsJSON (OutputStream& out, const JSON::FormatOptions& f
out << '}';
}
bool DynamicObject::equals (const DynamicObject& other) const
{
return properties == other.properties;
}
//==============================================================================
//==============================================================================

View file

@ -125,6 +125,19 @@ public:
*/
virtual void writeAsJSON (OutputStream&, const JSON::FormatOptions&);
/** Returns true if the properties of this object match the properties of the specified object,
or false otherwise.
*/
bool equals (const DynamicObject& other) const;
/** Returns true if the properties of this object match the properties of the specified object,
or false otherwise.
*/
bool operator== (const DynamicObject& other) const { return equals (other); }
/** The inverse of operator==() */
bool operator!= (const DynamicObject& other) const { return ! operator== (other); }
private:
/** Derived classes may override this function to take additional actions after
properties are assigned or removed.