History

Add more Doxygen docs

Doesn't work right in ScriptManager, looks like a conflict with JSDoc

Dale Glass committed 3 years ago

Commit e35aa801 parent 887ebd55 files · +265 −30Browse files

Showing the changes to libraries/script-engine/src/ScriptProgram.h (1 of 5 files). Show all

Unified · Split

libraries/script-engine/src/ScriptProgram.h+67−5
@@ -4,6 +4,7 @@ · 3 unmodified lines
4//4//
5// Created by Heather Anderson on 5/2/21.5// Created by Heather Anderson on 5/2/21.
6// Copyright 2021 Vircadia contributors.6// Copyright 2021 Vircadia contributors.
7// Copyright 2023 Overte e.V.
7//8//
8// Distributed under the Apache License, Version 2.0.9// Distributed under the Apache License, Version 2.0.
9// See the accompanying file LICENSE or http://www.apache.org/licenses/LICENSE-2.0.html10// See the accompanying file LICENSE or http://www.apache.org/licenses/LICENSE-2.0.html
@@ -22,32 +23,93 @@ class ScriptSyntaxCheckResult; · 12 unmodified lines
22using ScriptProgramPointer = std::shared_ptr<ScriptProgram>;23using ScriptProgramPointer = std::shared_ptr<ScriptProgram>;
23using ScriptSyntaxCheckResultPointer = std::shared_ptr<ScriptSyntaxCheckResult>;24using ScriptSyntaxCheckResultPointer = std::shared_ptr<ScriptSyntaxCheckResult>;
24 25
25/// [ScriptInterface] Provides an engine-independent interface for QScriptProgram26/**
27 * @brief Engine-independent representation of a script program
28 *
29 * This is an analog of QScriptProgram from Qt5.
30 *
31 * It's used to pre-compile scripts, and to check their syntax.
32 *
33 */
26class ScriptProgram {34class ScriptProgram {
27public:35public:
28 virtual ScriptSyntaxCheckResultPointer checkSyntax() = 0; //It cannot be const anymore because V8 doesn't have separate syntax checking function36 virtual ScriptSyntaxCheckResultPointer checkSyntax() = 0; //It cannot be const anymore because V8 doesn't have separate syntax checking function
37
38 /**
39 * @brief Returns the filename associated with this program.
40 *
41 * @return QString
42 */
29 virtual QString fileName() const = 0;43 virtual QString fileName() const = 0;
44
45 /**
46 * @brief Returns the source code of this program.
47 *
48 * @return QString
49 */
30 virtual QString sourceCode() const = 0;50 virtual QString sourceCode() const = 0;
31 51
32protected:52protected:
33 ~ScriptProgram() {} // prevent explicit deletion of base class53 ~ScriptProgram() {} // prevent explicit deletion of base class
34};54};
35 55
36/// [ScriptInterface] Provides an engine-independent interface for QScriptSyntaxCheckResult56
57/**
58 * @brief Engine-independent representation of a script syntax check
59 *
60 * This is an analog of QScriptSyntaxCheckResult from Qt5.
61 *
62 *
63 */
37class ScriptSyntaxCheckResult {64class ScriptSyntaxCheckResult {
38public:65public:
66
67 /**
68 * @brief State of the syntax check
69 *
70 */
39 enum State71 enum State
40 {72 {
41 Error = 0,73 Error = 0, /** The program contains a syntax error. */
42 Intermediate = 1,74 Intermediate = 1, /** The program is incomplete. */
43 Valid = 275 Valid = 2 /** The program is a syntactically correct program. */
44 };76 };
45 77
46public:78public:
79
80 /**
81 * @brief Returns the error column number of this ScriptSyntaxCheckResult, or -1 if there is no error.
82 *
83 * @return int
84 */
47 virtual int errorColumnNumber() const = 0;85 virtual int errorColumnNumber() const = 0;
86
87 /**
88 * @brief Returns the error line number of this ScriptSyntaxCheckResult, or -1 if there is no error.
89 *
90 * @return int
91 */
48 virtual int errorLineNumber() const = 0;92 virtual int errorLineNumber() const = 0;
93
94 /**
95 * @brief Returns the error message of this ScriptSyntaxCheckResult, or an empty string if there is no error.
96 *
97 * @return QString
98 */
49 virtual QString errorMessage() const = 0;99 virtual QString errorMessage() const = 0;
100
101 /**
102 * @brief
103 *
104 * @return QString
105 */
50 virtual QString errorBacktrace() const = 0;106 virtual QString errorBacktrace() const = 0;
107
108 /**
109 * @brief Returns the state of this ScriptSyntaxCheckResult.
110 *
111 * @return State
112 */
51 virtual State state() const = 0;113 virtual State state() const = 0;
52 114
53protected:115protected: