aboutsummaryrefslogtreecommitdiff
path: root/src/saved_auth.h
diff options
context:
space:
mode:
Diffstat (limited to 'src/saved_auth.h')
-rw-r--r--src/saved_auth.h17
1 files changed, 17 insertions, 0 deletions
diff --git a/src/saved_auth.h b/src/saved_auth.h
new file mode 100644
index 0000000..d37a8fd
--- /dev/null
+++ b/src/saved_auth.h
@@ -0,0 +1,17 @@
+#pragma once
+
+#include <QHash>
+
+class SavedAuth
+{
+public:
+ bool load();
+ QByteArray lookup(QByteArrayView host, QByteArrayView user) const;
+ void insert(QByteArrayView host, QByteArrayView user, QByteArrayView key);
+ void remove(QByteArrayView host, QByteArrayView user);
+
+private:
+ QHash<QByteArray, QByteArray> m_table;
+ bool save() const;
+ QByteArray flatten_key(QByteArrayView host, QByteArrayView user) const;
+};