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:
parent
29396c22c9
commit
4488813de7
2 changed files with 18 additions and 0 deletions
|
|
@ -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;
|
||||
}
|
||||
|
||||
//==============================================================================
|
||||
//==============================================================================
|
||||
|
||||
|
|
|
|||
|
|
@ -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.
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue