MCPcopy Create free account
hub / github.com/MailCore/mailcore2 / pathsInDirectory

Function pathsInDirectory

unittest/unittest.cpp:139–165  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

137}
138
139static 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
167static void prepareHeaderForUnitTest(MessageHeader * header)
168{

Callers 3

testMessageParserFunction · 0.85
testCharsetDetectionFunction · 0.85
testSummaryFunction · 0.85

Calls 4

addObjectsFromArrayMethod · 0.45
addObjectMethod · 0.45

Tested by

no test coverage detected