diff options
Diffstat (limited to 'common/storage/key.cpp')
-rw-r--r-- | common/storage/key.cpp | 41 |
1 files changed, 41 insertions, 0 deletions
diff --git a/common/storage/key.cpp b/common/storage/key.cpp index 4dacca2..cfeb016 100644 --- a/common/storage/key.cpp +++ b/common/storage/key.cpp | |||
@@ -79,6 +79,21 @@ Identifier Identifier::fromDisplayByteArray(const QByteArray &bytes) | |||
79 | return Identifier(QUuid(bytes)); | 79 | return Identifier(QUuid(bytes)); |
80 | } | 80 | } |
81 | 81 | ||
82 | bool Identifier::isNull() const | ||
83 | { | ||
84 | return uid.isNull(); | ||
85 | } | ||
86 | |||
87 | bool Identifier::operator==(const Identifier &other) const | ||
88 | { | ||
89 | return uid == other.uid; | ||
90 | } | ||
91 | |||
92 | bool Identifier::operator!=(const Identifier &other) const | ||
93 | { | ||
94 | return !(*this == other); | ||
95 | } | ||
96 | |||
82 | // Revision | 97 | // Revision |
83 | 98 | ||
84 | QByteArray Revision::toInternalByteArray() const | 99 | QByteArray Revision::toInternalByteArray() const |
@@ -113,6 +128,16 @@ qint64 Revision::toQint64() const | |||
113 | return rev; | 128 | return rev; |
114 | } | 129 | } |
115 | 130 | ||
131 | bool Revision::operator==(const Revision &other) const | ||
132 | { | ||
133 | return rev == other.rev; | ||
134 | } | ||
135 | |||
136 | bool Revision::operator!=(const Revision &other) const | ||
137 | { | ||
138 | return !(*this == other); | ||
139 | } | ||
140 | |||
116 | // Key | 141 | // Key |
117 | 142 | ||
118 | QByteArray Key::toInternalByteArray() const | 143 | QByteArray Key::toInternalByteArray() const |
@@ -160,3 +185,19 @@ void Key::setRevision(const Revision &newRev) | |||
160 | { | 185 | { |
161 | rev = newRev; | 186 | rev = newRev; |
162 | } | 187 | } |
188 | |||
189 | bool Key::isNull() const | ||
190 | { | ||
191 | return id.isNull(); | ||
192 | } | ||
193 | |||
194 | bool Key::operator==(const Key &other) const | ||
195 | { | ||
196 | return (id == other.id) && (rev == other.rev); | ||
197 | } | ||
198 | |||
199 | bool Key::operator!=(const Key &other) const | ||
200 | { | ||
201 | return !(*this == other); | ||
202 | } | ||
203 | |||