57 json[QStringLiteral(
"language")] =
language;
68 json[QStringLiteral(
"interpreter_args")] = arr;
71 json[QStringLiteral(
"code")] =
code;
74 json[QStringLiteral(
"source_uri")] =
sourceUri;
78 json[QStringLiteral(
"code_sha256")] =
codeSha256;
82 json[QStringLiteral(
"keep_temp_file")] =
true;
93 s.
language = json.value(QStringLiteral(
"language")).toString();
94 s.
interpreter = json.value(QStringLiteral(
"interpreter")).toString();
95 s.
code = json.value(QStringLiteral(
"code")).toString();
96 s.
sourceUri = json.value(QStringLiteral(
"source_uri")).toString();
97 s.
codeSha256 = json.value(QStringLiteral(
"code_sha256")).toString();
98 s.
keepTempFile = json.value(QStringLiteral(
"keep_temp_file")).toBool(
false);
100 const QJsonArray arr = json.value(QStringLiteral(
"interpreter_args")).toArray();
101 for (
const QJsonValue& v : arr) {
113 cbor.insert(QStringLiteral(
"language"),
language);
116 cbor.insert(QStringLiteral(
"interpreter"),
interpreter);
124 cbor.insert(QStringLiteral(
"interpreter_args"), arr);
127 cbor.insert(QStringLiteral(
"code"),
code);
130 cbor.insert(QStringLiteral(
"source_uri"),
sourceUri);
134 cbor.insert(QStringLiteral(
"code_sha256"),
codeSha256);
138 cbor.insert(QStringLiteral(
"keep_temp_file"),
true);
149 s.
language = cbor.value(QStringLiteral(
"language")).toString();
150 s.
interpreter = cbor.value(QStringLiteral(
"interpreter")).toString();
151 s.
code = cbor.value(QStringLiteral(
"code")).toString();
152 s.
sourceUri = cbor.value(QStringLiteral(
"source_uri")).toString();
153 s.
codeSha256 = cbor.value(QStringLiteral(
"code_sha256")).toString();
154 s.
keepTempFile = cbor.value(QStringLiteral(
"keep_temp_file")).toBool();
156 const QCborArray arr = cbor.value(QStringLiteral(
"interpreter_args")).toArray();
157 for (
const QCborValue& v : arr) {
MnaScript struct declaration — inline code embedded in a graph node.
MNE Analysis Container Format (mna/mnx).
Inline code for script-type graph nodes.
bool keepTempFile
true → preserve temp script file after execution (debug aid)
QString code
The inline source code (resolved at save-time if sourceUri is set).
static MnaScript fromJson(const QJsonObject &json)
static MnaScript fromCbor(const QCborMap &cbor)
QString codeSha256
SHA-256 of code for integrity verification.
QString language
"python", "shell", "r", "matlab", "octave", "julia"
QJsonObject toJson() const
QStringList interpreterArgs
Extra args before the script file (e.g. ["-u"] for unbuffered Python).