VTK  9.4.20241218
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
27#ifndef vtkGlobFileNames_h
28#define vtkGlobFileNames_h
29
30#include "vtkIOCoreModule.h" // For export macro
31#include "vtkObject.h"
32
33VTK_ABI_NAMESPACE_BEGIN
34class vtkStringArray;
35
36class VTKIOCORE_EXPORT vtkGlobFileNames : public vtkObject
37{
38public:
40
45
50
54 void PrintSelf(ostream& os, vtkIndent indent) override;
55
59 void Reset();
60
62
72
79 int AddFileNames(VTK_FILEPATH const char* pattern);
80
82
85 vtkSetMacro(Recurse, vtkTypeBool);
86 vtkBooleanMacro(Recurse, vtkTypeBool);
87 vtkGetMacro(Recurse, vtkTypeBool);
89
94
98 VTK_FILEPATH const char* GetNthFileName(int index);
99
101
104 vtkGetObjectMacro(FileNames, vtkStringArray);
106
107protected:
109
115
118
119private:
120 char* Directory; // Directory for search.
121 char* Pattern; // Wildcard pattern
122 vtkTypeBool Recurse; // Recurse into subdirectories
123 vtkStringArray* FileNames; // VTK array of files
124
125 vtkGlobFileNames(const vtkGlobFileNames&) = delete;
126 void operator=(const vtkGlobFileNames&) = delete;
127};
128
129VTK_ABI_NAMESPACE_END
130#endif
find files that match a wildcard pattern
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.
int AddFileNames(VTK_FILEPATH const char *pattern)
Search for all files that match the given expression, sort them, and add them to the output.
vtkGetFilePathMacro(Directory)
Set the directory in which to perform the glob.
vtkSetFilePathMacro(Directory)
Set the directory in which to perform the glob.
vtkSetFilePathMacro(Pattern)
Set the wildcard pattern.
vtkGetFilePathMacro(Pattern)
Set the wildcard pattern.
void PrintSelf(ostream &os, vtkIndent indent) override
Print directory to stream.
VTK_FILEPATH const char * GetNthFileName(int index)
Return the file at the given index, the indexing is 0 based.
a simple class to control print indentation
Definition vtkIndent.h:108
abstract base class for most VTK objects
Definition vtkObject.h:162
a vtkAbstractArray subclass for strings
int vtkTypeBool
Definition vtkABI.h:64
#define VTK_FILEPATH