VTK  9.2.6
vtkPSystemTools.h
Go to the documentation of this file.
1 /*=========================================================================
2 
3  Program: Visualization Toolkit
4  Module: vtkPSystemTools.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  =========================================================================*/
29 #ifndef vtkPSystemTools_h
30 #define vtkPSystemTools_h
31 
32 #include "vtkObject.h"
33 #include "vtkParallelCoreModule.h" // For export macro
34 #include <string> // for string functions in SystemTools
35 
36 class VTKPARALLELCORE_EXPORT vtkPSystemTools : public vtkObject
37 {
38 public:
39  static vtkPSystemTools* New();
40  vtkTypeMacro(vtkPSystemTools, vtkObject);
41  void PrintSelf(ostream& os, vtkIndent indent) override;
42 
49  static void BroadcastString(std::string&, int proc);
50 
58  static VTK_FILEPATH std::string CollapseFullPath(VTK_FILEPATH const std::string& in_relative);
59  static VTK_FILEPATH std::string CollapseFullPath(
60  VTK_FILEPATH const std::string& in_relative, VTK_FILEPATH const char* in_base);
61 
63 
71  static bool FileExists(VTK_FILEPATH const char* filename, bool isFile);
72  static bool FileExists(VTK_FILEPATH const std::string& filename, bool isFile);
73  static bool FileExists(VTK_FILEPATH const char* filename);
74  static bool FileExists(VTK_FILEPATH const std::string& filename);
76 
80  static bool FileIsDirectory(VTK_FILEPATH const std::string& name);
81 
94  static bool FindProgramPath(const char* argv0, std::string& pathOut, std::string& errorMsg,
95  const char* exeName = nullptr, const char* buildDir = nullptr,
96  const char* installPrefix = nullptr);
97 
101  static VTK_FILEPATH std::string GetCurrentWorkingDirectory(bool collapse = true);
102 
108  static VTK_FILEPATH std::string GetProgramPath(VTK_FILEPATH const std::string&);
109 
110 protected:
111  vtkPSystemTools() = default;
112  ~vtkPSystemTools() override = default;
113 
114 private:
115  vtkPSystemTools(const vtkPSystemTools&) = delete;
116  void operator=(const vtkPSystemTools&) = delete;
117 };
118 
119 #endif
abstract base class for most VTK objects
Definition: vtkObject.h:62
void PrintSelf(ostream &os, vtkIndent indent) override
Methods invoked by print to print information about the object including superclasses.
System tools for file system introspection.
a simple class to control print indentation
Definition: vtkIndent.h:39
#define VTK_FILEPATH
static vtkObject * New()
Create an object with Debug turned off, modified time initialized to zero, and reference counting on...