summaryrefslogtreecommitdiff
path: root/qmake/include/qmap.h
Unidiff
Diffstat (limited to 'qmake/include/qmap.h') (more/less context) (ignore whitespace changes)
-rw-r--r--qmake/include/qmap.h4
1 files changed, 4 insertions, 0 deletions
diff --git a/qmake/include/qmap.h b/qmake/include/qmap.h
index 269bd6b..4bc0a2f 100644
--- a/qmake/include/qmap.h
+++ b/qmake/include/qmap.h
@@ -835,49 +835,53 @@ Q_INLINE_TEMPLATES Q_TYPENAME QMap<Key,T>::iterator QMap<Key,T>::insert( const K
835 if ( overwrite || n < size() ) 835 if ( overwrite || n < size() )
836 it.data() = value; 836 it.data() = value;
837 return it; 837 return it;
838} 838}
839 839
840template<class Key, class T> 840template<class Key, class T>
841Q_INLINE_TEMPLATES void QMap<Key,T>::remove( const Key& k ) 841Q_INLINE_TEMPLATES void QMap<Key,T>::remove( const Key& k )
842{ 842{
843 detach(); 843 detach();
844 iterator it( sh->find( k ).node ); 844 iterator it( sh->find( k ).node );
845 if ( it != end() ) 845 if ( it != end() )
846 sh->remove( it ); 846 sh->remove( it );
847} 847}
848 848
849template<class Key, class T> 849template<class Key, class T>
850Q_INLINE_TEMPLATES void QMap<Key,T>::detachInternal() 850Q_INLINE_TEMPLATES void QMap<Key,T>::detachInternal()
851{ 851{
852 sh->deref(); sh = new QMapPrivate<Key,T>( sh ); 852 sh->deref(); sh = new QMapPrivate<Key,T>( sh );
853} 853}
854 854
855 855
856#ifndef QT_NO_DATASTREAM 856#ifndef QT_NO_DATASTREAM
857template<class Key, class T> 857template<class Key, class T>
858Q_INLINE_TEMPLATES QDataStream& operator>>( QDataStream& s, QMap<Key,T>& m ) { 858Q_INLINE_TEMPLATES QDataStream& operator>>( QDataStream& s, QMap<Key,T>& m ) {
859 m.clear(); 859 m.clear();
860 Q_UINT32 c; 860 Q_UINT32 c;
861 s >> c; 861 s >> c;
862 for( Q_UINT32 i = 0; i < c; ++i ) { 862 for( Q_UINT32 i = 0; i < c; ++i ) {
863 Key k; T t; 863 Key k; T t;
864 s >> k >> t; 864 s >> k >> t;
865 m.insert( k, t ); 865 m.insert( k, t );
866 if ( s.atEnd() ) 866 if ( s.atEnd() )
867 break; 867 break;
868 } 868 }
869 return s; 869 return s;
870} 870}
871 871
872 872
873template<class Key, class T> 873template<class Key, class T>
874Q_INLINE_TEMPLATES QDataStream& operator<<( QDataStream& s, const QMap<Key,T>& m ) { 874Q_INLINE_TEMPLATES QDataStream& operator<<( QDataStream& s, const QMap<Key,T>& m ) {
875 s << (Q_UINT32)m.size(); 875 s << (Q_UINT32)m.size();
876 QMapConstIterator<Key,T> it = m.begin(); 876 QMapConstIterator<Key,T> it = m.begin();
877 for( ; it != m.end(); ++it ) 877 for( ; it != m.end(); ++it )
878 s << it.key() << it.data(); 878 s << it.key() << it.data();
879 return s; 879 return s;
880} 880}
881#endif 881#endif
882 882
883#ifdef QT_QWINEXPORT
884#define Q_DEFINED_QMAP
885#include "qwinexport.h"
886#endif /* QT_QWINEXPORT */
883#endif // QMAP_H 887#endif // QMAP_H