Yayin Story Studio logo Yayin Story Studio 项目文档
回到主页 用户手册

ASERStudio::AStorySyntax::AStoryXDiagnosticData Class

class ASERStudio::AStorySyntax::AStoryXDiagnosticData

AStoryXDiagnosticData记录AStoryX的诊断信息. 详情...

头文件: #include <AStoryXDiagnosticData>
自以下版本: ASERStudio 2.0

公开类型

enum DiagnosticType { Undefined, UnknownError, RuleNotSelected, NoSuchRule, NoSuchController, …, NoSuchResource }

公开成员函数

(自 ASERStudio 2.0 引入) AStoryXDiagnosticData()
(自 ASERStudio 2.0 引入) AStoryXDiagnosticData(const QString &message, qint32 line, qint32 column, ASERStudio::AStorySyntax::AStoryXDiagnosticData::DiagnosticType type = DiagnosticType::Undefined, const QString &fixAdvice = "")
(自 ASERStudio 2.0 引入) AStoryXDiagnosticData(const ASERStudio::AStorySyntax::AStoryXDiagnosticData &other)
(自 ASERStudio 2.0 引入) AStoryXDiagnosticData(ASERStudio::AStorySyntax::AStoryXDiagnosticData &&other)
(自 ASERStudio 2.0 引入) ~AStoryXDiagnosticData()
(自 ASERStudio 2.0 引入) qint32 getColumn() const
(自 ASERStudio 2.0 引入) QString getFixAdvice() const
(自 ASERStudio 2.0 引入) qint32 getLine() const
(自 ASERStudio 2.0 引入) QString getMessage() const
(自 ASERStudio 2.0 引入) ASERStudio::AStorySyntax::AStoryXDiagnosticData::DiagnosticType getType() const
(自 ASERStudio 2.0 引入) QString toString()
(自 ASERStudio 2.0 引入) ASERStudio::AStorySyntax::AStoryXDiagnosticData &operator=(ASERStudio::AStorySyntax::AStoryXDiagnosticData &&other)
(自 ASERStudio 2.0 引入) ASERStudio::AStorySyntax::AStoryXDiagnosticData &operator=(const ASERStudio::AStorySyntax::AStoryXDiagnosticData &other)
(自 ASERStudio 2.0 引入) bool operator==(const ASERStudio::AStorySyntax::AStoryXDiagnosticData &other) const

详细说明

这个类是由AStoryXController解析AStoryX时得到的诊断信息的载体。它包含了诊断消息、位置、类型和修复建议等信息。

这个类是只读的,一旦创建它,就不能再更改。

成员类型文档

enum AStoryXDiagnosticData::DiagnosticType

ConstantValueDescription
ASERStudio::AStorySyntax::AStoryXDiagnosticData::Undefined0x0000未定义的错误类型
ASERStudio::AStorySyntax::AStoryXDiagnosticData::UnknownError0x1000未知错误
ASERStudio::AStorySyntax::AStoryXDiagnosticData::RuleNotSelected0x1001没有选择任何规则
ASERStudio::AStorySyntax::AStoryXDiagnosticData::NoSuchRule0x1002没有这样的规则
ASERStudio::AStorySyntax::AStoryXDiagnosticData::NoSuchController0x1003没有这样的控制器
ASERStudio::AStorySyntax::AStoryXDiagnosticData::MissingRequiredParameter0x1004缺少必选参数
ASERStudio::AStorySyntax::AStoryXDiagnosticData::ParameterTypeMismatch0x1005参数类型不匹配
ASERStudio::AStorySyntax::AStoryXDiagnosticData::ParameterOutOfRange0x1006参数值超出范围
ASERStudio::AStorySyntax::AStoryXDiagnosticData::ParameterFormatError0x1007参数格式错误
ASERStudio::AStorySyntax::AStoryXDiagnosticData::UnexpectedParameter0x1008出现了意外的参数
ASERStudio::AStorySyntax::AStoryXDiagnosticData::UnclosedSymbol0x1009未闭合的符号,它泛指一切应该成对出现的符号(甚至包括XML标签)
ASERStudio::AStorySyntax::AStoryXDiagnosticData::VariableNotDefined0x100a变量未定义
ASERStudio::AStorySyntax::AStoryXDiagnosticData::UseTabInsteadSpace0x100b使用了空格但应该使用制表符
ASERStudio::AStorySyntax::AStoryXDiagnosticData::UseSpaceInsteadTab0x100c使用了制表符但应该使用空格
ASERStudio::AStorySyntax::AStoryXDiagnosticData::UseEnglishPunctuation0x100d使用了中文标点但应该使用英文标点
ASERStudio::AStorySyntax::AStoryXDiagnosticData::UseChinesePunctuation0x100e使用了英文标点但应该使用中文标点
ASERStudio::AStorySyntax::AStoryXDiagnosticData::NoSuchBlock0x100f找不到代码块
ASERStudio::AStorySyntax::AStoryXDiagnosticData::BlockNameConflict0x1010代码块名称冲突
ASERStudio::AStorySyntax::AStoryXDiagnosticData::InstrumentRedundant0x1011冗余的指令(重定义)
ASERStudio::AStorySyntax::AStoryXDiagnosticData::NoSuchPreprocessor0x1012没有这样的处理器
ASERStudio::AStorySyntax::AStoryXDiagnosticData::ParameterRepeated0x1013参数重定义
ASERStudio::AStorySyntax::AStoryXDiagnosticData::UnknownWarning0x2000未知警告
ASERStudio::AStorySyntax::AStoryXDiagnosticData::NoSuchResource0x2001没有这样的资源

