VTK  9.1.0
vtkPDirectory.h
Go to the documentation of this file.
1 /*=========================================================================
2 
3  Program: Visualization Toolkit
4  Module: vtkPDirectory.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  =========================================================================*/
25 #ifndef vtkPDirectory_h
26 #define vtkPDirectory_h
27 
28 #include "vtkObject.h"
29 #include "vtkParallelCoreModule.h" // For export macro
30 #include <string> // for string functions in Directory
31 
32 class vtkStringArray;
33 
34 class VTKPARALLELCORE_EXPORT vtkPDirectory : public vtkObject
35 {
36 public:
37  static vtkPDirectory* New();
38  vtkTypeMacro(vtkPDirectory, vtkObject);
39  void PrintSelf(ostream& os, vtkIndent indent) override;
40 
42 
49  bool Load(const std::string&);
50  int Open(const char* dir);
52 
57 
61  VTK_FILEPATH const char* GetFile(vtkIdType index) const;
62 
69  int FileIsDirectory(const char* name);
70 
72 
75  vtkGetObjectMacro(Files, vtkStringArray);
77 
81  VTK_FILEPATH const char* GetPath() const;
82 
87  void Clear();
88 
92  static VTK_FILEPATH const char* GetCurrentWorkingDirectory(char* buf, unsigned int len);
93 
97  static int MakeDirectory(VTK_FILEPATH const char* dir);
98 
102  static int DeleteDirectory(VTK_FILEPATH const char* dir);
103 
107  static int Rename(VTK_FILEPATH const char* oldname, VTK_FILEPATH const char* newname);
108 
109 protected:
111  ~vtkPDirectory() override;
112 
113 private:
114  // Array of Files
115  vtkStringArray* Files; // VTK array of files
116 
117  // Path to Open'ed directory
118  std::string Path;
119 
120  vtkPDirectory(const vtkPDirectory&) = delete;
121  void operator=(const vtkPDirectory&) = delete;
122 }; // End Class: vtkPDirectory
123 
124 #endif
vtkPDirectory::DeleteDirectory
static int DeleteDirectory(VTK_FILEPATH const char *dir)
Remove a directory.
VTK_FILEPATH
#define VTK_FILEPATH
Definition: vtkWrappingHints.h:46
vtkIdType
int vtkIdType
Definition: vtkType.h:332
vtkPDirectory::Open
int Open(const char *dir)
Open/Load the specified directory and load the names of the files in that directory.
vtkObject
abstract base class for most VTK objects
Definition: vtkObject.h:82
vtkX3D::dir
@ dir
Definition: vtkX3D.h:330
vtkPDirectory::PrintSelf
void PrintSelf(ostream &os, vtkIndent indent) override
Methods invoked by print to print information about the object including superclasses.
vtkPDirectory
vtkPDirectory provides a portable way of finding the names of the files in a system directory where p...
Definition: vtkPDirectory.h:35
vtkPDirectory::GetCurrentWorkingDirectory
static VTK_FILEPATH const char * GetCurrentWorkingDirectory(char *buf, unsigned int len)
Get the current working directory.
vtkPDirectory::MakeDirectory
static int MakeDirectory(VTK_FILEPATH const char *dir)
Create directory.
vtkPDirectory::Rename
static int Rename(VTK_FILEPATH const char *oldname, VTK_FILEPATH const char *newname)
Rename a file or directory.
vtkPDirectory::New
static vtkPDirectory * New()
vtkPDirectory::Load
bool Load(const std::string &)
Open/Load the specified directory and load the names of the files in that directory.
vtkIndent
a simple class to control print indentation
Definition: vtkIndent.h:113
vtkPDirectory::~vtkPDirectory
~vtkPDirectory() override
vtkX3D::name
@ name
Definition: vtkX3D.h:225
vtkObject.h
vtkPDirectory::GetFile
VTK_FILEPATH const char * GetFile(vtkIdType index) const
Return the file at the given index, the indexing is 0 based.
vtkX3D::string
@ string
Definition: vtkX3D.h:496
vtkPDirectory::FileIsDirectory
int FileIsDirectory(const char *name)
Return true if the file is a directory.
vtkPDirectory::GetNumberOfFiles
vtkIdType GetNumberOfFiles() const
Return the number of files in the current directory.
vtkStringArray
a vtkAbstractArray subclass for strings
Definition: vtkStringArray.h:146
vtkPDirectory::vtkPDirectory
vtkPDirectory()
vtkX3D::index
@ index
Definition: vtkX3D.h:252
vtkPDirectory::Clear
void Clear()
Clear the internal structure.
vtkPDirectory::GetPath
VTK_FILEPATH const char * GetPath() const
Return the path to Open'ed directory.