VTK: IO/Core/vtkSortFileNames.h Source File

| VTK 9.3.1

vtkSortFileNames.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
22 #ifndef vtkSortFileNames_h
23 #define vtkSortFileNames_h
24
25 #include "vtkIOCoreModule.h" // For export macro
26 #include "vtkObject.h"
27
28 VTK_ABI_NAMESPACE_BEGIN
29 class vtkStringArray;
30
31 // this is a helper class defined in the .cxx file
32 class vtkStringArrayVector;
33
34 class VTKIOCORE_EXPORT vtkSortFileNames : public vtkObject
35 {
36 public:
37 vtkTypeMacro(vtkSortFileNames, vtkObject);
38 void PrintSelf(ostream& os, vtkIndent indent) override;
39 static vtkSortFileNames* New();
40
42
49 vtkSetMacro(Grouping, vtkTypeBool);
50 vtkGetMacro(Grouping, vtkTypeBool);
51 vtkBooleanMacro(Grouping, vtkTypeBool);
53
55
63 vtkSetMacro(NumericSort, vtkTypeBool);
64 vtkGetMacro(NumericSort, vtkTypeBool);
65 vtkBooleanMacro(NumericSort, vtkTypeBool);
67
69
73 vtkSetMacro(IgnoreCase, vtkTypeBool);
74 vtkGetMacro(IgnoreCase, vtkTypeBool);
75 vtkBooleanMacro(IgnoreCase, vtkTypeBool);
77
79
84 vtkSetMacro(SkipDirectories, vtkTypeBool);
85 vtkGetMacro(SkipDirectories, vtkTypeBool);
86 vtkBooleanMacro(SkipDirectories, vtkTypeBool);
88
90
93 void SetInputFileNames(vtkStringArray* input);
94 vtkGetObjectMacro(InputFileNames, vtkStringArray);
96
100 virtual vtkStringArray* GetFileNames();
101
109 virtual int GetNumberOfGroups();
110
116 virtual vtkStringArray* GetNthGroup(int i);
117
123 virtual void Update();
124
125 protected:
126 vtkSortFileNames();
127 ~vtkSortFileNames() override;
128
129 vtkTypeBool NumericSort;
130 vtkTypeBool IgnoreCase;
131 vtkTypeBool Grouping;
132 vtkTypeBool SkipDirectories;
133
134 vtkTimeStamp UpdateTime;
135
136 vtkStringArray* InputFileNames;
137 vtkStringArray* FileNames;
138 vtkStringArrayVector* Groups;
139
143 virtual void Execute();
144
148 virtual void SortFileNames(vtkStringArray* input, vtkStringArray* output);
149
153 virtual void GroupFileNames(vtkStringArray* input, vtkStringArrayVector* output);
154
155 private:
156 vtkSortFileNames(const vtkSortFileNames&) = delete;
157 void operator=(const vtkSortFileNames&) = delete;
158 };
159
160 VTK_ABI_NAMESPACE_END
161 #endif
vtkIndent
a simple class to control print indentation
Definition: vtkIndent.h:38
vtkObject
abstract base class for most VTK objects
Definition: vtkObject.h:61
vtkSortFileNames
Group and sort a set of filenames.
Definition: vtkSortFileNames.h:35
vtkSortFileNames::SkipDirectories
vtkTypeBool SkipDirectories
Definition: vtkSortFileNames.h:132
vtkSortFileNames::Grouping
vtkTypeBool Grouping
Definition: vtkSortFileNames.h:131
vtkSortFileNames::SetInputFileNames
void SetInputFileNames(vtkStringArray *input)
Set a list of file names to group and sort.
vtkSortFileNames::New
static vtkSortFileNames * New()
vtkSortFileNames::Update
virtual void Update()
Update the output filenames from the input filenames.
vtkSortFileNames::~vtkSortFileNames
~vtkSortFileNames() override
vtkSortFileNames::GetNthGroup
virtual vtkStringArray * GetNthGroup(int i)
Get the Nth group of file names.
vtkSortFileNames::NumericSort
vtkTypeBool NumericSort
Definition: vtkSortFileNames.h:129
vtkSortFileNames::IgnoreCase
vtkTypeBool IgnoreCase
Definition: vtkSortFileNames.h:130
vtkSortFileNames::SortFileNames
virtual void SortFileNames(vtkStringArray *input, vtkStringArray *output)
Sort the input string array, and append the results to the output.
vtkSortFileNames::GetFileNames
virtual vtkStringArray * GetFileNames()
Get the full list of sorted filenames.
vtkSortFileNames::FileNames
vtkStringArray * FileNames
Definition: vtkSortFileNames.h:137
vtkSortFileNames::GetNumberOfGroups
virtual int GetNumberOfGroups()
Get the number of groups that the names were split into, if grouping is on.
vtkSortFileNames::vtkSortFileNames
vtkSortFileNames()
vtkSortFileNames::GroupFileNames
virtual void GroupFileNames(vtkStringArray *input, vtkStringArrayVector *output)
Separate a string array into groups and append them to the output.
vtkSortFileNames::UpdateTime
vtkTimeStamp UpdateTime
Definition: vtkSortFileNames.h:134
vtkSortFileNames::PrintSelf
void PrintSelf(ostream &os, vtkIndent indent) override
Methods invoked by print to print information about the object including superclasses.
vtkSortFileNames::InputFileNames
vtkStringArray * InputFileNames
Definition: vtkSortFileNames.h:136
vtkSortFileNames::Groups
vtkStringArrayVector * Groups
Definition: vtkSortFileNames.h:138
vtkSortFileNames::Execute
virtual void Execute()
Fill the output.
vtkStringArray
a vtkAbstractArray subclass for strings
Definition: vtkStringArray.h:41
vtkTimeStamp
record modification and/or execution time
Definition: vtkTimeStamp.h:34
vtkTypeBool
int vtkTypeBool
Definition: vtkABI.h:64
vtkObject.h