VTK  9.5.20251211
vtkGlobFileNames.h
Go to the documentation of this file.
1// SPDX-FileCopyrightText: Copyright (c) Ken Martin, Will Schroeder, Bill Lorensen
2// SPDX-License-Identifier: BSD-3-Clause
33
34#ifndef vtkGlobFileNames_h
35#define vtkGlobFileNames_h
36
37#include "vtkIOCoreModule.h" // For export macro
38#include "vtkObject.h"
39
40VTK_ABI_NAMESPACE_BEGIN
41class vtkStringArray;
42
43class VTKIOCORE_EXPORT vtkGlobFileNames : public vtkObject
44{
45public:
47
52
57
61 void PrintSelf(ostream& os, vtkIndent indent) override;
62
66 void Reset();
67
69
79
86 int AddFileNames(VTK_FILEPATH const char* pattern);
87
89
92 vtkSetMacro(Recurse, vtkTypeBool);
93 vtkBooleanMacro(Recurse, vtkTypeBool);
94 vtkGetMacro(Recurse, vtkTypeBool);
96
101
105 VTK_FILEPATH const char* GetNthFileName(int index);
106
108
111 vtkGetObjectMacro(FileNames, vtkStringArray);
113
114protected:
116
122
125
126private:
127 char* Directory; // Directory for search.
128 char* Pattern; // Wildcard pattern
129 vtkTypeBool Recurse; // Recurse into subdirectories
130 vtkStringArray* FileNames; // VTK array of files
131
132 vtkGlobFileNames(const vtkGlobFileNames&) = delete;
133 void operator=(const vtkGlobFileNames&) = delete;
134};
135
136VTK_ABI_NAMESPACE_END
137#endif
void Reset()
Reset the glob by clearing the list of output filenames.
int GetNumberOfFileNames()
Return the number of files found.
~vtkGlobFileNames() override
static vtkGlobFileNames * New()
Create a new vtkGlobFileNames object.
vtkGetFilePathMacro(Directory)
Set the directory in which to perform the glob.
vtkSetFilePathMacro(Directory)
Set the directory in which to perform the glob.
const char * GetNthFileName(int index)
Return the file at the given index, the indexing is 0 based.
vtkSetFilePathMacro(Pattern)
Set the wildcard pattern.
vtkGetFilePathMacro(Pattern)
Set the wildcard pattern.
void PrintSelf(ostream &os, vtkIndent indent) override
Print directory to stream.
int AddFileNames(const char *pattern)
Search for all files that match the given expression, sort them, and add them to the output.
a simple class to control print indentation
Definition vtkIndent.h:108
a vtkAbstractArray subclass for strings
int vtkTypeBool
Definition vtkABI.h:64
#define VTK_FILEPATH