| 36 | } |
| 37 | |
| 38 | std::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 | |
| 55 | std::optional<STDString> LoadExternalFile(std::string_view path, PathRootType root) |
| 56 | { |
no test coverage detected