VTK
|
00001 /*========================================================================= 00002 00003 Program: Visualization Toolkit 00004 Module: vtkDirectory.h 00005 00006 Copyright (c) Ken Martin, Will Schroeder, Bill Lorensen 00007 All rights reserved. 00008 See Copyright.txt or http://www.kitware.com/Copyright.htm for details. 00009 00010 This software is distributed WITHOUT ANY WARRANTY; without even 00011 the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR 00012 PURPOSE. See the above copyright notice for more information. 00013 00014 =========================================================================*/ 00028 #ifndef vtkDirectory_h 00029 #define vtkDirectory_h 00030 00031 #include "vtkCommonSystemModule.h" // For export macro 00032 #include "vtkObject.h" 00033 00034 class vtkStringArray; 00035 00036 class VTKCOMMONSYSTEM_EXPORT vtkDirectory : public vtkObject 00037 { 00038 public: 00040 00041 vtkTypeMacro(vtkDirectory,vtkObject); 00043 00045 static vtkDirectory *New(); 00046 00048 virtual void PrintSelf(ostream& os, vtkIndent indent); 00049 00053 int Open(const char* dir); 00054 00056 vtkIdType GetNumberOfFiles(); 00057 00059 const char* GetFile(vtkIdType index); 00060 00065 int FileIsDirectory(const char *name); 00066 00068 00069 vtkGetObjectMacro(Files, vtkStringArray); 00071 00073 static const char* GetCurrentWorkingDirectory(char* buf, unsigned int len); 00074 00076 static int MakeDirectory(const char* dir); 00077 00079 static int DeleteDirectory(const char* dir); 00080 00082 static int Rename(const char* oldname, const char* newname); 00083 00084 protected: 00085 // delete the Files and Path ivars and set 00086 // NumberOfFiles to 0 00087 void CleanUpFilesAndPath(); 00088 vtkDirectory(); 00089 ~vtkDirectory() ; 00090 00091 private: 00092 char* Path; // Path to Open'ed directory 00093 vtkStringArray *Files; // VTK array of files 00094 00095 static int CreateDirectoryInternal(const char* dir); 00096 00097 private: 00098 vtkDirectory(const vtkDirectory&); // Not implemented. 00099 void operator=(const vtkDirectory&); // Not implemented. 00100 }; 00101 00102 #endif