VTK
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 =========================================================================*/
28 #ifndef __vtkDirectory_h
29 #define __vtkDirectory_h
30 
31 #include "vtkObject.h"
32 
33 class vtkStringArray;
34 
36 {
37 public:
39 
40  vtkTypeMacro(vtkDirectory,vtkObject);
42 
44  static vtkDirectory *New();
45 
47  virtual void PrintSelf(ostream& os, vtkIndent indent);
48 
52  int Open(const char* dir);
53 
55  vtkIdType GetNumberOfFiles();
56 
58  const char* GetFile(vtkIdType index);
59 
64  int FileIsDirectory(const char *name);
65 
67 
68  vtkGetObjectMacro(Files, vtkStringArray);
70 
72  static const char* GetCurrentWorkingDirectory(char* buf, unsigned int len);
73 
75  static int MakeDirectory(const char* dir);
76 
78  static int DeleteDirectory(const char* dir);
79 
81  static int Rename(const char* oldname, const char* newname);
82 
83 #ifdef VTK_WORKAROUND_WINDOWS_MANGLE
84 # define CreateDirectoryA CreateDirectory
85 # define CreateDirectoryW CreateDirectory
86 #endif
87 
89  VTK_LEGACY(static int CreateDirectory(const char* dir));
90 
91 #ifdef VTK_WORKAROUND_WINDOWS_MANGLE
92 # undef CreateDirectoryW
93 # undef CreateDirectoryA
94  //BTX
95  VTK_LEGACY(static int CreateDirectoryA(const char* dir));
96  VTK_LEGACY(static int CreateDirectoryW(const char* dir));
97  //ETX
98 #endif
99 
100 protected:
101  // delete the Files and Path ivars and set
102  // NumberOfFiles to 0
103  void CleanUpFilesAndPath();
104  vtkDirectory();
105  ~vtkDirectory() ;
106 
107 private:
108  char* Path; // Path to Open'ed directory
109  vtkStringArray *Files; // VTK array of files
110 
111  static int CreateDirectoryInternal(const char* dir);
112 
113 private:
114  vtkDirectory(const vtkDirectory&); // Not implemented.
115  void operator=(const vtkDirectory&); // Not implemented.
116 };
117 
118 #endif
abstract base class for most VTK objects
Definition: vtkObject.h:60
a vtkAbstractArray subclass for strings
int vtkIdType
Definition: vtkType.h:255
virtual void PrintSelf(ostream &os, vtkIndent indent)
a simple class to control print indentation
Definition: vtkIndent.h:37
#define VTK_COMMON_EXPORT
OS independent class for access and manipulation of system directories.
Definition: vtkDirectory.h:35
static vtkObject * New()