QScxmlCompiler 類

The QScxmlCompiler class is a compiler for SCXML files. 更多...

頭: #include <QScxmlCompiler>
qmake: QT += scxml
Since: Qt 5.7

公共類型

class Loader

公共函數

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

詳細描述

The QScxmlCompiler class is a compiler for SCXML files.

剖析 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 .

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.

QVector < QScxmlError > QScxmlCompiler:: errors () const

返迴剖析錯誤的列錶。

QString QScxmlCompiler:: fileName () const

Returns the file name associated with the current input.

另請參閱 setFileName ().

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 ( Loader * newLoader )

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

另請參閱 loader ().