MCPcopy Create free account
hub / github.com/Kitware/ParaView / vtkFindFileGroupFor

Function vtkFindFileGroupFor

Remoting/ServerManager/vtkSMReaderReloadHelper.cxx:23–64  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

21namespace
22{
23vtkPVFileInformation* 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.
67std::vector<std::string> vtkGetFilesInSeries(vtkSMSessionProxyManager* pxm, const char* fname)

Callers 1

vtkGetFilesInSeriesFunction · 0.85

Calls 4

IsGroupFunction · 0.85
GetNumberOfItemsMethod · 0.80
IsDirectoryMethod · 0.45
GetTypeMethod · 0.45

Tested by

no test coverage detected