| 147 | } |
| 148 | |
| 149 | rdcstr 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 | |
| 172 | void strip_nonbasic(rdcstr &str) |
| 173 | { |
no test coverage detected