summaryrefslogtreecommitdiffstats
path: root/ingen/URIs.hpp
diff options
context:
space:
mode:
authorDavid Robillard <d@drobilla.net>2018-01-21 00:41:34 +0100
committerDavid Robillard <d@drobilla.net>2018-01-21 00:56:50 +0100
commit44f7ad5222d824d81dc743045d5887418847e74e (patch)
tree1b41535ac00b8b225a25dba2873b064cb074bfa9 /ingen/URIs.hpp
parent90fca083052880479ad90d870e556f0648e32106 (diff)
downloadingen-44f7ad5222d824d81dc743045d5887418847e74e.tar.gz
ingen-44f7ad5222d824d81dc743045d5887418847e74e.tar.bz2
ingen-44f7ad5222d824d81dc743045d5887418847e74e.zip
Add URI class and remove use of Raul::URI
Diffstat (limited to 'ingen/URIs.hpp')
-rw-r--r--ingen/URIs.hpp46
1 files changed, 27 insertions, 19 deletions
diff --git a/ingen/URIs.hpp b/ingen/URIs.hpp
index c718322d..71c14d14 100644
--- a/ingen/URIs.hpp
+++ b/ingen/URIs.hpp
@@ -18,11 +18,11 @@
#define INGEN_URIS_HPP
#include "ingen/Atom.hpp"
+#include "ingen/URI.hpp"
#include "ingen/ingen.h"
#include "lilv/lilv.h"
#include "lv2/lv2plug.in/ns/ext/urid/urid.h"
#include "raul/Noncopyable.hpp"
-#include "raul/URI.hpp"
namespace Ingen {
@@ -41,7 +41,7 @@ class INGEN_API URIs : public Raul::Noncopyable {
public:
URIs(Ingen::Forge& forge, URIMap* map, LilvWorld* lworld);
- struct Quark : public Raul::URI {
+ struct Quark : public URI {
Quark(Ingen::Forge& forge,
URIMap* map,
LilvWorld* lworld,
@@ -55,19 +55,6 @@ public:
explicit operator Atom() const { return urid; }
operator const LilvNode*() const { return lnode; }
- inline bool operator==(const Atom& rhs) const {
- if (rhs.type() == urid.type()) {
- return rhs == urid;
- } else if (rhs.type() == uri.type()) {
- return rhs == uri;
- }
- return false;
- }
-
- inline bool operator!=(const Atom& rhs) const {
- return !operator==(rhs);
- }
-
Atom urid;
Atom uri;
LilvNode* lnode;
@@ -213,12 +200,33 @@ public:
const Quark work_schedule;
};
-inline bool operator==(const Atom& a, const URIs::Quark& b) {
- return b == a;
+inline bool
+operator==(const URIs::Quark& lhs, const Atom& rhs)
+{
+ if (rhs.type() == lhs.urid.type()) {
+ return rhs == lhs.urid;
+ } else if (rhs.type() == lhs.uri.type()) {
+ return rhs == lhs.uri;
+ }
+ return false;
+}
+
+inline bool
+operator==(const Atom& lhs, const URIs::Quark& rhs)
+{
+ return rhs == lhs;
+}
+
+inline bool
+operator!=(const Atom& lhs, const URIs::Quark& rhs)
+{
+ return !(lhs == rhs);
}
-inline bool operator!=(const Atom& a, const URIs::Quark& b) {
- return b != a;
+inline bool
+operator!=(const URIs::Quark& lhs, const Atom& rhs)
+{
+ return !(lhs == rhs);
}
} // namespace Ingen