MCPcopy Create free account
hub / github.com/crownengine/crown / parent_dir

Function parent_dir

src/core/filesystem/path.cpp:215–231  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

213 }
214
215 StringView parent_dir(const char *path)
216 {
217 const char *ls = strrchr(path, PATH_SEPARATOR);
218
219 if (!ls)
220 return { NULL, 0 };
221
222#if CROWN_PLATFORM_WINDOWS
223 if (ls == path + 2 && path[1] == ':')
224 return { path, 3 };
225#else
226 if (ls == path)
227 return { path, 1 };
228#endif
229
230 return { path, u32(ls - path) };
231 }
232
233 bool is_valid_basename(const char *basename)
234 {

Callers 4

main_internalFunction · 0.85
test_pathFunction · 0.85
main_loopMethod · 0.85
listenMethod · 0.85

Calls

no outgoing calls

Tested by 1

test_pathFunction · 0.68