From 577570aa55b2ca0eba7759d13624b179275d65b8 Mon Sep 17 00:00:00 2001 From: David Robillard Date: Wed, 12 Aug 2015 15:21:10 +0000 Subject: Fix URI comparison issues. Fixes issue #1074. git-svn-id: http://svn.drobilla.net/lad/trunk/ingen@5704 a436a847-0d15-0410-975c-d299462d15a1 --- ingen/URIs.hpp | 18 +++++++++++++++--- 1 file changed, 15 insertions(+), 3 deletions(-) (limited to 'ingen') diff --git a/ingen/URIs.hpp b/ingen/URIs.hpp index a10cd30c..d38b840e 100644 --- a/ingen/URIs.hpp +++ b/ingen/URIs.hpp @@ -47,8 +47,8 @@ public: struct Quark : public Raul::URI { Quark(Ingen::Forge& forge, URIMap* map, const char* str); - operator LV2_URID() const { return urid.get(); } - operator Atom() const { return urid; } + operator LV2_URID() const { return urid.get(); } + explicit operator Atom() const { return urid; } inline bool operator==(const Atom& rhs) const { if (rhs.type() == urid.type()) { @@ -59,6 +59,10 @@ public: return false; } + inline bool operator!=(const Atom& rhs) const { + return !operator==(rhs); + } + Atom urid; Atom uri; }; @@ -181,6 +185,14 @@ public: const Quark time_speed; }; +inline bool operator==(const Atom& a, const URIs::Quark& b) { + return b == a; +} + +inline bool operator!=(const Atom& a, const URIs::Quark& b) { + return b != a; +} + } // namespace Ingen -#endif // INGEN_LV2URIMAP_HPP +#endif // INGEN_URIS_HPP -- cgit v1.2.1