MCPcopy Create free account
hub / github.com/ClassiCube/ClassiCube / Platform_EncodePath

Function Platform_EncodePath

src/Platform_N64.c:111–123  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

109static cc_string root_path_rom = String_FromConst("rom:/");
110
111void 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
125void Platform_DecodePath(cc_string* dst, const cc_filepath* path) {
126 const char* str = path->buffer;

Callers 15

ZipFile_InspectEntriesFunction · 0.70
ZipFile_CreateFunction · 0.70
Logger_LogFunction · 0.70
Stream_OpenFileFunction · 0.70
Stream_CreateFileFunction · 0.70
Stream_WriteAllToFunction · 0.70
Directory_EnumFunction · 0.70
UseDedicatedCacheFunction · 0.70
IsCachedFunction · 0.70
OpenCachedDataFunction · 0.70

Calls 3

Mem_CopyFunction · 0.85
String_EncodeUtf8Function · 0.85

Tested by

no test coverage detected