author | llornkcor <llornkcor> | 2003-07-10 02:40:10 (UTC) |
---|---|---|
committer | llornkcor <llornkcor> | 2003-07-10 02:40:10 (UTC) |
commit | 155d68c1e7d7dc0fed2534ac43d6d77ce2781f55 (patch) (unidiff) | |
tree | e6edaa5a7040fe6c224c3943d1094dcf02e4f74c /qmake/include/qptrvector.h | |
parent | 86703e8a5527ef114facd02c005b6b3a7e62e263 (diff) | |
download | opie-155d68c1e7d7dc0fed2534ac43d6d77ce2781f55.zip opie-155d68c1e7d7dc0fed2534ac43d6d77ce2781f55.tar.gz opie-155d68c1e7d7dc0fed2534ac43d6d77ce2781f55.tar.bz2 |
update qmake to 1.05a
-rw-r--r-- | qmake/include/qptrvector.h | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/qmake/include/qptrvector.h b/qmake/include/qptrvector.h index f6d9623..49b40b7 100644 --- a/qmake/include/qptrvector.h +++ b/qmake/include/qptrvector.h | |||
@@ -17,97 +17,101 @@ | |||
17 | ** GNU General Public License version 2 as published by the Free Software | 17 | ** GNU General Public License version 2 as published by the Free Software |
18 | ** Foundation and appearing in the file LICENSE.GPL included in the | 18 | ** Foundation and appearing in the file LICENSE.GPL included in the |
19 | ** packaging of this file. | 19 | ** packaging of this file. |
20 | ** | 20 | ** |
21 | ** Licensees holding valid Qt Enterprise Edition or Qt Professional Edition | 21 | ** Licensees holding valid Qt Enterprise Edition or Qt Professional Edition |
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 QPTRVECTOR_H | 38 | #ifndef QPTRVECTOR_H |
39 | #define QPTRVECTOR_H | 39 | #define QPTRVECTOR_H |
40 | 40 | ||
41 | #ifndef QT_H | 41 | #ifndef QT_H |
42 | #include "qgvector.h" | 42 | #include "qgvector.h" |
43 | #endif // QT_H | 43 | #endif // QT_H |
44 | 44 | ||
45 | template<class type> | 45 | template<class type> |
46 | class QPtrVector | 46 | class QPtrVector |
47 | #ifdef Q_QDOC | 47 | #ifdef Q_QDOC |
48 | : public QPtrCollection | 48 | : public QPtrCollection |
49 | #else | 49 | #else |
50 | : public QGVector | 50 | : public QGVector |
51 | #endif | 51 | #endif |
52 | { | 52 | { |
53 | public: | 53 | public: |
54 | QPtrVector() { } | 54 | QPtrVector() { } |
55 | QPtrVector( uint size ) : QGVector(size) { } | 55 | QPtrVector( uint size ) : QGVector(size) { } |
56 | QPtrVector( const QPtrVector<type> &v ) : QGVector( v ) { } | 56 | QPtrVector( const QPtrVector<type> &v ) : QGVector( v ) { } |
57 | ~QPtrVector() { clear(); } | 57 | ~QPtrVector() { clear(); } |
58 | QPtrVector<type> &operator=(const QPtrVector<type> &v) | 58 | QPtrVector<type> &operator=(const QPtrVector<type> &v) |
59 | { return (QPtrVector<type>&)QGVector::operator=(v); } | 59 | { return (QPtrVector<type>&)QGVector::operator=(v); } |
60 | bool operator==( const QPtrVector<type> &v ) const { return QGVector::operator==(v); } | 60 | bool operator==( const QPtrVector<type> &v ) const { return QGVector::operator==(v); } |
61 | type **data() const { return (type **)QGVector::data(); } | 61 | type **data() const { return (type **)QGVector::data(); } |
62 | uint size() const { return QGVector::size(); } | 62 | uint size() const { return QGVector::size(); } |
63 | uint count() const { return QGVector::count(); } | 63 | uint count() const { return QGVector::count(); } |
64 | bool isEmpty() const { return QGVector::count() == 0; } | 64 | bool isEmpty() const { return QGVector::count() == 0; } |
65 | bool isNull() const { return QGVector::size() == 0; } | 65 | bool isNull() const { return QGVector::size() == 0; } |
66 | bool resize( uint size ) { return QGVector::resize(size); } | 66 | bool resize( uint size ) { return QGVector::resize(size); } |
67 | bool insert( uint i, const type *d){ return QGVector::insert(i,(Item)d); } | 67 | bool insert( uint i, const type *d){ return QGVector::insert(i,(Item)d); } |
68 | bool remove( uint i ) { return QGVector::remove(i); } | 68 | bool remove( uint i ) { return QGVector::remove(i); } |
69 | type *take( uint i ) { return (type *)QGVector::take(i); } | 69 | type *take( uint i ) { return (type *)QGVector::take(i); } |
70 | void clear() { QGVector::clear(); } | 70 | void clear() { QGVector::clear(); } |
71 | bool fill( const type *d, int size=-1 ) | 71 | bool fill( const type *d, int size=-1 ) |
72 | { return QGVector::fill((Item)d,size);} | 72 | { return QGVector::fill((Item)d,size);} |
73 | void sort() { QGVector::sort(); } | 73 | void sort() { QGVector::sort(); } |
74 | int bsearch( const type *d ) const{ return QGVector::bsearch((Item)d); } | 74 | int bsearch( const type *d ) const{ return QGVector::bsearch((Item)d); } |
75 | int findRef( const type *d, uint i=0 ) const | 75 | int findRef( const type *d, uint i=0 ) const |
76 | { return QGVector::findRef((Item)d,i);} | 76 | { return QGVector::findRef((Item)d,i);} |
77 | int find( const type *d, uint i= 0 ) const | 77 | int find( const type *d, uint i= 0 ) const |
78 | { return QGVector::find((Item)d,i); } | 78 | { return QGVector::find((Item)d,i); } |
79 | uint containsRef( const type *d ) const | 79 | uint containsRef( const type *d ) const |
80 | { return QGVector::containsRef((Item)d); } | 80 | { return QGVector::containsRef((Item)d); } |
81 | uint contains( const type *d ) const | 81 | uint contains( const type *d ) const |
82 | { return QGVector::contains((Item)d); } | 82 | { return QGVector::contains((Item)d); } |
83 | type *operator[]( int i ) const{ return (type *)QGVector::at(i); } | 83 | type *operator[]( int i ) const{ return (type *)QGVector::at(i); } |
84 | type *at( uint i ) const { return (type *)QGVector::at(i); } | 84 | type *at( uint i ) const { return (type *)QGVector::at(i); } |
85 | void toList( QGList *list ) const{ QGVector::toList(list); } | 85 | void toList( QGList *list ) const{ QGVector::toList(list); } |
86 | 86 | ||
87 | #ifdef Q_QDOC | 87 | #ifdef Q_QDOC |
88 | protected: | 88 | protected: |
89 | virtual int compareItems( QPtrCollection::Item d1, QPtrCollection::Item d2 ); | 89 | virtual int compareItems( QPtrCollection::Item d1, QPtrCollection::Item d2 ); |
90 | virtual QDataStream& read( QDataStream &s, QPtrCollection::Item &d ); | 90 | virtual QDataStream& read( QDataStream &s, QPtrCollection::Item &d ); |
91 | virtual QDataStream& write( QDataStream &s, QPtrCollection::Item d ) const; | 91 | virtual QDataStream& write( QDataStream &s, QPtrCollection::Item d ) const; |
92 | #endif | 92 | #endif |
93 | 93 | ||
94 | private: | 94 | private: |
95 | void deleteItem( Item d ); | 95 | void deleteItem( Item d ); |
96 | }; | 96 | }; |
97 | 97 | ||
98 | #if !defined(Q_BROKEN_TEMPLATE_SPECIALIZATION) | 98 | #if !defined(Q_BROKEN_TEMPLATE_SPECIALIZATION) |
99 | template<> inline void QPtrVector<void>::deleteItem( QPtrCollection::Item ) | 99 | template<> inline void QPtrVector<void>::deleteItem( QPtrCollection::Item ) |
100 | { | 100 | { |
101 | } | 101 | } |
102 | #endif | 102 | #endif |
103 | 103 | ||
104 | template<class type> inline void QPtrVector<type>::deleteItem( QPtrCollection::Item d ) | 104 | template<class type> inline void QPtrVector<type>::deleteItem( QPtrCollection::Item d ) |
105 | { | 105 | { |
106 | if ( del_item ) delete (type *)d; | 106 | if ( del_item ) delete (type *)d; |
107 | } | 107 | } |
108 | 108 | ||
109 | #ifndef QT_NO_COMPAT | 109 | #ifndef QT_NO_COMPAT |
110 | #define QVector QPtrVector | 110 | #define QVector QPtrVector |
111 | #endif | 111 | #endif |
112 | 112 | ||
113 | #ifdef QT_QWINEXPORT | ||
114 | #define Q_DEFINED_QPTRVECTOR | ||
115 | #include "qwinexport.h" | ||
116 | #endif /* QT_QWINEXPORT */ | ||
113 | #endif // QVECTOR_H | 117 | #endif // QVECTOR_H |