| 137 | } |
| 138 | |
| 139 | static Array * pathsInDirectory(String * directory) |
| 140 | { |
| 141 | Array * result = Array::array(); |
| 142 | |
| 143 | DIR * dir = opendir(directory->fileSystemRepresentation()); |
| 144 | if (dir == NULL) { |
| 145 | return result; |
| 146 | } |
| 147 | |
| 148 | struct dirent * ent; |
| 149 | while ((ent = readdir(dir)) != NULL) { |
| 150 | if (ent->d_name[0] == '.') { |
| 151 | continue; |
| 152 | } |
| 153 | |
| 154 | String * subpath = directory->stringByAppendingPathComponent(String::stringWithFileSystemRepresentation(ent->d_name)); |
| 155 | if (ent->d_type == DT_DIR) { |
| 156 | result->addObjectsFromArray(pathsInDirectory(subpath)); |
| 157 | } |
| 158 | else { |
| 159 | result->addObject(subpath); |
| 160 | } |
| 161 | } |
| 162 | closedir(dir); |
| 163 | |
| 164 | return result; |
| 165 | } |
| 166 | |
| 167 | static void prepareHeaderForUnitTest(MessageHeader * header) |
| 168 | { |
no test coverage detected