Engauge Digitizer  2
PointIdentifiers.h
1 /******************************************************************************************************
2  * (C) 2014 markummitchell@github.com. This file is part of Engauge Digitizer, which is released *
3  * under GNU General Public License version 2 (GPLv2) or (at your option) any later version. See file *
4  * LICENSE or go to gnu.org/licenses for details. Distribution requires prior written permission. *
5  ******************************************************************************************************/
6 
7 #ifndef POINT_IDENTIFIERS_H
8 #define POINT_IDENTIFIERS_H
9 
10 #include <QHash>
11 #include <QString>
12 
13 class QXmlStreamReader;
14 class QXmlStreamWriter;
15 
16 typedef QHash<QString, bool> PointIdentifiersInternal;
17 
20 {
21 public:
24 
26  bool contains(const QString &pointIdentifier) const;
27 
29  int count() const;
30 
33  QString getKey (int i) const;
34 
36  bool getValue (const QString &pointIdentifier) const;
37 
39  void loadXml (QXmlStreamReader &reader);
40 
42  void saveXml (QXmlStreamWriter &writer) const;
43 
45  void setKeyValue (const QString &pointIdentifier,
46  bool value);
47 
48 private:
49 
50  PointIdentifiersInternal m_pointIdentifiers;
51 };
52 
53 #endif // POINT_IDENTIFIERS_H
Hash table class that tracks point identifiers as the key, with a corresponding boolean value...
QString getKey(int i) const
Get key for index.
bool getValue(const QString &pointIdentifier) const
Get value for key.
void setKeyValue(const QString &pointIdentifier, bool value)
Set key/value pair.
void saveXml(QXmlStreamWriter &writer) const
Serialize table to xml.
PointIdentifiers()
Single constructor.
void loadXml(QXmlStreamReader &reader)
Load from serialized xml.
bool contains(const QString &pointIdentifier) const
True if specified entry exists in the table.
int count() const
Number of entries.