QScxmlCompiler 类

QScxmlCompiler 类是用于 SCXML 文件的编译器。 更多...

头: #include <QScxmlCompiler>
CMake: find_package(Qt6 REQUIRED COMPONENTS Scxml)
target_link_libraries(mytarget PRIVATE Qt6::Scxml)
qmake: QT += scxml

公共类型

class Loader

公共函数

QScxmlCompiler (QXmlStreamReader * reader )
~QScxmlCompiler ()
QScxmlStateMachine * compile ()
QList<QScxmlError> errors () const
QString fileName () const
QScxmlCompiler::Loader * loader () const
void setFileName (const QString & fileName )
void setLoader (QScxmlCompiler::Loader * newLoader )

详细描述

剖析 SCXML file and dynamically instantiates a state machine for a successfully parsed SCXML file. If parsing fails, the new state machine cannot start. All errors are returned by QScxmlStateMachine::parseErrors ().

要加载 SCXML 文件, QScxmlStateMachine::fromFile or QScxmlStateMachine::fromData should be used. Using QScxmlCompiler directly is only needed when the compiler needs to use a custom QScxmlCompiler::Loader .

成员函数文档编制

QScxmlCompiler:: QScxmlCompiler ( QXmlStreamReader * reader )

创建新的 SCXML 编译器为指定 reader .

[noexcept] QScxmlCompiler:: ~QScxmlCompiler ()

销毁 SCXML 编译器。

QScxmlStateMachine *QScxmlCompiler:: compile ()

Parses an SCXML file and creates a new state machine from it.

If parsing is successful, the returned state machine can be initialized and started. If parsing fails, QScxmlStateMachine::parseErrors () can be used to retrieve a list of errors.

QList < QScxmlError > QScxmlCompiler:: errors () const

返回剖析错误的列表。

QString QScxmlCompiler:: fileName () const

Returns the file name associated with the current input.

另请参阅 setFileName ().

QScxmlCompiler::Loader *QScxmlCompiler:: loader () const

Returns the loader that is currently used to resolve and load URIs for the SCXML compiler.

另请参阅 setLoader ().

void QScxmlCompiler:: setFileName (const QString & fileName )

Sets the file name for the current input to fileName .

The file name is used for error reporting and for resolving relative path URIs.

另请参阅 fileName ().

void QScxmlCompiler:: setLoader ( QScxmlCompiler::Loader * newLoader )

设置 newLoader to be used for resolving and loading URIs for the SCXML compiler.

另请参阅 loader ().