Returns empty to indicate nothing found or don't bother updating.
| 65 | |
| 66 | // Returns empty to indicate nothing found or don't bother updating. |
| 67 | std::vector<std::string> vtkGetFilesInSeries(vtkSMSessionProxyManager* pxm, const char* fname) |
| 68 | { |
| 69 | std::string dir = vtksys::SystemTools::GetFilenamePath(fname); |
| 70 | |
| 71 | // We use unix-slashes so we can consistently compare filenames in |
| 72 | // vtkFindFileGroupFor(). |
| 73 | std::string unixFname = fname; |
| 74 | vtksys::SystemTools::ConvertToUnixSlashes(unixFname); |
| 75 | |
| 76 | vtkSmartPointer<vtkSMProxy> helper; |
| 77 | helper.TakeReference(pxm->NewProxy("misc", "FileInformationHelper")); |
| 78 | vtkSMPropertyHelper(helper, "WorkingDirectory").Set(dir.c_str()); |
| 79 | vtkSMPropertyHelper(helper, "Path").Set(dir.c_str()); |
| 80 | vtkSMPropertyHelper(helper, "SpecialDirectories").Set(0); |
| 81 | vtkSMPropertyHelper(helper, "DirectoryListing").Set(1); |
| 82 | helper->UpdateVTKObjects(); |
| 83 | |
| 84 | vtkNew<vtkPVFileInformation> info; |
| 85 | helper->GatherInformation(info.Get()); |
| 86 | |
| 87 | if (vtkPVFileInformation* group = vtkFindFileGroupFor(info.Get(), unixFname)) |
| 88 | { |
| 89 | std::vector<std::string> retval(group->GetContents()->GetNumberOfItems()); |
| 90 | for (int cc = 0, max = group->GetContents()->GetNumberOfItems(); cc < max; ++cc) |
| 91 | { |
| 92 | vtkPVFileInformation* item = |
| 93 | vtkPVFileInformation::SafeDownCast(group->GetContents()->GetItemAsObject(cc)); |
| 94 | retval[cc] = item->GetFullPath(); |
| 95 | } |
| 96 | return retval; |
| 97 | } |
| 98 | |
| 99 | return std::vector<std::string>(); |
| 100 | } |
| 101 | } |
| 102 | |
| 103 | vtkStandardNewMacro(vtkSMReaderReloadHelper); |
no test coverage detected