UnknownError开始的错误类型均为可能导致AStoryX根本无法运行的错误, 而UnknownWarning开始的错误类型则是不影响运行但可能导致AStoryX行为不符合预期的警告。 由于ASE-Remake的控制器识别逻辑里,会将所有匹配不到的控制器都默认视作 Dialog控制器,因此实际上NoSuchController暂时是不会出现的,但为了完整性和未来可能的变化,还是保留了这个错误类型。

成员函数文档

[since ASERStudio 2.0] AStoryXDiagnosticData::AStoryXDiagnosticData()

默认构造函数,创建一个未定义的诊断信息。

这个function 从 ASERStudio 2.0 开始支持。

[since ASERStudio 2.0] AStoryXDiagnosticData::AStoryXDiagnosticData(const QString &message, qint32 line, qint32 column, ASERStudio::AStorySyntax::AStoryXDiagnosticData::DiagnosticType type = DiagnosticType::Undefined, const QString &fixAdvice = "")

构造函数。 message 诊断消息 line 诊断位置的行号 column 诊断位置的列号 type 诊断类型,默认为Undefined fixAdvice 修复建议,默认为空字符串

这个function 从 ASERStudio 2.0 开始支持。

[since ASERStudio 2.0] AStoryXDiagnosticData::AStoryXDiagnosticData(const ASERStudio::AStorySyntax::AStoryXDiagnosticData &other)

other 另一个AStoryXDiagnosticData实例

复制构造函数。

这个function 从 ASERStudio 2.0 开始支持。

[noexcept, since ASERStudio 2.0] AStoryXDiagnosticData::AStoryXDiagnosticData(ASERStudio::AStorySyntax::AStoryXDiagnosticData &&other)

other 另一个AStoryXDiagnosticData实例

移动构造函数。

这个function 从 ASERStudio 2.0 开始支持。

[noexcept, since ASERStudio 2.0] AStoryXDiagnosticData::~AStoryXDiagnosticData()

析构函数。

这个function 从 ASERStudio 2.0 开始支持。

[since ASERStudio 2.0] qint32 AStoryXDiagnosticData::getColumn() const

return 诊断位置的列号。

这个function 从 ASERStudio 2.0 开始支持。

[since ASERStudio 2.0] QString AStoryXDiagnosticData::getFixAdvice() const

return 修复建议。

这个function 从 ASERStudio 2.0 开始支持。

[since ASERStudio 2.0] qint32 AStoryXDiagnosticData::getLine() const

return 诊断位置的行号。

这个function 从 ASERStudio 2.0 开始支持。

[since ASERStudio 2.0] QString AStoryXDiagnosticData::getMessage() const

return 诊断消息。

这个function 从 ASERStudio 2.0 开始支持。

[since ASERStudio 2.0] ASERStudio::AStorySyntax::AStoryXDiagnosticData::DiagnosticType AStoryXDiagnosticData::getType() const

return 诊断类型。

这个function 从 ASERStudio 2.0 开始支持。

[since ASERStudio 2.0] QString AStoryXDiagnosticData::toString()

return 诊断信息的字符串表示形式,主要用于调试和日志记录等目的。通常会包含诊断类型、位置和消息等内容。

这个function 从 ASERStudio 2.0 开始支持。

[noexcept, since ASERStudio 2.0] ASERStudio::AStorySyntax::AStoryXDiagnosticData &AStoryXDiagnosticData::operator=(ASERStudio::AStorySyntax::AStoryXDiagnosticData &&other)

other 另一个AStoryXDiagnosticData实例 移动赋值运算符。

这个function 从 ASERStudio 2.0 开始支持。

[since ASERStudio 2.0] ASERStudio::AStorySyntax::AStoryXDiagnosticData &AStoryXDiagnosticData::operator=(const ASERStudio::AStorySyntax::AStoryXDiagnosticData &other)

other 另一个AStoryXDiagnosticData实例

复制赋值运算符。

这个function 从 ASERStudio 2.0 开始支持。

[since ASERStudio 2.0] bool AStoryXDiagnosticData::operator==(const ASERStudio::AStorySyntax::AStoryXDiagnosticData &other) const

other 另一个AStoryXDiagnosticData实例

return 两个AStoryXDiagnosticData是否相等。

相等的条件是它们的位置、类型都相同。消息和修复建议不在考虑范围内。

这个function 从 ASERStudio 2.0 开始支持。