MCPcopy Create free account
hub / github.com/dirkvranckaert/AndroidDecompiler / isPathExclued

Method isPathExclued

astyle/src/astyle_main.cpp:1274–1313  ·  view source on GitHub ↗

compare a path to the exclude vector used for both directories and filenames updates the g_excludeHitsVector return true if a match

Source from the content-addressed store, hash-verified

1272// updates the g_excludeHitsVector
1273// return true if a match
1274bool ASConsole::isPathExclued(const string &subPath)
1275{
1276 bool retVal = false;
1277
1278 // read the exclude vector checking for a match
1279 for (size_t i = 0; i < excludeVector.size(); i++)
1280 {
1281 string exclude = excludeVector[i];
1282
1283 if (subPath.length() < exclude.length())
1284 continue;
1285
1286 size_t compareStart = subPath.length() - exclude.length();
1287 // subPath compare must start with a directory name
1288 if (compareStart > 0)
1289 {
1290 char lastPathChar = subPath[compareStart - 1];
1291 if (lastPathChar != g_fileSeparator)
1292 continue;
1293 }
1294
1295 string compare = subPath.substr(compareStart);
1296 if (!g_isCaseSensitive)
1297 {
1298 // make it case insensitive for Windows
1299 for (size_t j = 0; j < compare.length(); j++)
1300 compare[j] = (char)tolower(compare[j]);
1301 for (size_t j = 0; j < exclude.length(); j++)
1302 exclude[j] = (char)tolower(exclude[j]);
1303 }
1304 // compare sub directory to exclude data - must check them all
1305 if (compare == exclude)
1306 {
1307 excludeHitsVector[i] = true;
1308 retVal = true;
1309 break;
1310 }
1311 }
1312 return retVal;
1313}
1314
1315void ASConsole::printHelp() const
1316{

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected