| 1007 | //----------------------------------------------------------------------------- |
| 1008 | |
| 1009 | bool Platform::hasSubDirectory(const char *pPath) |
| 1010 | { |
| 1011 | if (!pPath) |
| 1012 | return false; |
| 1013 | ResourceManager->initExcludedDirectories(); |
| 1014 | |
| 1015 | struct dirent *d; |
| 1016 | DIR *dip; |
| 1017 | dip = opendir(pPath); |
| 1018 | if (dip == NULL) |
| 1019 | return false; |
| 1020 | |
| 1021 | while (d = readdir(dip)) |
| 1022 | { |
| 1023 | bool isDir = false; |
| 1024 | if (d->d_type == DT_UNKNOWN) |
| 1025 | { |
| 1026 | char child [1024]; |
| 1027 | if ((pPath[dStrlen(pPath) - 1] == '/')) |
| 1028 | dSprintf(child, 1024, "%s%s", pPath, d->d_name); |
| 1029 | else |
| 1030 | dSprintf(child, 1024, "%s/%s", pPath, d->d_name); |
| 1031 | isDir = Platform::isDirectory (child); |
| 1032 | } |
| 1033 | else if (d->d_type & DT_DIR) |
| 1034 | isDir = true; |
| 1035 | if( isDir ) |
| 1036 | { |
| 1037 | // Skip the . and .. directories |
| 1038 | if (dStrcmp(d->d_name, ".") == 0 ||dStrcmp(d->d_name, "..") == 0) |
| 1039 | continue; |
| 1040 | if (Platform::isExcludedDirectory(d->d_name)) |
| 1041 | continue; |
| 1042 | Platform::clearExcludedDirectories(); |
| 1043 | closedir(dip); |
| 1044 | return true; |
| 1045 | } |
| 1046 | } |
| 1047 | closedir(dip); |
| 1048 | Platform::clearExcludedDirectories(); |
| 1049 | return false; |
| 1050 | } |
| 1051 | |
| 1052 | static bool recurseDumpDirectories(const char *basePath, const char *subPath, Vector<StringTableEntry> &directoryVector, S32 currentDepth, S32 recurseDepth, bool noBasePath) |
| 1053 | { |
nothing calls this directly
no test coverage detected