Main Page | Class Hierarchy | Alphabetical List | Class List | Directories | File List | Class Members | File Members | Related Pages

vtkDirectory.h

Go to the documentation of this file.
00001 /*=========================================================================
00002 
00003   Program:   Visualization Toolkit
00004   Module:    $RCSfile: vtkDirectory.h,v $
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 "vtkObject.h"
00032 
00033 class vtkStringArray;
00034 
00035 class VTK_COMMON_EXPORT vtkDirectory : public vtkObject
00036 {
00037 public:
00039 
00040   vtkTypeRevisionMacro(vtkDirectory,vtkObject);
00042 
00044   static vtkDirectory *New();
00045 
00047   virtual void PrintSelf(ostream& os, vtkIndent indent);
00048 
00052   int Open(const char* dir);
00053 
00055   int GetNumberOfFiles();
00056 
00058   const char* GetFile(int index);
00059 
00064   int FileIsDirectory(const char *name);
00065 
00067 
00068   vtkGetObjectMacro(Files, vtkStringArray);
00070 
00072   static const char* GetCurrentWorkingDirectory(char* buf, unsigned int len);
00073 
00076   static int MakeDirectory(const char* dir);
00077 
00078 #ifdef VTK_WORKAROUND_WINDOWS_MANGLE
00079 # define CreateDirectoryA CreateDirectory
00080 # define CreateDirectoryW CreateDirectory
00081 #endif
00082 
00084   VTK_LEGACY(static int CreateDirectory(const char* dir));
00085 
00086 #ifdef VTK_WORKAROUND_WINDOWS_MANGLE
00087 # undef CreateDirectoryW
00088 # undef CreateDirectoryA
00089   //BTX
00090   VTK_LEGACY(static int CreateDirectoryA(const char* dir));
00091   VTK_LEGACY(static int CreateDirectoryW(const char* dir));
00092   //ETX
00093 #endif
00094 
00095 protected:
00096   // delete the Files and Path ivars and set
00097   // NumberOfFiles to 0
00098   void CleanUpFilesAndPath();
00099   vtkDirectory();
00100   ~vtkDirectory() ;
00101 
00102 private:
00103   char* Path;           // Path to Open'ed directory
00104   vtkStringArray *Files;    // VTK array of files
00105 
00106   static int CreateDirectoryInternal(const char* dir);
00107 
00108 private:
00109   vtkDirectory(const vtkDirectory&);  // Not implemented.
00110   void operator=(const vtkDirectory&);  // Not implemented.
00111 };
00112 
00113 #endif

Generated on Mon Jan 21 23:07:16 2008 for VTK by  doxygen 1.4.3-20050530