MCPcopy Create free account
hub / github.com/OpenMS/OpenMS / fileList

Method fileList

src/openms/source/SYSTEM/File.cpp:420–443  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

418 }
419
420 bool File::fileList(const String& dir, const String& file_pattern, StringList& output, bool full_path)
421 {
422 QDir d(dir.toQString(), file_pattern.toQString(), QDir::Name, QDir::Files);
423 QFileInfoList list = d.entryInfoList();
424
425 //clear and check if empty
426 output.clear();
427 if (list.empty())
428 {
429 return false;
430 }
431
432 //resize output
433 output.resize(list.size());
434
435 //fill output
436 UInt i = 0;
437 for (QFileInfoList::const_iterator it = list.constBegin(); it != list.constEnd(); ++it)
438 {
439 output[i++] = full_path ? it->filePath() : it->fileName();
440 }
441
442 return true;
443 }
444
445 String File::findDoc(const String& filename)
446 {

Callers

nothing calls this directly

Calls 5

toQStringMethod · 0.45
clearMethod · 0.45
emptyMethod · 0.45
resizeMethod · 0.45
sizeMethod · 0.45

Tested by

no test coverage detected