VTK  9.3.1
vtkPDirectory.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
16 #ifndef vtkPDirectory_h
17 #define vtkPDirectory_h
18 
19 #include "vtkObject.h"
20 #include "vtkParallelCoreModule.h" // For export macro
21 #include <string> // for string functions in Directory
22 
23 VTK_ABI_NAMESPACE_BEGIN
24 class vtkStringArray;
25 
26 class VTKPARALLELCORE_EXPORT vtkPDirectory : public vtkObject
27 {
28 public:
29  static vtkPDirectory* New();
30  vtkTypeMacro(vtkPDirectory, vtkObject);
31  void PrintSelf(ostream& os, vtkIndent indent) override;
32 
34 
41  bool Load(const std::string&);
42  int Open(const char* dir);
44 
48  vtkIdType GetNumberOfFiles() const;
49 
53  VTK_FILEPATH const char* GetFile(vtkIdType index) const;
54 
61  int FileIsDirectory(const char* name);
62 
64 
67  vtkGetObjectMacro(Files, vtkStringArray);
69 
73  VTK_FILEPATH const char* GetPath() const;
74 
79  void Clear();
80 
84  static VTK_FILEPATH const char* GetCurrentWorkingDirectory(char* buf, unsigned int len);
85 
89  static int MakeDirectory(VTK_FILEPATH const char* dir);
90 
94  static int DeleteDirectory(VTK_FILEPATH const char* dir);
95 
99  static int Rename(VTK_FILEPATH const char* oldname, VTK_FILEPATH const char* newname);
100 
101 protected:
102  vtkPDirectory();
103  ~vtkPDirectory() override;
104 
105 private:
106  // Array of Files
107  vtkStringArray* Files; // VTK array of files
108 
109  // Path to Open'ed directory
110  std::string Path;
111 
112  vtkPDirectory(const vtkPDirectory&) = delete;
113  void operator=(const vtkPDirectory&) = delete;
114 }; // End Class: vtkPDirectory
115 
116 VTK_ABI_NAMESPACE_END
117 #endif
abstract base class for most VTK objects
Definition: vtkObject.h:51
vtkPDirectory provides a portable way of finding the names of the files in a system directory where p...
Definition: vtkPDirectory.h:26
void PrintSelf(ostream &os, vtkIndent indent) override
Methods invoked by print to print information about the object including superclasses.
a vtkAbstractArray subclass for strings
int vtkIdType
Definition: vtkType.h:315
a simple class to control print indentation
Definition: vtkIndent.h:28
#define VTK_FILEPATH
static vtkObject * New()
Create an object with Debug turned off, modified time initialized to zero, and reference counting on...