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 "vtkPVInformation.h"
31 #include "vtkRemotingCoreModule.h" //needed for exports
32 
33 #include <string> // Needed for std::string
34 
35 class vtkCollection;
36 class vtkPVFileInformationSet;
38 
40 {
41 public:
42  static vtkPVFileInformation* New();
44  void PrintSelf(ostream& os, vtkIndent indent) override;
45 
50  void CopyFromObject(vtkObject* object) override;
51 
53 
56  void CopyToStream(vtkClientServerStream*) override;
57  void CopyFromStream(const vtkClientServerStream*) override;
59 
60  enum FileTypes
61  {
62  INVALID = 0,
73  DIRECTORY_GROUP
74  };
75 
81  static bool IsDirectory(int t);
82 
86  void Initialize();
87 
89 
93  vtkGetStringMacro(Name);
95 
97 
101  vtkGetStringMacro(FullPath);
103 
105 
108  vtkGetMacro(Type, int);
110 
112 
115  vtkGetMacro(Hidden, bool);
117 
119 
126  vtkGetObjectMacro(Contents, vtkCollection);
127  vtkGetStringMacro(Extension);
128  vtkGetMacro(Size, long long);
129  vtkGetMacro(ModificationTime, time_t);
131 
136  static std::string GetParaViewSharedResourcesDirectory();
137 
141  static std::string GetParaViewExampleFilesDirectory();
142 
146  static std::string GetParaViewDocDirectory();
147 
148 protected:
150  ~vtkPVFileInformation() override;
151 
154 
155  char* Name; // Name of this file/directory.
156  char* FullPath; // Full path for this file/directory.
157  int Type; // Type i.e. File/Directory/FileGroup.
158  bool Hidden; // If file/directory is hidden
159  char* Extension; // File extension
160  long long Size; // File size
161  time_t ModificationTime; // File modification time
162 
163  vtkSetStringMacro(Extension);
164  vtkSetStringMacro(Name);
165  vtkSetStringMacro(FullPath);
166 
167  void GetWindowsDirectoryListing();
168  void GetDirectoryListing();
169 
170  // Goes thru the collection of vtkPVFileInformation objects
171  // are creates file groups, if possible.
172  void OrganizeCollection(vtkPVFileInformationSet& vector);
173 
174  bool DetectType();
175  void GetSpecialDirectories();
176  void SetHiddenFlag();
179 
180 private:
182  void operator=(const vtkPVFileInformation&) = delete;
183 
184  struct vtkInfo;
185 };
186 
187 #endif
virtual void CopyFromStream(const vtkClientServerStream *)
Manage a serialized version of the information.
void PrintSelf(ostream &os, vtkIndent indent) override
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 operator=(const vtkPVInformation &)=delete
#define VTKREMOTINGCORE_EXPORT
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.
static vtkObject * New()
Superclass for information objects.
vtkFileSequenceParser * SequenceParser