MCPcopy Create free account
hub / github.com/baldurk/renderdoc / get_lastpathsep

Function get_lastpathsep

renderdoc/strings/string_utils.cpp:77–91  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

75}
76
77static int get_lastpathsep(const rdcstr &path)
78{
79 if(path.empty())
80 return -1;
81
82 size_t offs = path.size() - 1;
83
84 while(offs > 0 && !ispathsep(path[offs]))
85 offs--;
86
87 if(offs == 0 && !ispathsep(path[0]))
88 return -1;
89
90 return (int)offs;
91}
92
93rdcstr get_basename(const rdcstr &path)
94{

Callers 3

get_basenameFunction · 0.85
get_dirnameFunction · 0.85
string_utils.cppFile · 0.85

Calls 3

ispathsepFunction · 0.85
emptyMethod · 0.45
sizeMethod · 0.45

Tested by

no test coverage detected