MCPcopy Create free account
hub / github.com/WarmUpTill/SceneSwitcher / SetupFile

Method SetupFile

plugins/scripting/utils/inline-script.cpp:358–379  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

356}
357
358void InlineScript::SetupFile()
359{
360 const auto path = GetLUACompatiblePath(_file);
361 _fileId = path;
362
363 if (path.empty()) {
364 return;
365 }
366
367 if (!QFileInfo(QString::fromStdString(path)).exists()) {
368 const auto text = preprocessScriptText(
369 _language == OBS_SCRIPT_LANG_PYTHON
370 ? _defaultPythonScript.data()
371 : _defaultLUAScript.data(),
372 _language, GetID());
373 (void)createScriptFile(_file.c_str(), text.c_str());
374 }
375
376 _script = std::unique_ptr<obs_script_t, ScriptDeleter>(
377 CreateOBSScript(path.c_str(), nullptr), {});
378 _lastPath = _file;
379}
380
381void InlineScript::SetupInline()
382{

Callers

nothing calls this directly

Calls 7

GetLUACompatiblePathFunction · 0.85
preprocessScriptTextFunction · 0.85
createScriptFileFunction · 0.85
CreateOBSScriptFunction · 0.85
emptyMethod · 0.45
dataMethod · 0.45
c_strMethod · 0.45

Tested by

no test coverage detected