1// Copyright (C) 2016 The Qt Company Ltd.
2// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only
3
4#ifndef QQMLINFO_H
5#define QQMLINFO_H
6
7#include <QtQml/qtqmlglobal.h>
8#include <QtCore/qdebug.h>
9#include <QtCore/qurl.h>
10#include <QtQml/qqmlerror.h>
11
12QT_BEGIN_NAMESPACE
13
14class QQmlInfo;
15
16Q_QML_EXPORT QQmlInfo qmlDebug(const QObject *me);
17Q_QML_EXPORT QQmlInfo qmlDebug(const QObject *me, const QQmlError &error);
18Q_QML_EXPORT QQmlInfo qmlDebug(const QObject *me, const QList<QQmlError> &errors);
19
20Q_QML_EXPORT QQmlInfo qmlInfo(const QObject *me);
21Q_QML_EXPORT QQmlInfo qmlInfo(const QObject *me, const QQmlError &error);
22Q_QML_EXPORT QQmlInfo qmlInfo(const QObject *me, const QList<QQmlError> &errors);
23
24Q_QML_EXPORT QQmlInfo qmlWarning(const QObject *me);
25Q_QML_EXPORT QQmlInfo qmlWarning(const QObject *me, const QQmlError &error);
26Q_QML_EXPORT QQmlInfo qmlWarning(const QObject *me, const QList<QQmlError> &errors);
27
28class QQmlInfoPrivate;
29class Q_QML_EXPORT QQmlInfo : public QDebug
30{
31public:
32 QQmlInfo(const QQmlInfo &);
33 ~QQmlInfo();
34
35 inline QQmlInfo &operator<<(QChar t) { QDebug::operator<<(t); return *this; }
36 inline QQmlInfo &operator<<(bool t) { QDebug::operator<<(t); return *this; }
37 inline QQmlInfo &operator<<(char t) { QDebug::operator<<(t); return *this; }
38 inline QQmlInfo &operator<<(signed short t) { QDebug::operator<<(t); return *this; }
39 inline QQmlInfo &operator<<(unsigned short t) { QDebug::operator<<(t); return *this; }
40 inline QQmlInfo &operator<<(signed int t) { QDebug::operator<<(t); return *this; }
41 inline QQmlInfo &operator<<(unsigned int t) { QDebug::operator<<(t); return *this; }
42 inline QQmlInfo &operator<<(signed long t) { QDebug::operator<<(t); return *this; }
43 inline QQmlInfo &operator<<(unsigned long t) { QDebug::operator<<(t); return *this; }
44 inline QQmlInfo &operator<<(qint64 t) { QDebug::operator<<(t); return *this; }
45 inline QQmlInfo &operator<<(quint64 t) { QDebug::operator<<(t); return *this; }
46 inline QQmlInfo &operator<<(float t) { QDebug::operator<<(t); return *this; }
47 inline QQmlInfo &operator<<(double t) { QDebug::operator<<(t); return *this; }
48 inline QQmlInfo &operator<<(const char* t) { QDebug::operator<<(t); return *this; }
49 inline QQmlInfo &operator<<(const QString & t) { QDebug::operator<<(t: t.toLocal8Bit().constData()); return *this; }
50 inline QQmlInfo &operator<<(QStringView t) { return operator<<(t: t.toString()); }
51 inline QQmlInfo &operator<<(const QLatin1String &t) { QDebug::operator<<(t: t.latin1()); return *this; }
52 inline QQmlInfo &operator<<(const QByteArray & t) { QDebug::operator<<(t); return *this; }
53 inline QQmlInfo &operator<<(const void * t) { QDebug::operator<<(t); return *this; }
54 inline QQmlInfo &operator<<(QTextStreamFunction f) { QDebug::operator<<(f); return *this; }
55 inline QQmlInfo &operator<<(QTextStreamManipulator m) { QDebug::operator<<(m); return *this; }
56#ifndef QT_NO_DEBUG_STREAM
57 inline QQmlInfo &operator<<(const QUrl &t) { static_cast<QDebug &>(*this) << t; return *this; }
58#endif
59
60private:
61 friend Q_QML_EXPORT QQmlInfo qmlDebug(const QObject *me);
62 friend Q_QML_EXPORT QQmlInfo qmlDebug(const QObject *me, const QQmlError &error);
63 friend Q_QML_EXPORT QQmlInfo qmlDebug(const QObject *me, const QList<QQmlError> &errors);
64 friend Q_QML_EXPORT QQmlInfo qmlInfo(const QObject *me);
65 friend Q_QML_EXPORT QQmlInfo qmlInfo(const QObject *me, const QQmlError &error);
66 friend Q_QML_EXPORT QQmlInfo qmlInfo(const QObject *me, const QList<QQmlError> &errors);
67 friend Q_QML_EXPORT QQmlInfo qmlWarning(const QObject *me);
68 friend Q_QML_EXPORT QQmlInfo qmlWarning(const QObject *me, const QQmlError &error);
69 friend Q_QML_EXPORT QQmlInfo qmlWarning(const QObject *me, const QList<QQmlError> &errors);
70
71 QQmlInfo(QQmlInfoPrivate *);
72 QQmlInfoPrivate *d;
73};
74
75QT_END_NAMESPACE
76
77#endif // QQMLINFO_H
78

source code of qtdeclarative/src/qml/qml/qqmlinfo.h