aboutsummaryrefslogtreecommitdiffstats
path: root/src/plugins/qmlprofiler/qmleventtype.cpp
diff options
context:
space:
mode:
authorUlf Hermann <ulf.hermann@qt.io>2016-05-04 18:55:44 +0200
committerUlf Hermann <ulf.hermann@qt.io>2016-05-10 16:44:58 +0000
commitca5d9659e19a92ed15fe5b839f1989152f87d18b (patch)
tree116c395ac4041f69d8bfb134d30769a2197ad597 /src/plugins/qmlprofiler/qmleventtype.cpp
parent943fc80f515b5f5e1d1751ae5a3179477261d9fc (diff)
QmlProfiler: Provide stream operators for QmlEventType and QmlNote
This is the foundation for a new file format. Change-Id: Ib5ae5bfe8b45d9dc654b443ab700186993c3bfc9 Reviewed-by: Christian Kandeler <christian.kandeler@theqtcompany.com>
Diffstat (limited to 'src/plugins/qmlprofiler/qmleventtype.cpp')
-rw-r--r--src/plugins/qmlprofiler/qmleventtype.cpp50
1 files changed, 50 insertions, 0 deletions
diff --git a/src/plugins/qmlprofiler/qmleventtype.cpp b/src/plugins/qmlprofiler/qmleventtype.cpp
new file mode 100644
index 00000000000..3d32b1343f1
--- /dev/null
+++ b/src/plugins/qmlprofiler/qmleventtype.cpp
@@ -0,0 +1,50 @@
+/****************************************************************************
+**
+** Copyright (C) 2016 The Qt Company Ltd.
+** Contact: https://www.qt.io/licensing/
+**
+** This file is part of Qt Creator.
+**
+** Commercial License Usage
+** Licensees holding valid commercial Qt licenses may use this file in
+** accordance with the commercial license agreement provided with the
+** Software or, alternatively, in accordance with the terms contained in
+** a written agreement between you and The Qt Company. For licensing terms
+** and conditions see https://www.qt.io/terms-conditions. For further
+** information use the contact form at https://www.qt.io/contact-us.
+**
+** GNU General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU
+** General Public License version 3 as published by the Free Software
+** Foundation with exceptions as appearing in the file LICENSE.GPL3-EXCEPT
+** included in the packaging of this file. Please review the following
+** information to ensure the GNU General Public License requirements will
+** be met: https://www.gnu.org/licenses/gpl-3.0.html.
+**
+****************************************************************************/
+
+#include "qmleventtype.h"
+#include <QDataStream>
+
+namespace QmlProfiler {
+
+QDataStream &operator>>(QDataStream &stream, QmlEventType &type)
+{
+ quint8 message;
+ quint8 rangeType;
+ stream >> type.displayName >> type.data >> type.location >> message >> rangeType
+ >> type.detailType;
+ type.message = static_cast<Message>(message);
+ type.rangeType = static_cast<RangeType>(rangeType);
+ return stream;
+}
+
+QDataStream &operator<<(QDataStream &stream, const QmlEventType &type)
+{
+ return stream << type.displayName << type.data << type.location
+ << static_cast<quint8>(type.message) << static_cast<quint8>(type.rangeType)
+ << type.detailType;
+}
+
+
+} // namespace QmlProfiler