| 21 | namespace |
| 22 | { |
| 23 | vtkPVFileInformation* vtkFindFileGroupFor(vtkPVFileInformation* info, const std::string& unixFname) |
| 24 | { |
| 25 | if (info == nullptr) |
| 26 | { |
| 27 | return nullptr; |
| 28 | } |
| 29 | |
| 30 | if (!info->IsGroup() && !info->IsDirectory()) |
| 31 | { |
| 32 | return nullptr; |
| 33 | } |
| 34 | |
| 35 | for (int cc = 0, max = info->GetContents()->GetNumberOfItems(); cc < max; ++cc) |
| 36 | { |
| 37 | vtkPVFileInformation* item = |
| 38 | vtkPVFileInformation::SafeDownCast(info->GetContents()->GetItemAsObject(cc)); |
| 39 | if (item == nullptr || item->GetFullPath() == nullptr) |
| 40 | { |
| 41 | continue; |
| 42 | } |
| 43 | |
| 44 | if (vtkPVFileInformation::IsGroup(item->GetType())) |
| 45 | { |
| 46 | if (vtkPVFileInformation* found = vtkFindFileGroupFor(item, unixFname)) |
| 47 | { |
| 48 | return found; |
| 49 | } |
| 50 | } |
| 51 | else if ((item->GetType() == vtkPVFileInformation::SINGLE_FILE && |
| 52 | info->GetType() == vtkPVFileInformation::FILE_GROUP) || |
| 53 | (item->IsDirectory() && info->GetType() == vtkPVFileInformation::DIRECTORY_GROUP)) |
| 54 | { |
| 55 | std::string unixFullPath(item->GetFullPath()); |
| 56 | vtksys::SystemTools::ConvertToUnixSlashes(unixFullPath); |
| 57 | if (unixFname == unixFullPath) |
| 58 | { |
| 59 | return info; |
| 60 | } |
| 61 | } |
| 62 | } |
| 63 | return nullptr; |
| 64 | } |
| 65 | |
| 66 | // Returns empty to indicate nothing found or don't bother updating. |
| 67 | std::vector<std::string> vtkGetFilesInSeries(vtkSMSessionProxyManager* pxm, const char* fname) |
no test coverage detected