History

Added ScriptMessage class

ksuprynowicz committed 3 years ago

Commit f3dbfc41 parent ee980cb2 files · +79 −0Browse files

Showing the changes to libraries/script-engine/src/ScriptMessage.cpp (1 of 2 files). Show all

Unified · Split

libraries/script-engine/src/ScriptMessage.cpp+22−0
@@ -0,0 +1,22 @@
1+//
2+// ScriptMessage.h
3+// libraries/script-engine/src/v8/FastScriptValueUtils.cpp
4+//
5+// Created by dr Karol Suprynowicz on 2023/09/24.
6+// Copyright 2023 Overte e.V.
7+//
8+// Distributed under the Apache License, Version 2.0.
9+// See the accompanying file LICENSE or http://www.apache.org/licenses/LICENSE-2.0.html
10+//
11+
12+#include "ScriptMessage.h"
13+
14+QJsonObject ScriptMessage::toJson() {
15+ QJsonObject object;
16+ object["message"] = _messageContent;
17+ object["lineNumber"] = _lineNumber;
18+ object["fileName"] = _fileName;
19+ object["type"] = scriptTypeToString(_scriptType);
20+ object["severity"] = severityToString(_severity);
21+ return object;
22+}