glc_attributes.h
Go to the documentation of this file.00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00025
00026 #ifndef GLC_ATTRIBUTES_H_
00027 #define GLC_ATTRIBUTES_H_
00028
00029 #include <QString>
00030 #include <QList>
00031 #include <QHash>
00032
00033 #include "../glc_config.h"
00034
00037
00038
00039 class GLC_LIB_EXPORT GLC_Attributes
00040 {
00041
00043
00045
00046 public:
00048 GLC_Attributes();
00049
00051 GLC_Attributes(const GLC_Attributes&);
00052
00054 GLC_Attributes& operator=(const GLC_Attributes&);
00055
00057 virtual ~GLC_Attributes();
00058
00060
00062
00064
00065 public:
00067 inline bool isEmpty() const
00068 {return m_AttributesHash.isEmpty();}
00069
00071 inline int size() const
00072 {return m_AttributesHash.size();}
00073
00075 bool contains(const QString& name) const
00076 {return m_AttributesHash.contains(name);}
00077
00079 inline QList<QString> names() const
00080 {return m_AttributesHash.keys();}
00081
00083
00084 inline QString value(const QString& name) const
00085 {return m_AttributesHash.value(name);}
00086
00088
00090
00092
00093 public:
00095 inline void insert(const QString& name, const QString& value)
00096 {m_AttributesHash.insert(name, value);}
00097
00099 inline void remove(const QString& name)
00100 {m_AttributesHash.remove(name);}
00101
00103
00105
00107
00108 public:
00109
00111 inline bool operator==(const GLC_Attributes& attr) const
00112 {return m_AttributesHash == attr.m_AttributesHash;}
00113
00115
00116
00118 private:
00120 QHash<QString, QString> m_AttributesHash;
00121 };
00122
00123 #endif