VTK  9.3.1
vtkPSystemTools.h
Go to the documentation of this file.
1 // SPDX-FileCopyrightText: Copyright (c) Ken Martin, Will Schroeder, Bill Lorensen
2 // SPDX-License-Identifier: BSD-3-Clause
17 #ifndef vtkPSystemTools_h
18 #define vtkPSystemTools_h
19 
20 #include "vtkObject.h"
21 #include "vtkParallelCoreModule.h" // For export macro
22 #include <string> // for string functions in SystemTools
23 
24 VTK_ABI_NAMESPACE_BEGIN
25 class VTKPARALLELCORE_EXPORT vtkPSystemTools : public vtkObject
26 {
27 public:
28  static vtkPSystemTools* New();
29  vtkTypeMacro(vtkPSystemTools, vtkObject);
30  void PrintSelf(ostream& os, vtkIndent indent) override;
31 
38  static void BroadcastString(std::string&, int proc);
39 
47  static VTK_FILEPATH std::string CollapseFullPath(VTK_FILEPATH const std::string& in_relative);
48  static VTK_FILEPATH std::string CollapseFullPath(
49  VTK_FILEPATH const std::string& in_relative, VTK_FILEPATH const char* in_base);
50 
52 
60  static bool FileExists(VTK_FILEPATH const char* filename, bool isFile);
61  static bool FileExists(VTK_FILEPATH const std::string& filename, bool isFile);
62  static bool FileExists(VTK_FILEPATH const char* filename);
63  static bool FileExists(VTK_FILEPATH const std::string& filename);
65 
69  static bool FileIsDirectory(VTK_FILEPATH const std::string& name);
70 
83  static bool FindProgramPath(const char* argv0, std::string& pathOut, std::string& errorMsg,
84  const char* exeName = nullptr, const char* buildDir = nullptr,
85  const char* installPrefix = nullptr);
86 
90  static VTK_FILEPATH std::string GetCurrentWorkingDirectory(bool collapse = true);
91 
97  static VTK_FILEPATH std::string GetProgramPath(VTK_FILEPATH const std::string&);
98 
99 protected:
100  vtkPSystemTools() = default;
101  ~vtkPSystemTools() override = default;
102 
103 private:
104  vtkPSystemTools(const vtkPSystemTools&) = delete;
105  void operator=(const vtkPSystemTools&) = delete;
106 };
107 
108 VTK_ABI_NAMESPACE_END
109 #endif
abstract base class for most VTK objects
Definition: vtkObject.h:51
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:28
#define VTK_FILEPATH
static vtkObject * New()
Create an object with Debug turned off, modified time initialized to zero, and reference counting on...