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

Function standardise_directory_separator

renderdoc/strings/string_utils.cpp:149–170  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

147}
148
149rdcstr standardise_directory_separator(const rdcstr &path)
150{
151 // Replace '\' -> '/'
152 // Replace '//' -> '/'
153 rdcstr ret;
154 ret.reserve(path.size());
155 int slashCount = 0;
156 for(size_t i = 0; i < path.size(); ++i)
157 {
158 char c = path[i];
159 if(c == '\\')
160 c = '/';
161
162 if(c == '/')
163 slashCount++;
164 else
165 slashCount = 0;
166 if(slashCount < 2)
167 ret.push_back(c);
168 }
169 return ret;
170}
171
172void strip_nonbasic(rdcstr &str)
173{

Callers 4

string_utils.cppFile · 0.85
BuildReflectionMethod · 0.85
GetLineInfoMethod · 0.85

Calls 3

reserveMethod · 0.45
sizeMethod · 0.45
push_backMethod · 0.45

Tested by

no test coverage detected