VTK: Parallel/Core/vtkPDirectory.h Source File

| 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
vtkIndent
a simple class to control print indentation
Definition: vtkIndent.h:38
vtkObject
abstract base class for most VTK objects
Definition: vtkObject.h:61
vtkPDirectory
vtkPDirectory provides a portable way of finding the names of the files in a system directory where p...
Definition: vtkPDirectory.h:27
vtkPDirectory::PrintSelf
void PrintSelf(ostream &os, vtkIndent indent) override
Methods invoked by print to print information about the object including superclasses.
vtkPDirectory::New
static vtkPDirectory * New()
vtkPDirectory::vtkPDirectory
vtkPDirectory()
vtkPDirectory::Open
int Open(const char *dir)
Open/Load the specified directory and load the names of the files in that directory.
vtkPDirectory::GetCurrentWorkingDirectory
static VTK_FILEPATH const char * GetCurrentWorkingDirectory(char *buf, unsigned int len)
Get the current working directory.
vtkPDirectory::Rename
static int Rename(VTK_FILEPATH const char *oldname, VTK_FILEPATH const char *newname)
Rename a file or directory.
vtkPDirectory::~vtkPDirectory
~vtkPDirectory() override
vtkPDirectory::Load
bool Load(const std::string &)
Open/Load the specified directory and load the names of the files in that directory.
vtkPDirectory::Clear
void Clear()
Clear the internal structure.
vtkPDirectory::GetNumberOfFiles
vtkIdType GetNumberOfFiles() const
Return the number of files in the current directory.
vtkPDirectory::FileIsDirectory
int FileIsDirectory(const char *name)
Return true if the file is a directory.
vtkPDirectory::MakeDirectory
static int MakeDirectory(VTK_FILEPATH const char *dir)
Create directory.
vtkPDirectory::GetFile
VTK_FILEPATH const char * GetFile(vtkIdType index) const
Return the file at the given index, the indexing is 0 based.
vtkPDirectory::GetPath
VTK_FILEPATH const char * GetPath() const
Return the path to Open'ed directory.
vtkPDirectory::DeleteDirectory
static int DeleteDirectory(VTK_FILEPATH const char *dir)
Remove a directory.
vtkStringArray
a vtkAbstractArray subclass for strings
Definition: vtkStringArray.h:41
vtkX3D::dir
@ dir
Definition: vtkX3D.h:324
vtkX3D::name
@ name
Definition: vtkX3D.h:219
vtkX3D::index
@ index
Definition: vtkX3D.h:246
vtkX3D::string
@ string
Definition: vtkX3D.h:490
vtkObject.h
vtkIdType
int vtkIdType
Definition: vtkType.h:315
VTK_FILEPATH
#define VTK_FILEPATH
Definition: vtkWrappingHints.h:34