MCPcopy Create free account
hub / github.com/beefytech/Beef / FixPath

Method FixPath

BeefySysLib/Common.cpp:1226–1249  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1224}
1225
1226String Beefy::FixPath(const StringImpl& pathIn)
1227{
1228 String path = pathIn;
1229
1230 for (int i = 0; i < (int)path.length(); i++)
1231 {
1232 if (path[i] == DIR_SEP_CHAR_ALT)
1233 path[i] = DIR_SEP_CHAR;
1234 if ((i > 0) && (path[i - 1] == '.') && (path[i] == '.'))
1235 {
1236 for (int checkIdx = i - 3; checkIdx >= 0; checkIdx--)
1237 {
1238 if ((path[checkIdx] == '\\') || (path[checkIdx] == '/'))
1239 {
1240 path = path.Substring(0, checkIdx) + path.Substring(i + 1);
1241 i = checkIdx;
1242 break;
1243 }
1244 }
1245 }
1246 }
1247
1248 return path;
1249}
1250
1251String Beefy::FixPathAndCase(const StringImpl& pathIn)
1252{

Callers

nothing calls this directly

Calls 2

SubstringMethod · 0.80
lengthMethod · 0.45

Tested by

no test coverage detected