VTK  9.1.0
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=========================================================================*/
36#ifndef vtkGlobFileNames_h
37#define vtkGlobFileNames_h
38
39#include "vtkIOCoreModule.h" // For export macro
40#include "vtkObject.h"
41
42class vtkStringArray;
43
44class VTKIOCORE_EXPORT vtkGlobFileNames : public vtkObject
45{
46public:
48
53
58
62 void PrintSelf(ostream& os, vtkIndent indent) override;
63
67 void Reset();
68
70
80
87 int AddFileNames(VTK_FILEPATH const char* pattern);
88
90
93 vtkSetMacro(Recurse, vtkTypeBool);
94 vtkBooleanMacro(Recurse, vtkTypeBool);
95 vtkGetMacro(Recurse, vtkTypeBool);
97
102
106 VTK_FILEPATH const char* GetNthFileName(int index);
107
109
112 vtkGetObjectMacro(FileNames, vtkStringArray);
114
115protected:
117
123
126
127private:
128 char* Directory; // Directory for search.
129 char* Pattern; // Wildcard pattern
130 vtkTypeBool Recurse; // Recurse into subdirectories
131 vtkStringArray* FileNames; // VTK array of files
132
133private:
134 vtkGlobFileNames(const vtkGlobFileNames&) = delete;
135 void operator=(const vtkGlobFileNames&) = delete;
136};
137
138#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:113
abstract base class for most VTK objects
Definition: vtkObject.h:82
a vtkAbstractArray subclass for strings
int vtkTypeBool
Definition: vtkABI.h:69
#define VTK_FILEPATH