MCPcopy Create free account
hub / github.com/davisking/dlib / strip_path

Function strip_path

tools/imglab/src/common.cpp:10–26  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

8// ----------------------------------------------------------------------------------------
9
10std::string strip_path (
11 const std::string& str,
12 const std::string& prefix
13)
14{
15 unsigned long i;
16 for (i = 0; i < str.size() && i < prefix.size(); ++i)
17 {
18 if (str[i] != prefix[i])
19 return str;
20 }
21
22 if (i < str.size() && (str[i] == '/' || str[i] == '\\'))
23 ++i;
24
25 return str.substr(i);
26}
27
28// ----------------------------------------------------------------------------------------
29

Callers 3

convert_pascal_v1Function · 0.85
convert_pascal_xmlFunction · 0.85
create_new_datasetFunction · 0.85

Calls 1

sizeMethod · 0.45

Tested by

no test coverage detected