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
44 //
55 // Created by Heather Anderson on 5/2/21.
66 // Copyright 2021 Vircadia contributors.
7+// Copyright 2023 Overte e.V.
78 //
89 // Distributed under the Apache License, Version 2.0.
910 // See the accompanying file LICENSE or http://www.apache.org/licenses/LICENSE-2.0.html
@@ -22,32 +23,93 @@ class ScriptSyntaxCheckResult; · 12 unmodified lines
2223 using ScriptProgramPointer = std::shared_ptr<ScriptProgram>;
2324 using ScriptSyntaxCheckResultPointer = std::shared_ptr<ScriptSyntaxCheckResult>;
2425
25−/// [ScriptInterface] Provides an engine-independent interface for QScriptProgram
26+/**
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+ */
2634 class ScriptProgram {
2735 public:
2836 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+ */
2943 virtual QString fileName() const = 0;
44+
45+ /**
46+ * @brief Returns the source code of this program.
47+ *
48+ * @return QString
49+ */
3050 virtual QString sourceCode() const = 0;
3151
3252 protected:
3353 ~ScriptProgram() {} // prevent explicit deletion of base class
3454 };
3555
36−/// [ScriptInterface] Provides an engine-independent interface for QScriptSyntaxCheckResult
56+
57+/**
58+ * @brief Engine-independent representation of a script syntax check
59+ *
60+ * This is an analog of QScriptSyntaxCheckResult from Qt5.
61+ *
62+ *
63+ */
3764 class ScriptSyntaxCheckResult {
3865 public:
66+
67+ /**
68+ * @brief State of the syntax check
69+ *
70+ */
3971 enum State
4072 {
41− Error = 0,
42− Intermediate = 1,
43− Valid = 2
73+ Error = 0, /** The program contains a syntax error. */
74+ Intermediate = 1, /** The program is incomplete. */
75+ Valid = 2 /** The program is a syntactically correct program. */
4476 };
4577
4678 public:
79+
80+ /**
81+ * @brief Returns the error column number of this ScriptSyntaxCheckResult, or -1 if there is no error.
82+ *
83+ * @return int
84+ */
4785 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+ */
4892 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+ */
4999 virtual QString errorMessage() const = 0;
100+
101+ /**
102+ * @brief
103+ *
104+ * @return QString
105+ */
50106 virtual QString errorBacktrace() const = 0;
107+
108+ /**
109+ * @brief Returns the state of this ScriptSyntaxCheckResult.
110+ *
111+ * @return State
112+ */
51113 virtual State state() const = 0;
52114
53115 protected: