diff options
author | Rémi Nicole <nicole@kolabsystems.com> | 2018-07-27 13:40:15 +0200 |
---|---|---|
committer | Christian Mollekopf <chrigi_1@fastmail.fm> | 2018-07-27 13:48:34 +0200 |
commit | 6fcb97ad464a346663184b27d587668c59b54361 (patch) | |
tree | 02685a81d0101d339dc2815f3471004502467830 /common/storage/key.h | |
parent | c741d7fbb21ff959ca4b6d4f7681aead277044b4 (diff) | |
download | sink-6fcb97ad464a346663184b27d587668c59b54361.tar.gz sink-6fcb97ad464a346663184b27d587668c59b54361.zip |
Use Key API in SinkSH
Summary:
Depends on D14289
- Fixes the `sinksh inspect …` command
- Introduces `isValid`, `isValidInternal` and `isValidDisplay` static functions in Key, Identifier and Revision
I still have to do a more extensive search for induced bugs in other commands
Reviewers: cmollekopf
Reviewed By: cmollekopf
Tags: #sink
Differential Revision: https://phabricator.kde.org/D14404
Diffstat (limited to 'common/storage/key.h')
-rw-r--r-- | common/storage/key.h | 18 |
1 files changed, 15 insertions, 3 deletions
diff --git a/common/storage/key.h b/common/storage/key.h index a5b92bb..211aea7 100644 --- a/common/storage/key.h +++ b/common/storage/key.h | |||
@@ -48,6 +48,10 @@ public: | |||
48 | 48 | ||
49 | bool isNull() const; | 49 | bool isNull() const; |
50 | 50 | ||
51 | static bool isValidInternal(const QByteArray &); | ||
52 | static bool isValidDisplay(const QByteArray &); | ||
53 | static bool isValid(const QByteArray &); | ||
54 | |||
51 | bool operator==(const Identifier &other) const; | 55 | bool operator==(const Identifier &other) const; |
52 | bool operator!=(const Identifier &other) const; | 56 | bool operator!=(const Identifier &other) const; |
53 | 57 | ||
@@ -72,6 +76,10 @@ public: | |||
72 | static Revision fromDisplayByteArray(const QByteArray &bytes); | 76 | static Revision fromDisplayByteArray(const QByteArray &bytes); |
73 | qint64 toQint64() const; | 77 | qint64 toQint64() const; |
74 | 78 | ||
79 | static bool isValidInternal(const QByteArray &); | ||
80 | static bool isValidDisplay(const QByteArray &); | ||
81 | static bool isValid(const QByteArray &); | ||
82 | |||
75 | bool operator==(const Revision &other) const; | 83 | bool operator==(const Revision &other) const; |
76 | bool operator!=(const Revision &other) const; | 84 | bool operator!=(const Revision &other) const; |
77 | 85 | ||
@@ -99,6 +107,10 @@ public: | |||
99 | 107 | ||
100 | bool isNull() const; | 108 | bool isNull() const; |
101 | 109 | ||
110 | static bool isValidInternal(const QByteArray &); | ||
111 | static bool isValidDisplay(const QByteArray &); | ||
112 | static bool isValid(const QByteArray &); | ||
113 | |||
102 | bool operator==(const Key &other) const; | 114 | bool operator==(const Key &other) const; |
103 | bool operator!=(const Key &other) const; | 115 | bool operator!=(const Key &other) const; |
104 | 116 | ||
@@ -110,6 +122,6 @@ private: | |||
110 | } // namespace Storage | 122 | } // namespace Storage |
111 | } // namespace Sink | 123 | } // namespace Sink |
112 | 124 | ||
113 | SINK_EXPORT QDebug& operator<<(QDebug &dbg, const Sink::Storage::Identifier &); | 125 | SINK_EXPORT QDebug &operator<<(QDebug &dbg, const Sink::Storage::Identifier &); |
114 | SINK_EXPORT QDebug& operator<<(QDebug &dbg, const Sink::Storage::Revision &); | 126 | SINK_EXPORT QDebug &operator<<(QDebug &dbg, const Sink::Storage::Revision &); |
115 | SINK_EXPORT QDebug& operator<<(QDebug &dbg, const Sink::Storage::Key &); | 127 | SINK_EXPORT QDebug &operator<<(QDebug &dbg, const Sink::Storage::Key &); |