VTK  9.2.6
vtkSortFileNames.h
Go to the documentation of this file.
1 /*=========================================================================
2 
3  Program: Visualization Toolkit
4  Module: vtkSortFileNames.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 =========================================================================*/
34 #ifndef vtkSortFileNames_h
35 #define vtkSortFileNames_h
36 
37 #include "vtkIOCoreModule.h" // For export macro
38 #include "vtkObject.h"
39 
40 class vtkStringArray;
41 
42 // this is a helper class defined in the .cxx file
43 class vtkStringArrayVector;
44 
45 class VTKIOCORE_EXPORT vtkSortFileNames : public vtkObject
46 {
47 public:
48  vtkTypeMacro(vtkSortFileNames, vtkObject);
49  void PrintSelf(ostream& os, vtkIndent indent) override;
50  static vtkSortFileNames* New();
51 
53 
60  vtkSetMacro(Grouping, vtkTypeBool);
61  vtkGetMacro(Grouping, vtkTypeBool);
62  vtkBooleanMacro(Grouping, vtkTypeBool);
64 
66 
74  vtkSetMacro(NumericSort, vtkTypeBool);
75  vtkGetMacro(NumericSort, vtkTypeBool);
76  vtkBooleanMacro(NumericSort, vtkTypeBool);
78 
80 
84  vtkSetMacro(IgnoreCase, vtkTypeBool);
85  vtkGetMacro(IgnoreCase, vtkTypeBool);
86  vtkBooleanMacro(IgnoreCase, vtkTypeBool);
88 
90 
95  vtkSetMacro(SkipDirectories, vtkTypeBool);
96  vtkGetMacro(SkipDirectories, vtkTypeBool);
97  vtkBooleanMacro(SkipDirectories, vtkTypeBool);
99 
101 
105  vtkGetObjectMacro(InputFileNames, vtkStringArray);
107 
112 
120  virtual int GetNumberOfGroups();
121 
127  virtual vtkStringArray* GetNthGroup(int i);
128 
134  virtual void Update();
135 
136 protected:
138  ~vtkSortFileNames() override;
139 
144 
146 
149  vtkStringArrayVector* Groups;
150 
154  virtual void Execute();
155 
159  virtual void SortFileNames(vtkStringArray* input, vtkStringArray* output);
160 
164  virtual void GroupFileNames(vtkStringArray* input, vtkStringArrayVector* output);
165 
166 private:
167  vtkSortFileNames(const vtkSortFileNames&) = delete;
168  void operator=(const vtkSortFileNames&) = delete;
169 };
170 
171 #endif
a simple class to control print indentation
Definition: vtkIndent.h:119
abstract base class for most VTK objects
Definition: vtkObject.h:82
Group and sort a set of filenames.
vtkTypeBool SkipDirectories
vtkTypeBool Grouping
void SetInputFileNames(vtkStringArray *input)
Set a list of file names to group and sort.
static vtkSortFileNames * New()
virtual void Update()
Update the output filenames from the input filenames.
~vtkSortFileNames() override
virtual vtkStringArray * GetNthGroup(int i)
Get the Nth group of file names.
vtkTypeBool NumericSort
vtkTypeBool IgnoreCase
virtual void SortFileNames(vtkStringArray *input, vtkStringArray *output)
Sort the input string array, and append the results to the output.
virtual vtkStringArray * GetFileNames()
Get the full list of sorted filenames.
vtkStringArray * FileNames
virtual int GetNumberOfGroups()
Get the number of groups that the names were split into, if grouping is on.
virtual void GroupFileNames(vtkStringArray *input, vtkStringArrayVector *output)
Separate a string array into groups and append them to the output.
vtkTimeStamp UpdateTime
void PrintSelf(ostream &os, vtkIndent indent) override
Methods invoked by print to print information about the object including superclasses.
vtkStringArray * InputFileNames
vtkStringArrayVector * Groups
virtual void Execute()
Fill the output.
a vtkAbstractArray subclass for strings
record modification and/or execution time
Definition: vtkTimeStamp.h:55
int vtkTypeBool
Definition: vtkABI.h:69