ParaView
vtkPVFileInformation.h
Go to the documentation of this file.
1 /*=========================================================================
2 
3  Program: ParaView
4  Module: vtkPVFileInformation.h
5 
6  Copyright (c) Kitware, Inc.
7  All rights reserved.
8  See Copyright.txt or http://www.paraview.org/HTML/Copyright.html 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 =========================================================================*/
27 #ifndef vtkPVFileInformation_h
28 #define vtkPVFileInformation_h
29 
30 #include "vtkPVClientServerCoreDefaultModule.h" //needed for exports
31 #include "vtkPVInformation.h"
32 
33 class vtkCollection;
34 class vtkPVFileInformationSet;
36 
37 class VTKPVCLIENTSERVERCOREDEFAULT_EXPORT vtkPVFileInformation : public vtkPVInformation
38 {
39 public:
40  static vtkPVFileInformation* New();
42  void PrintSelf(ostream& os, vtkIndent indent);
43 
48  virtual void CopyFromObject(vtkObject* object);
49 
51 
54  virtual void CopyToStream(vtkClientServerStream*);
55  virtual void CopyFromStream(const vtkClientServerStream*);
57 
58  enum FileTypes
59  {
60  INVALID = 0,
70  NETWORK_SHARE
71  };
72 
78  static bool IsDirectory(int t);
79 
83  void Initialize();
84 
86 
90  vtkGetStringMacro(Name);
92 
94 
98  vtkGetStringMacro(FullPath);
100 
102 
105  vtkGetMacro(Type, int);
107 
109 
112  vtkGetMacro(Hidden, bool);
114 
116 
122  vtkGetObjectMacro(Contents, vtkCollection);
123  vtkGetStringMacro(Extension);
124  vtkGetMacro(Size, long long);
125  vtkGetMacro(ModificationTime, time_t);
127 
128 protected:
131 
132  vtkCollection* Contents;
134 
135  char* Name; // Name of this file/directory.
136  char* FullPath; // Full path for this file/directory.
137  int Type; // Type i.e. File/Directory/FileGroup.
138  bool Hidden; // If file/directory is hidden
139  char* Extension; // File extension
140  long long Size; // File size
141  time_t ModificationTime; // File modification time
142 
143  vtkSetStringMacro(Extension);
144  vtkSetStringMacro(Name);
145  vtkSetStringMacro(FullPath);
146 
147  void GetWindowsDirectoryListing();
148  void GetDirectoryListing();
149 
150  // Goes thru the collection of vtkPVFileInformation objects
151  // are creates file groups, if possible.
152  void OrganizeCollection(vtkPVFileInformationSet& vector);
153 
154  bool DetectType();
155  void GetSpecialDirectories();
156  void SetHiddenFlag();
158 
159 private:
160  vtkPVFileInformation(const vtkPVFileInformation&) VTK_DELETE_FUNCTION;
161  void operator=(const vtkPVFileInformation&) VTK_DELETE_FUNCTION;
162 
163  struct vtkInfo;
164 };
165 
166 #endif
virtual void CopyFromStream(const vtkClientServerStream *)
Manage a serialized version of the information.
Information object that can be used to obtain information about a file/directory. ...
Parses out the base file name of a file sequence and also the specific index of the given file...
Store messages for the interpreter.
void PrintSelf(ostream &os, vtkIndent indent)
virtual void CopyToStream(vtkClientServerStream *)=0
Manage a serialized version of the information.
virtual void CopyFromObject(vtkObject *)
Transfer information about a single object into this object.
Superclass for information objects.
vtkFileSequenceParser * SequenceParser