| 3 | // *********************************************************************** |
| 4 | |
| 5 | bool VFSPathToRealPath(String vfsPath, String& outRealPath, Arena* pArena) { |
| 6 | StringBuilder builder(g_pArenaFrame); |
| 7 | builder.Append("system/"); |
| 8 | |
| 9 | // absolute path, so map the mount point to a real path |
| 10 | if (vfsPath[0] == '/') { |
| 11 | if (strncmp(vfsPath.pData, "/shared", 7) == 0) { |
| 12 | builder.Append(vfsPath); |
| 13 | } |
| 14 | else if (strncmp(vfsPath.pData, "/app", 4) == 0) { |
| 15 | builder.Append(Cpu::GetAppName()); |
| 16 | builder.Append(vfsPath.pData + 4); |
| 17 | } |
| 18 | else { |
| 19 | return false; |
| 20 | } |
| 21 | } |
| 22 | // relative path, so make it relative to the app's location |
| 23 | else { |
| 24 | builder.Append(Cpu::GetAppName()); |
| 25 | builder.Append("/"); |
| 26 | builder.Append(vfsPath); |
| 27 | } |
| 28 | |
| 29 | outRealPath = builder.CreateString(pArena); |
| 30 | return true; |
| 31 | } |
| 32 | |
| 33 | // *********************************************************************** |
| 34 |
no test coverage detected