author | llornkcor <llornkcor> | 2003-07-10 02:40:10 (UTC) |
---|---|---|
committer | llornkcor <llornkcor> | 2003-07-10 02:40:10 (UTC) |
commit | 155d68c1e7d7dc0fed2534ac43d6d77ce2781f55 (patch) (side-by-side diff) | |
tree | e6edaa5a7040fe6c224c3943d1094dcf02e4f74c /qmake/include/qmemarray.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/qmemarray.h | 9 |
1 files changed, 8 insertions, 1 deletions
diff --git a/qmake/include/qmemarray.h b/qmake/include/qmemarray.h index a5baf99..267670d 100644 --- a/qmake/include/qmemarray.h +++ b/qmake/include/qmemarray.h @@ -30,57 +30,58 @@ ** See http://www.trolltech.com/qpl/ for QPL licensing information. ** See http://www.trolltech.com/gpl/ for GPL licensing information. ** ** Contact info@trolltech.com if any conditions of this licensing are ** not clear to you. ** **********************************************************************/ #ifndef QMEMARRAY_H #define QMEMARRAY_H #ifndef QT_H #include "qgarray.h" #endif // QT_H -template<class type> +template<class type> class QMemArray : public QGArray { public: typedef type* Iterator; typedef const type* ConstIterator; typedef type ValueType; protected: QMemArray( int, int ) : QGArray( 0, 0 ) {} public: QMemArray() {} QMemArray( int size ) : QGArray(size*sizeof(type)) {} QMemArray( const QMemArray<type> &a ) : QGArray(a) {} ~QMemArray() {} QMemArray<type> &operator=(const QMemArray<type> &a) { return (QMemArray<type>&)QGArray::assign(a); } type *data() const { return (type *)QGArray::data(); } uint nrefs() const { return QGArray::nrefs(); } uint size() const { return QGArray::size()/sizeof(type); } uint count() const { return size(); } bool isEmpty() const { return QGArray::size() == 0; } bool isNull() const { return QGArray::data() == 0; } bool resize( uint size ) { return QGArray::resize(size*sizeof(type)); } + bool resize( uint size, Optimization optim ) { return QGArray::resize(size*sizeof(type), optim); } bool truncate( uint pos ) { return QGArray::resize(pos*sizeof(type)); } bool fill( const type &d, int size = -1 ) { return QGArray::fill((char*)&d,size,sizeof(type) ); } void detach() { QGArray::detach(); } QMemArray<type> copy() const { QMemArray<type> tmp; return tmp.duplicate(*this); } QMemArray<type>& assign( const QMemArray<type>& a ) { return (QMemArray<type>&)QGArray::assign(a); } QMemArray<type>& assign( const type *a, uint n ) { return (QMemArray<type>&)QGArray::assign((char*)a,n*sizeof(type)); } QMemArray<type>& duplicate( const QMemArray<type>& a ) { return (QMemArray<type>&)QGArray::duplicate(a); } QMemArray<type>& duplicate( const type *a, uint n ) { return (QMemArray<type>&)QGArray::duplicate((char*)a,n*sizeof(type)); } QMemArray<type>& setRawData( const type *a, uint n ) { return (QMemArray<type>&)QGArray::setRawData((char*)a, @@ -95,28 +96,34 @@ public: int bsearch( const type &d ) const { return QGArray::bsearch((const char*)&d,sizeof(type)); } // ### Qt 4.0: maybe provide uint overload as work-around for MSVC bug type& operator[]( int i ) const { return (type &)(*(type *)QGArray::at(i*sizeof(type))); } type& at( uint i ) const { return (type &)(*(type *)QGArray::at(i*sizeof(type))); } operator const type*() const { return (const type *)QGArray::data(); } bool operator==( const QMemArray<type> &a ) const { return isEqual(a); } bool operator!=( const QMemArray<type> &a ) const { return !isEqual(a); } Iterator begin() { return data(); } Iterator end() { return data() + size(); } ConstIterator begin() const { return data(); } ConstIterator end() const { return data() + size(); } }; +#ifndef QT_QWINEXPORT #if defined(Q_TEMPLATEDLL) // MOC_SKIP_BEGIN Q_TEMPLATE_EXTERN template class Q_EXPORT QMemArray<int>; Q_TEMPLATE_EXTERN template class Q_EXPORT QMemArray<bool>; // MOC_SKIP_END #endif +#endif /* QT_QWINEXPORT */ #ifndef QT_NO_COMPAT #define QArray QMemArray #endif +#ifdef QT_QWINEXPORT +#define Q_DEFINED_QMEMARRAY +#include <qwinexport.h> +#endif /* QT_QWINEXPORT */ #endif // QARRAY_H |