MCPcopy Create free account
hub / github.com/TypesettingTools/Aegisub / CreateFromFile

Method CreateFromFile

src/auto4_base.cpp:448–465  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

446 }
447
448 std::unique_ptr<Script> ScriptFactory::CreateFromFile(agi::fs::path const& filename, bool complain_about_unrecognised, bool create_unknown)
449 {
450 for (auto& factory : Factories()) {
451 auto s = factory->Produce(filename);
452 if (s) {
453 if (!s->GetLoadedState()) {
454 wxLogError(_("Failed to load Automation script '%s':\n%s"), filename.wstring(), s->GetDescription());
455 }
456 return s;
457 }
458 }
459
460 if (complain_about_unrecognised) {
461 wxLogError(_("The file was not recognised as an Automation script: %s"), filename.wstring());
462 }
463
464 return create_unknown ? std::make_unique<UnknownScript>(filename) : nullptr;
465 }
466
467 std::vector<std::unique_ptr<ScriptFactory>>& ScriptFactory::Factories()
468 {

Callers

nothing calls this directly

Calls 3

ProduceMethod · 0.80
GetLoadedStateMethod · 0.45
GetDescriptionMethod · 0.45

Tested by

no test coverage detected