diff options
author | Aaron Seigo <aseigo@kde.org> | 2014-12-05 12:56:33 +0100 |
---|---|---|
committer | Aaron Seigo <aseigo@kde.org> | 2014-12-05 12:56:33 +0100 |
commit | 130affe4addb1aff1618d8fb849889b2d4453ef2 (patch) | |
tree | 4771ee8e9bdcd2b2ab3a25ae7f9edf7766b521b6 /common/storage.h | |
parent | a86b10296c5e8017821b422bb4e06c308e14ed04 (diff) | |
download | sink-130affe4addb1aff1618d8fb849889b2d4453ef2.tar.gz sink-130affe4addb1aff1618d8fb849889b2d4453ef2.zip |
require users of a Storage class to state up-front if they are read or readwrite
Diffstat (limited to 'common/storage.h')
-rw-r--r-- | common/storage.h | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/common/storage.h b/common/storage.h index 0b548fb..846e15b 100644 --- a/common/storage.h +++ b/common/storage.h | |||
@@ -5,12 +5,12 @@ | |||
5 | 5 | ||
6 | class Storage { | 6 | class Storage { |
7 | public: | 7 | public: |
8 | enum TransactionType { ReadOnly, ReadWrite }; | 8 | enum AccessMode { ReadOnly, ReadWrite }; |
9 | 9 | ||
10 | Storage(const QString &storageRoot, const QString &name); | 10 | Storage(const QString &storageRoot, const QString &name, AccessMode mode = ReadOnly); |
11 | ~Storage(); | 11 | ~Storage(); |
12 | bool isInTransaction() const; | 12 | bool isInTransaction() const; |
13 | bool startTransaction(TransactionType type = ReadWrite); | 13 | bool startTransaction(AccessMode mode = ReadWrite); |
14 | bool commitTransaction(); | 14 | bool commitTransaction(); |
15 | void abortTransaction(); | 15 | void abortTransaction(); |
16 | bool write(const char *key, size_t keySize, const char *value, size_t valueSize); | 16 | bool write(const char *key, size_t keySize, const char *value, size_t valueSize); |