MCPcopy Create free account
hub / github.com/Singular/Singular / BaseName

Function BaseName

ppcc/adlib/os.cc:345–352  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

343}
344
345Str *BaseName(Str *path) {
346 Int pos = path->rfind(PathSeparator);
347 if (pos == NOWHERE) {
348 return path->clone();
349 } else {
350 return path->range_excl(pos+1, path->len());
351 }
352}
353
354Str *FileExtension(Str *path) {
355 Int slash = path->rfind(PathSeparator);

Callers 1

MainFunction · 0.85

Calls 4

rfindMethod · 0.80
cloneMethod · 0.45
range_exclMethod · 0.45
lenMethod · 0.45

Tested by 1

MainFunction · 0.68