This is an example of how to use the inheriters of the KDSME::AbstractExporter class.
#include "config-examples.h"
#include <state.h>
#include <qmlexporter.h>
#include <scxmlexporter.h>
#include <QTextStream>
int main()
{
QTextStream qErr(stderr);
QTextStream qOut(stdout);
machine.
setLabel(
"root");
s1.setLabel("s1");
s2.setLabel("s2");
s1.
addSignalTransition(&s2);
QByteArray qmlOutput;
qErr <<
"Failed to export to QML:" << qmlExporter.
errorString();
return 1;
}
qOut << "=== Output [QML] ===" << endl;
qOut << qmlOutput << endl;
qOut << endl;
QByteArray scxmlOutput;
qErr <<
"Failed to export to SCXML:" << scxmlExporter.
errorString();
return 1;
}
qOut << "=== Output [SCXML] ===" << endl;
qOut << scxmlOutput << endl;
qOut << endl;
}