forked from frankosterfeld/qtkeychain
-
Notifications
You must be signed in to change notification settings - Fork 0
/
plaintextstore_p.h
47 lines (34 loc) · 1.63 KB
/
plaintextstore_p.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
/******************************************************************************
* Copyright (C) 2011-2015 Frank Osterfeld <[email protected]> *
* Copyright (C) 2016 Mathias Hasselmann <[email protected]> *
* *
* This program is distributed in the hope that it will be useful, but *
* WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY *
* or FITNESS FOR A PARTICULAR PURPOSE. For licensing and distribution *
* details, check the accompanying file 'COPYING'. *
*****************************************************************************/
#ifndef QTKEYCHAIN_PLAINTEXTSTORE_P_H
#define QTKEYCHAIN_PLAINTEXTSTORE_P_H
#include "keychain_p.h"
namespace QKeychain {
class PlainTextStore {
Q_DECLARE_TR_FUNCTIONS(QKeychain::PlainTextStore)
public:
explicit PlainTextStore(const QString &service, QSettings *settings);
Error error() const { return m_error; }
QString errorString() const { return m_errorString; }
bool contains(const QString &key) const;
QByteArray readData(const QString &key);
JobPrivate::Mode readMode(const QString &key);
void write(const QString &key, const QByteArray &data, JobPrivate::Mode mode);
void remove(const QString &key);
private:
void setError(Error error, const QString &errorString);
QVariant read(const QString &key);
const QScopedPointer<QSettings> m_localSettings;
QSettings *const m_actualSettings;
QString m_errorString;
Error m_error;
};
}
#endif // QTKEYCHAIN_PLAINTEXTSTORE_P_H