| 109 | static cc_string root_path_rom = String_FromConst("rom:/"); |
| 110 | |
| 111 | void Platform_EncodePath(cc_filepath* dst, const cc_string* path) { |
| 112 | char* str = dst->buffer; |
| 113 | cc_string path_ = *path; |
| 114 | |
| 115 | if (Platform_ReadonlyFilesystem) { // read from rom root |
| 116 | int idx = String_IndexOf(path, '/'); |
| 117 | if (idx >= 0) path_ = String_UNSAFE_SubstringAt(&path_, idx + 1); |
| 118 | } |
| 119 | |
| 120 | Mem_Copy(str, root_path.buffer, root_path.length); |
| 121 | str += root_path.length; |
| 122 | String_EncodeUtf8(str, &path_); |
| 123 | } |
| 124 | |
| 125 | void Platform_DecodePath(cc_string* dst, const cc_filepath* path) { |
| 126 | const char* str = path->buffer; |
no test coverage detected