summaryrefslogtreecommitdiff
path: root/qmake/include/qasciidict.h
Unidiff
Diffstat (limited to 'qmake/include/qasciidict.h') (more/less context) (ignore whitespace changes)
-rw-r--r--qmake/include/qasciidict.h4
1 files changed, 4 insertions, 0 deletions
diff --git a/qmake/include/qasciidict.h b/qmake/include/qasciidict.h
index 8f344cd..ecd9c9f 100644
--- a/qmake/include/qasciidict.h
+++ b/qmake/include/qasciidict.h
@@ -22,97 +22,101 @@
22** licenses may use this file in accordance with the Qt Commercial License 22** licenses may use this file in accordance with the Qt Commercial License
23** Agreement provided with the Software. 23** Agreement provided with the Software.
24** 24**
25** This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE 25** This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE
26** WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. 26** WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
27** 27**
28** See http://www.trolltech.com/pricing.html or email sales@trolltech.com for 28** See http://www.trolltech.com/pricing.html or email sales@trolltech.com for
29** information about Qt Commercial License Agreements. 29** information about Qt Commercial License Agreements.
30** See http://www.trolltech.com/qpl/ for QPL licensing information. 30** See http://www.trolltech.com/qpl/ for QPL licensing information.
31** See http://www.trolltech.com/gpl/ for GPL licensing information. 31** See http://www.trolltech.com/gpl/ for GPL licensing information.
32** 32**
33** Contact info@trolltech.com if any conditions of this licensing are 33** Contact info@trolltech.com if any conditions of this licensing are
34** not clear to you. 34** not clear to you.
35** 35**
36**********************************************************************/ 36**********************************************************************/
37 37
38#ifndef QASCIIDICT_H 38#ifndef QASCIIDICT_H
39#define QASCIIDICT_H 39#define QASCIIDICT_H
40 40
41#ifndef QT_H 41#ifndef QT_H
42#include "qgdict.h" 42#include "qgdict.h"
43#endif // QT_H 43#endif // QT_H
44 44
45template<class type> 45template<class type>
46class QAsciiDict 46class QAsciiDict
47#ifdef Q_QDOC 47#ifdef Q_QDOC
48 : public QPtrCollection 48 : public QPtrCollection
49#else 49#else
50 : public QGDict 50 : public QGDict
51#endif 51#endif
52{ 52{
53public: 53public:
54 QAsciiDict(int size=17, bool caseSensitive=TRUE, bool copyKeys=TRUE ) 54 QAsciiDict(int size=17, bool caseSensitive=TRUE, bool copyKeys=TRUE )
55 : QGDict(size,AsciiKey,caseSensitive,copyKeys) {} 55 : QGDict(size,AsciiKey,caseSensitive,copyKeys) {}
56 QAsciiDict( const QAsciiDict<type> &d ) : QGDict(d) {} 56 QAsciiDict( const QAsciiDict<type> &d ) : QGDict(d) {}
57 ~QAsciiDict() { clear(); } 57 ~QAsciiDict() { clear(); }
58 QAsciiDict<type> &operator=(const QAsciiDict<type> &d) 58 QAsciiDict<type> &operator=(const QAsciiDict<type> &d)
59 { return (QAsciiDict<type>&)QGDict::operator=(d); } 59 { return (QAsciiDict<type>&)QGDict::operator=(d); }
60 uint count() const { return QGDict::count(); } 60 uint count() const { return QGDict::count(); }
61 uint size() const { return QGDict::size(); } 61 uint size() const { return QGDict::size(); }
62 bool isEmpty() const { return QGDict::count() == 0; } 62 bool isEmpty() const { return QGDict::count() == 0; }
63 63
64 void insert( const char *k, const type *d ) 64 void insert( const char *k, const type *d )
65 { QGDict::look_ascii(k,(Item)d,1); } 65 { QGDict::look_ascii(k,(Item)d,1); }
66 void replace( const char *k, const type *d ) 66 void replace( const char *k, const type *d )
67 { QGDict::look_ascii(k,(Item)d,2); } 67 { QGDict::look_ascii(k,(Item)d,2); }
68 bool remove( const char *k ){ return QGDict::remove_ascii(k); } 68 bool remove( const char *k ){ return QGDict::remove_ascii(k); }
69 type *take( const char *k ) { return (type *)QGDict::take_ascii(k); } 69 type *take( const char *k ) { return (type *)QGDict::take_ascii(k); }
70 type *find( const char *k ) const 70 type *find( const char *k ) const
71 { return (type *)((QGDict*)this)->QGDict::look_ascii(k,0,0); } 71 { return (type *)((QGDict*)this)->QGDict::look_ascii(k,0,0); }
72 type *operator[]( const char *k ) const 72 type *operator[]( const char *k ) const
73 { return (type *)((QGDict*)this)->QGDict::look_ascii(k,0,0); } 73 { return (type *)((QGDict*)this)->QGDict::look_ascii(k,0,0); }
74 74
75 void clear() { QGDict::clear(); } 75 void clear() { QGDict::clear(); }
76 void resize( uint n ) { QGDict::resize(n); } 76 void resize( uint n ) { QGDict::resize(n); }
77 void statistics() const { QGDict::statistics(); } 77 void statistics() const { QGDict::statistics(); }
78 78
79#ifdef Q_QDOC 79#ifdef Q_QDOC
80protected: 80protected:
81 virtual QDataStream& read( QDataStream &, QPtrCollection::Item & ); 81 virtual QDataStream& read( QDataStream &, QPtrCollection::Item & );
82 virtual QDataStream& write( QDataStream &, QPtrCollection::Item ) const; 82 virtual QDataStream& write( QDataStream &, QPtrCollection::Item ) const;
83#endif 83#endif
84 84
85private: 85private:
86 void deleteItem( Item d ); 86 void deleteItem( Item d );
87}; 87};
88 88
89#if !defined(Q_BROKEN_TEMPLATE_SPECIALIZATION) 89#if !defined(Q_BROKEN_TEMPLATE_SPECIALIZATION)
90template<> inline void QAsciiDict<void>::deleteItem( QPtrCollection::Item ) 90template<> inline void QAsciiDict<void>::deleteItem( QPtrCollection::Item )
91{ 91{
92} 92}
93#endif 93#endif
94 94
95template<class type> inline void QAsciiDict<type>::deleteItem( QPtrCollection::Item d ) 95template<class type> inline void QAsciiDict<type>::deleteItem( QPtrCollection::Item d )
96{ 96{
97 if ( del_item ) delete (type *)d; 97 if ( del_item ) delete (type *)d;
98} 98}
99 99
100template<class type> 100template<class type>
101class QAsciiDictIterator : public QGDictIterator 101class QAsciiDictIterator : public QGDictIterator
102{ 102{
103public: 103public:
104 QAsciiDictIterator(const QAsciiDict<type> &d) 104 QAsciiDictIterator(const QAsciiDict<type> &d)
105 : QGDictIterator((QGDict &)d) {} 105 : QGDictIterator((QGDict &)d) {}
106 ~QAsciiDictIterator() {} 106 ~QAsciiDictIterator() {}
107 uint count() const { return dict->count(); } 107 uint count() const { return dict->count(); }
108 bool isEmpty() const { return dict->count() == 0; } 108 bool isEmpty() const { return dict->count() == 0; }
109 type *toFirst() { return (type *)QGDictIterator::toFirst(); } 109 type *toFirst() { return (type *)QGDictIterator::toFirst(); }
110 operator type *() const { return (type *)QGDictIterator::get(); } 110 operator type *() const { return (type *)QGDictIterator::get(); }
111 type *current() const { return (type *)QGDictIterator::get(); } 111 type *current() const { return (type *)QGDictIterator::get(); }
112 const char *currentKey() const { return QGDictIterator::getKeyAscii(); } 112 const char *currentKey() const { return QGDictIterator::getKeyAscii(); }
113 type *operator()() { return (type *)QGDictIterator::operator()(); } 113 type *operator()() { return (type *)QGDictIterator::operator()(); }
114 type *operator++() { return (type *)QGDictIterator::operator++(); } 114 type *operator++() { return (type *)QGDictIterator::operator++(); }
115 type *operator+=(uint j) { return (type *)QGDictIterator::operator+=(j);} 115 type *operator+=(uint j) { return (type *)QGDictIterator::operator+=(j);}
116}; 116};
117 117
118#ifdef QT_QWINEXPORT
119#define Q_DEFINED_QASCIIDICT
120#include "qwinexport.h"
121#endif /* QT_QWINEXPORT */
118#endif // QASCIIDICT_H 122#endif // QASCIIDICT_H