Changeset 561 for trunk/src/corelib/io/qdebug.h
- Timestamp:
- Feb 11, 2010, 11:19:06 PM (15 years ago)
- Location:
- trunk
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk
-
Property svn:mergeinfo
set to (toggle deleted branches)
/branches/vendor/nokia/qt/4.6.1 merged eligible /branches/vendor/nokia/qt/current merged eligible /branches/vendor/trolltech/qt/current 3-149
-
Property svn:mergeinfo
set to (toggle deleted branches)
-
trunk/src/corelib/io/qdebug.h
r2 r561 2 2 ** 3 3 ** Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies). 4 ** Contact: Qt Software Information ([email protected]) 4 ** All rights reserved. 5 ** Contact: Nokia Corporation ([email protected]) 5 6 ** 6 7 ** This file is part of the QtCore module of the Qt Toolkit. … … 21 22 ** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. 22 23 ** 23 ** In addition, as a special exception, Nokia gives you certain 24 ** additional rights. These rights are described in the Nokia Qt LGPL 25 ** Exception version 1.0, included in the file LGPL_EXCEPTION.txt in this 26 ** package. 24 ** In addition, as a special exception, Nokia gives you certain additional 25 ** rights. These rights are described in the Nokia Qt LGPL Exception 26 ** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. 27 27 ** 28 28 ** GNU General Public License Usage … … 34 34 ** met: http://www.gnu.org/copyleft/gpl.html. 35 35 ** 36 ** If you are unsure which license is appropriate for your use, please37 ** contact the sales department at qt-sales@nokia.com.36 ** If you 37 ** @nokia.com. 38 38 ** $QT_END_LICENSE$ 39 39 ** … … 52 52 #include <QtCore/qvector.h> 53 53 #include <QtCore/qset.h> 54 54 55 55 56 QT_BEGIN_HEADER … … 80 81 inline ~QDebug() { 81 82 if (!--stream->ref) { 82 if(stream->message_output) 83 qt_message_output(stream->type, stream->buffer.toLocal8Bit().data()); 83 if(stream->message_output) { 84 QT_TRY { 85 qt_message_output(stream->type, stream->buffer.toLocal8Bit().data()); 86 } QT_CATCH(std::bad_alloc) { /* We're out of memory - give up. */ } 87 } 84 88 delete stream; 85 89 } 86 90 } 87 inline QDebug &space() { stream->space = true; stream->ts << " "; return *this; }91 inline QDebug &space() { stream->space = true; stream->ts << ; return *this; } 88 92 inline QDebug &nospace() { stream->space = false; return *this; } 89 inline QDebug &maybeSpace() { if (stream->space) stream->ts << " "; return *this; }90 91 inline QDebug &operator<<(QChar t) { stream->ts << "\'" << t << "\'"; return maybeSpace(); }92 inline QDebug &operator<<(QBool t) { stream->ts << (bool(t ) ? "true" : "false"); return maybeSpace(); }93 inline QDebug &maybeSpace() { if (stream->space) stream->ts << ; return *this; } 94 95 inline QDebug &operator<<(QChar t) { stream->ts << ; return maybeSpace(); } 96 inline QDebug &operator<<(QBool t) { stream->ts << (bool(t) ? "true" : "false"); return maybeSpace(); } 93 97 inline QDebug &operator<<(bool t) { stream->ts << (t ? "true" : "false"); return maybeSpace(); } 94 98 inline QDebug &operator<<(char t) { stream->ts << t; return maybeSpace(); } … … 106 110 inline QDebug &operator<<(double t) { stream->ts << t; return maybeSpace(); } 107 111 inline QDebug &operator<<(const char* t) { stream->ts << QString::fromAscii(t); return maybeSpace(); } 108 inline QDebug &operator<<(const QString & t) { stream->ts << "\"" << t << "\""; return maybeSpace(); }112 inline QDebug &operator<<(const QString & t) { stream->ts << ; return maybeSpace(); } 109 113 inline QDebug &operator<<(const QStringRef & t) { return operator<<(t.toString()); } 110 inline QDebug &operator<<(const QLatin1String &t) { stream->ts << "\"" << t.latin1() << "\""; return maybeSpace(); }111 inline QDebug &operator<<(const QByteArray & t) { stream->ts << "\"" << t << "\""; return maybeSpace(); }114 inline QDebug &operator<<(const QLatin1String &t) { stream->ts << ; return maybeSpace(); } 115 inline QDebug &operator<<(const QByteArray & t) { stream->ts << ; return maybeSpace(); } 112 116 inline QDebug &operator<<(const void * t) { stream->ts << t; return maybeSpace(); } 113 117 inline QDebug &operator<<(QTextStreamFunction f) { … … 159 163 #endif 160 164 { 161 debug.nospace() << "(";165 debug.nospace() << ; 162 166 for (Q_TYPENAME QList<T>::size_type i = 0; i < list.count(); ++i) { 163 167 if (i) … … 165 169 debug << list.at(i); 166 170 } 167 debug << ")";171 debug << ; 168 172 return debug.space(); 169 173 } … … 192 196 for (typename QMap<aKey, aT>::const_iterator it = map.constBegin(); 193 197 it != map.constEnd(); ++it) { 194 debug << "(" << it.key() << ", " << it.value() << ")";195 } 196 debug << ")";198 debug << ; 199 } 200 debug << ; 197 201 return debug.space(); 198 202 } … … 209 213 for (typename QHash<aKey, aT>::const_iterator it = hash.constBegin(); 210 214 it != hash.constEnd(); ++it) 211 debug << "(" << it.key() << ", " << it.value() << ")";212 debug << ")";215 debug << ; 216 debug << ; 213 217 return debug.space(); 214 218 } … … 222 226 #endif 223 227 { 224 debug.nospace() << "QPair(" << pair.first << "," << pair.second << ")";228 debug.nospace() << "QPair(" << pair.first << ; 225 229 return debug.space(); 226 230 } … … 231 235 debug.nospace() << "QSet"; 232 236 return operator<<(debug, set.toList()); 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 233 255 } 234 256
Note:
See TracChangeset
for help on using the changeset viewer.