VTK  9.2.5
vtkGlobFileNames.h
Go to the documentation of this file.
1 /*=========================================================================
2 
3  Program: Visualization Toolkit
4  Module: vtkGlobFileNames.h
5 
6  Copyright (c) Ken Martin, Will Schroeder, Bill Lorensen
7  All rights reserved.
8  See Copyright.txt or http://www.kitware.com/Copyright.htm for details.
9 
10  This software is distributed WITHOUT ANY WARRANTY; without even
11  the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
12  PURPOSE. See the above copyright notice for more information.
13 
14 =========================================================================*/
39 #ifndef vtkGlobFileNames_h
40 #define vtkGlobFileNames_h
41 
42 #include "vtkIOCoreModule.h" // For export macro
43 #include "vtkObject.h"
44 
45 class vtkStringArray;
46 
47 class VTKIOCORE_EXPORT vtkGlobFileNames : public vtkObject
48 {
49 public:
51 
54  vtkTypeMacro(vtkGlobFileNames, vtkObject);
56 
60  static vtkGlobFileNames* New();
61 
65  void PrintSelf(ostream& os, vtkIndent indent) override;
66 
70  void Reset();
71 
73 
80  vtkSetFilePathMacro(Directory);
81  vtkGetFilePathMacro(Directory);
83 
90  int AddFileNames(VTK_FILEPATH const char* pattern);
91 
93 
96  vtkSetMacro(Recurse, vtkTypeBool);
97  vtkBooleanMacro(Recurse, vtkTypeBool);
98  vtkGetMacro(Recurse, vtkTypeBool);
100 
105 
110 
112 
115  vtkGetObjectMacro(FileNames, vtkStringArray);
117 
118 protected:
120 
126 
128  ~vtkGlobFileNames() override;
129 
130 private:
131  char* Directory; // Directory for search.
132  char* Pattern; // Wildcard pattern
133  vtkTypeBool Recurse; // Recurse into subdirectories
134  vtkStringArray* FileNames; // VTK array of files
135 
136 private:
137  vtkGlobFileNames(const vtkGlobFileNames&) = delete;
138  void operator=(const vtkGlobFileNames&) = delete;
139 };
140 
141 #endif
find files that match a wildcard pattern
VTK_FILEPATH const char * GetNthFileName(int index)
Return the file at the given index, the indexing is 0 based.
void Reset()
Reset the glob by clearing the list of output filenames.
static vtkGlobFileNames * New()
Create a new vtkGlobFileNames object.
int GetNumberOfFileNames()
Return the number of files found.
~vtkGlobFileNames() override
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.
a simple class to control print indentation
Definition: vtkIndent.h:119
abstract base class for most VTK objects
Definition: vtkObject.h:82
a vtkAbstractArray subclass for strings
@ index
Definition: vtkX3D.h:252
int vtkTypeBool
Definition: vtkABI.h:69
#define VTK_FILEPATH