MCPcopy Create free account
hub / github.com/Norbyte/bg3se / GetPathForExternalIo

Function GetPathForExternalIo

BG3Extender/Extender/Shared/ScriptHelpers.cpp:38–53  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

36}
37
38std::optional<STDWString> GetPathForExternalIo(std::string_view scriptPath, PathRootType root)
39{
40 STDString path(scriptPath);
41
42 if (!IsSafeRelativePath(path)) {
43 return {};
44 }
45
46 auto storageRoot = GetStaticSymbols().ToPath("/Script Extender", root);
47 if (storageRoot.empty()) {
48 OsiErrorS("Could not fetch game storage path");
49 return {};
50 }
51
52 return FromUTF8(storageRoot + "/" + path);
53}
54
55std::optional<STDString> LoadExternalFile(std::string_view path, PathRootType root)
56{

Callers 2

LoadExternalFileFunction · 0.85
SaveExternalFileFunction · 0.85

Calls 4

IsSafeRelativePathFunction · 0.85
ToPathMethod · 0.80
FromUTF8Function · 0.50
emptyMethod · 0.45

Tested by

no test coverage detected