CSettingsArchiveBase.h
Go to the documentation of this file.
1 #ifndef iqt_CSettingsArchiveBase_included
2 #define iqt_CSettingsArchiveBase_included
3 
4 
5 // Qt includes
6 #include <QtCore/QList>
7 
8 // Qt includes
9 #include <QtCore/QSettings>
10 #include <QtCore/QString>
11 
12 
13 namespace iqt
14 {
15 
16 
22 class CSettingsArchiveBase: protected QSettings
23 {
24 public:
25  typedef QSettings BaseClass;
26 
35  const QString& organizationName,
36  const QString& applicationName,
37  const QString& rootKey,
38  QSettings::Scope settingsScope = QSettings::UserScope);
39 
40 protected:
41  bool EnterTag(const QByteArray& tagId);
42  bool LeaveTag(const QByteArray& tagId);
43  QString GetCurrentCountKey() const;
44  QString CreateNextValueKey();
45  QString GetBaseKey() const;
46 
47  struct TagInfo
48  {
49  TagInfo(const QByteArray& tagId, int siblingsCount)
50  {
51  this->tagId = tagId;
52  this->siblingsCount = siblingsCount;
53  }
54 
55  QByteArray tagId;
57  };
58 
59  typedef QList<TagInfo> OpenTagsList;
61 
62  QString m_rootKey;
63 
65 };
66 
67 
68 } // namespace iqt
69 
70 
71 #endif // !iqt_CSettingsArchiveBase_included
72 
TagInfo(const QByteArray &tagId, int siblingsCount)
bool LeaveTag(const QByteArray &tagId)
Basic implementation for an archive used Qt settings implementation as persistence medium...
CSettingsArchiveBase(const QString &organizationName, const QString &applicationName, const QString &rootKey, QSettings::Scope settingsScope=QSettings::UserScope)
Constructor.
bool EnterTag(const QByteArray &tagId)
QString GetCurrentCountKey() const
QString GetBaseKey() const

© 2007-2017 Witold Gantzke and Kirill Lepskiy