MCPcopy Create free account
hub / github.com/ChiyukiGana/Quickinput / setSavedVariable

Method setSavedVariable

source/src/scriptinterpreter.h:1122–1139  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1120 return {};
1121 }
1122 static void setSavedVariable(const std::string name, const QiVar& value)
1123 {
1124 typepack::value v;
1125 switch (value.type())
1126 {
1127 case QiVar::t_bool: v = value.toBool(); break;
1128 case QiVar::t_int: v = value.toInteger(); break;
1129 case QiVar::t_num: v = value.toNumber(); break;
1130 case QiVar::t_str: v = value.toString(); break;
1131 }
1132 if (v.isNull()) return;
1133 {
1134 std::unique_lock<std::mutex> lock(savedVariables_Mutex);
1135 savedVariables_Save = true;
1136 savedVariables[name] = std::move(v);
1137 }
1138 savedVariables_Condition.notify_all();
1139 }
1140
1141 void clearLocals()
1142 {

Callers 1

execMethod · 0.80

Calls 6

toIntegerMethod · 0.80
typeMethod · 0.45
toBoolMethod · 0.45
toNumberMethod · 0.45
toStringMethod · 0.45
isNullMethod · 0.45

Tested by

no test coverage detected