VTK  9.1.0
vtkDirectory.h
Go to the documentation of this file.
1/*=========================================================================
2
3 Program: Visualization Toolkit
4 Module: vtkDirectory.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=========================================================================*/
45#ifndef vtkDirectory_h
46#define vtkDirectory_h
47
48#include "vtkCommonSystemModule.h" // For export macro
49#include "vtkObject.h"
50
51class vtkStringArray;
52
53class VTKCOMMONSYSTEM_EXPORT vtkDirectory : public vtkObject
54{
55public:
57
60 vtkTypeMacro(vtkDirectory, vtkObject);
62
66 static vtkDirectory* New();
67
71 void PrintSelf(ostream& os, vtkIndent indent) override;
72
78 int Open(VTK_FILEPATH const char* dir);
79
84
89
97
99
102 vtkGetObjectMacro(Files, vtkStringArray);
104
108 static VTK_FILEPATH const char* GetCurrentWorkingDirectory(char* buf, unsigned int len);
109
113 static int MakeDirectory(VTK_FILEPATH const char* dir);
114
118 static int DeleteDirectory(VTK_FILEPATH const char* dir);
119
123 static int Rename(VTK_FILEPATH const char* oldname, VTK_FILEPATH const char* newname);
124
125protected:
126 // delete the Files and Path ivars and set
127 // NumberOfFiles to 0
130 ~vtkDirectory() override;
131
132private:
133 char* Path; // Path to Open'ed directory
134 vtkStringArray* Files; // VTK array of files
135
136 static int CreateDirectoryInternal(const char* dir);
137
138private:
139 vtkDirectory(const vtkDirectory&) = delete;
140 void operator=(const vtkDirectory&) = delete;
141};
142
143#endif
OS independent class for access and manipulation of system directories.
Definition: vtkDirectory.h:54
vtkIdType GetNumberOfFiles()
Return the number of files in the current directory.
static int Rename(VTK_FILEPATH const char *oldname, VTK_FILEPATH const char *newname)
Rename a file or directory.
int FileIsDirectory(VTK_FILEPATH const char *name)
Return true if the file is a directory.
static vtkDirectory * New()
Create a new vtkDirectory object.
static VTK_FILEPATH const char * GetCurrentWorkingDirectory(char *buf, unsigned int len)
Get the current working directory.
void CleanUpFilesAndPath()
static int MakeDirectory(VTK_FILEPATH const char *dir)
Create directory.
static int DeleteDirectory(VTK_FILEPATH const char *dir)
Remove a directory.
VTK_FILEPATH const char * GetFile(vtkIdType index)
Return the file at the given index, the indexing is 0 based.
int Open(VTK_FILEPATH const char *dir)
Open the specified directory and load the names of the files in that directory.
~vtkDirectory() override
void PrintSelf(ostream &os, vtkIndent indent) override
Print directory to stream.
a simple class to control print indentation
Definition: vtkIndent.h:113
abstract base class for most VTK objects
Definition: vtkObject.h:73
a vtkAbstractArray subclass for strings
@ dir
Definition: vtkX3D.h:330
@ name
Definition: vtkX3D.h:225
@ index
Definition: vtkX3D.h:252
int vtkIdType
Definition: vtkType.h:332
#define VTK_FILEPATH